README.md 4.58 KB
Newer Older
1
# Automatakit API
Jake Read's avatar
Jake Read committed
2

Jake Read's avatar
Jake Read committed
3
4
## oy

5
6
7
8
9
10
11
12
- buffer return ... OK
 - go forth to stepper, then you have this state-double-bouncing issue 
 - then you have this multiline gcode / start / stop sequencing issue 
- really want those LIGHTS 

- lead / state double bounce ?
 - rolls into proper objects, classes, files ?
- more consistent dereferencing 
13

Jake Read's avatar
Jake Read committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
- callback-via-hookup ... steppers -> network, planner -> steppers both want this 
- understand how callbacks work, how often used, etc, cc @ sean 
- button / multiline / 3js UI elements / ui handling throughout ? 

- big P now is how to hook it all up ? 
- same as previous, just to:
 - steppers -> packets, packets -> acks 
 - net checking, events for planner
 - gcode terminal is longer,
 - planner requests next line from gcode 
 - sequencing ?
 - jog keys 
- then want 
 - smarter hookup for networked parts
 - stepper feedback
 - accel feedback
 - 3js window

~ for SFO, we do ~ 
 - machine eats gcode and runs it, and jogs, etc 
 - stretch to add rotary joint ... could concievably do this in the planner also
 - *so* 
  - planner emits moves, steppers pick them out, reply with their axis ids,
  - 


- gcode -> planner -> stepper, loops back ? 
 - draft out event system architecture ... 
 - write gcode multiline inputs, would be cool to track current pos also
 - try fancy txt edit library in UI, like how do we ready for three.js hooks ? 
44
45
46
- modular / muxable axis movements
 - i.e. 'back and forth button' UI elements
- gcode text block / path / file read-in 
Jake Read's avatar
Jake Read committed
47
48
49
50
51

- some styling 
 - state 'squishes' when module moved too far right 
 - state 'input' length / title length for long titles ?

52
- state context menu or button - like 'fire this listener' on click, or get alt description, later edit, reload etc 
Jake Read's avatar
Jake Read committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

- bridge should be able to look for devices, test devices, and do terminal stuff 

- right-click on title of module, reload 

- for crashes etc, how can we re-start / kick serverside from the browser? some other daemon program ?

- probably shouldn't send *all* of the state every time ... ? 
 - althought it's nice and foolproof 

- still want more diverse html inputs ... i.e. text input with some size to it ? gcode parser for this ... 

- write in logger functions
 - i.e. module.log('whatever') is wrapped at load into console.log() and sends serverside log message as well, with ID and name 

Jake Read's avatar
Jake Read committed
68
69
- state variables good
- final steps before writing gcode consumption program 
Jake Read's avatar
Jake Read committed
70
71
72
73
 - nomenclature all over the place is spaget
 - rewriting this is a good reintroduction to project 
  - cleaner replace ? wholistic replace ?
  - classes / pretty code ? find desires by using 
74
75
76
 - any kind of save / load 
  - still with script-type writable file ? 

Jake Read's avatar
Jake Read committed
77
78
 - but largely ready to write planner, serialport and packet parsing modules, do gcode stuff 

79
80
81
82
- server modules are ground truth
- to the client, we serve representations of these modules
- on the client, we keep a copy of this rep , and build a UI for it, ``rep.ui``
- to interface, we push the rep json back and forth, mostly the rep.state object 
Jake Read's avatar
Jake Read committed
83

Jake Read's avatar
Jake Read committed
84
85
86
87
88
89
90
## remember

you have friends
 - bro
 - sean
 - nathan 

Jake Read's avatar
Jake Read committed
91
## links to things 
Jake Read's avatar
Jake Read committed
92

Jake Read's avatar
Jake Read committed
93
http://designmodo.github.io/Flat-UI/
Jake Read's avatar
Jake Read committed
94

Jake Read's avatar
Jake Read committed
95
http://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage 
Jake Read's avatar
Jake Read committed
96

Jake Read's avatar
Jake Read committed
97
bootstrap, numeric.js ... 
Jake Read's avatar
Jake Read committed
98

Jake Read's avatar
Jake Read committed
99
http://backbonejs.org/#Events
100

101
102
## Desires
 - load / keep state 
Jake Read's avatar
Jake Read committed
103
104
105
 - run headless with view into 
 - collaborative program editing would be cool 
 - program save / load / edit ?
106

107
## Model Consistency
108

109
In Memory: array of modules
110

111
Saved / interfaced with: json of this - so to load from this, we need paths and ids attached to each module on load time.
112

113
To wrap / add heirarchy: this json object can be loaded the same as a program, given top level inputs and outputs, and made into another require()d module. 
114

115
Modules are tiny programs, specifics (inputs, outputs, state) are read by system and wrapped into UI. UI has access to write into state, and connect events together.
116

117
To wrap, we write a representation in api-type rep, with one connection. We output the 'text line' of a Terminal into the 'text input' input of a gcode parser, and see the output / state bubble through the UI.
118

119
120
121
122
 - to test, cleanup and write gcode obj
 - confirm state change comes down to server
 - confirm event bubbles through in server 
 - push event back to server ui ? dat.updatedisplay() ? 
123

124
For extra points, we read in the connection also with an SVG layer - iterating through connections of the represented program.
125

Jake Read's avatar
Jake Read committed
126
127
128
129
130
131
132
133
134
135
# The RPI

 - sudo apt-get update
 - sudo apt-get upgrade
 - install nvm
  -  
 - install git 

- https://cnc.js.org/ 
- https://github.com/cncjs/cncjs/wiki/Setup-Guide:-Raspberry-Pi-%7C-Install-Node.js-via-Node-Version-Manager-(NVM)