Commit 404c91f4 authored by Jake Read's avatar Jake Read

...

parent edc8ec04
......@@ -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 ?
......
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
......@@ -31,7 +31,6 @@ var program = {}
program = Programs.open('programs/default.json')
// UI
const View = require('./views.js')
View.startHttp()
......
......@@ -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
......
{
"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
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment