Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jake Read
rndmc
Commits
404c91f4
Commit
404c91f4
authored
Nov 11, 2018
by
Jake Read
Browse files
...
parent
edc8ec04
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
404c91f4
...
...
@@ -35,6 +35,7 @@ This project serves the developement environment / api we use to write and repre
-
change settings
## Questionable Moves
-
test load of dmz.json - unordered list / names / no mdl ?
-
module deletion seems unclean
-
input / output objects should be able to unhook themselves:
-
keep references of what-is-attached ?
...
...
client/dummies.js
deleted
100644 → 0
View file @
edc8ec04
var
gcodeDummy
=
{
name
:
'
gcode
'
,
id
:
12
,
state
:
{
mode
:
'
G0
'
,
flavor
:
'
sensible
'
,
speeds
:
{
G0
:
1200
,
G1
:
400
}
},
inputs
:
{
lineIn
:
{
type
:
'
string
'
,
description
:
'
single line to parse
'
}
},
outputs
:
{
instruction
:
{
type
:
'
object
'
,
class
:
'
MoveInstruction
'
,
description
:
'
parsed move instruction
'
}
}
}
var
terminalDummy
=
{
name
:
'
terminal
'
,
id
:
13
,
state
:
{
width
:
64
,
height
:
48
},
inputs
:
{
lineIn
:
{
type
:
'
object
'
}
},
outputs
:
{
lineOut
:
{
type
:
'
string
'
,
description
:
'
line from terminal
'
}
}
}
\ No newline at end of file
main.js
View file @
404c91f4
...
...
@@ -31,7 +31,6 @@ var program = {}
program
=
Programs
.
open
(
'
programs/default.json
'
)
// UI
const
View
=
require
(
'
./views.js
'
)
View
.
startHttp
()
...
...
programs.js
View file @
404c91f4
...
...
@@ -169,6 +169,7 @@ function openProgram(path){
// keys should be identical for rep and heap
// this is the representation that we're opening up from
var
mdlRep
=
prgRep
.
modules
[
modName
]
// this is the actual object, having functions and whatnot
var
mdl
=
program
.
modules
[
modName
]
...
...
@@ -198,6 +199,7 @@ function openProgram(path){
// restore position / UI state
if
(
mdlRep
.
description
.
position
!=
null
){
// ??
mdl
.
description
.
position
=
{}
mdl
.
description
.
position
.
left
=
mdlRep
.
description
.
position
.
left
mdl
.
description
.
position
.
top
=
mdlRep
.
description
.
position
.
top
...
...
programs/dmz.json
0 → 100644
View file @
404c91f4
{
"description"
:
{
"name"
:
"tstprgmem"
,
"counter"
:
9
},
"modules"
:
{
"gate-1"
:
{
"description"
:
{
"id"
:
"gate-1"
,
"name"
:
"gate"
,
"alt"
:
"in ... out"
,
"path"
:
"./src/util/gate.js"
,
"position"
:
{
"left"
:
10
,
"top"
:
30
}
},
"inputs"
:
{
"thru"
:
{
"accepts"
:
"any"
}
},
"outputs"
:
{
"out"
:
{
"emits"
:
"any"
,
"calls"
:
[
{
"parentId"
:
"delay-2"
,
"key"
:
"thru"
}
]
}
},
"state"
:
{
"toggle"
:
{
"type"
:
"button"
,
"label"
:
"Open / Close"
},
"message"
:
"closed"
}
},
"delay-2"
:
{
"description"
:
{
"id"
:
"delay-2"
,
"name"
:
"delay"
,
"alt"
:
"in ... out"
,
"path"
:
"./src/util/delay.js"
,
"position"
:
{
"left"
:
132
,
"top"
:
225
}
},
"inputs"
:
{
"thru"
:
{
"accepts"
:
"any"
}
},
"outputs"
:
{
"out"
:
{
"emits"
:
"any"
,
"calls"
:
[
{
"parentId"
:
"logger-3"
,
"key"
:
"thru"
}
]
}
},
"state"
:
{
"ms"
:
1200
}
},
"logger-3"
:
{
"description"
:
{
"id"
:
"logger-3"
,
"name"
:
"logger"
,
"alt"
:
"in ... out to console"
,
"path"
:
"./src/util/log.js"
,
"position"
:
{
"left"
:
123
,
"top"
:
367
}
},
"inputs"
:
{
"thru"
:
{
"accepts"
:
"any"
}
},
"outputs"
:
{
"throughput"
:
{
"emits"
:
"any"
,
"calls"
:
[]
}
},
"state"
:
{
"prefix"
:
"LOGGER:"
,
"message"
:
"---"
}
},
"Breadboard Servo Signal Generator-6"
:
{
"description"
:
{
"id"
:
"Breadboard Servo Signal Generator-6"
,
"name"
:
"Breadboard Servo Signal Generator"
,
"alt"
:
"servo"
,
"path"
:
"./src/hardware/servo.js"
,
"position"
:
{
"left"
:
583
,
"top"
:
632
}
},
"inputs"
:
{
"packet"
:
{
"accepts"
:
"headless packet"
}
},
"outputs"
:
{
"packet"
:
{
"emits"
:
"number"
,
"calls"
:
[]
}
},
"state"
:
{
"button"
:
{
"type"
:
"button"
,
"label"
:
"SEND"
},
"servoVal"
:
0
}
},
"delay-7"
:
{
"description"
:
{
"id"
:
"delay-7"
,
"name"
:
"delay"
,
"alt"
:
"in ... out"
,
"path"
:
"./src/util/delay.js"
,
"position"
:
{
"left"
:
627
,
"top"
:
193
}
},
"inputs"
:
{
"thru"
:
{
"accepts"
:
"any"
}
},
"outputs"
:
{
"out"
:
{
"emits"
:
"any"
,
"calls"
:
[]
}
},
"state"
:
{
"ms"
:
100
}
},
"delay-8"
:
{
"description"
:
{
"id"
:
"delay-8"
,
"name"
:
"delay"
,
"alt"
:
"in ... out"
,
"path"
:
"./src/util/delay.js"
,
"position"
:
{
"left"
:
676
,
"top"
:
345
}
},
"inputs"
:
{
"thru"
:
{
"accepts"
:
"any"
}
},
"outputs"
:
{
"out"
:
{
"emits"
:
"any"
,
"calls"
:
[]
}
},
"state"
:
{
"ms"
:
100
}
},
"logger-9"
:
{
"description"
:
{
"id"
:
"logger-9"
,
"name"
:
"logger"
,
"alt"
:
"in ... out to console"
,
"path"
:
"./src/util/log.js"
,
"position"
:
{
"left"
:
622
,
"top"
:
467
}
},
"inputs"
:
{
"thru"
:
{
"accepts"
:
"any"
}
},
"outputs"
:
{
"throughput"
:
{
"emits"
:
"any"
,
"calls"
:
[]
}
},
"state"
:
{
"prefix"
:
"LOGGER:"
,
"message"
:
"---"
}
}
}
}
\ No newline at end of file
src/util/gate.js
View file @
404c91f4
...
...
@@ -21,9 +21,10 @@ function Gate() {
var
state
=
gate
.
state
state
.
toggle
=
Button
(
"
Open / Close
"
,
onButtonPress
)
state
.
message
=
'
closed
'
// yikes
gate
.
isOpen
=
false
state
.
message
=
'
closed
'
gate
.
inputs
=
{
thru
:
Input
(
'
any
'
,
gateKeeper
)
// makes anything into '1' event
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment