From c96e76cb7cc2f692d7e874e8bb4eb99ab2331a02 Mon Sep 17 00:00:00 2001 From: Jake <jake.read@cba.mit.edu> Date: Mon, 26 Nov 2018 23:01:03 -0500 Subject: [PATCH] prgmem for mm --- README.md | 3 + client/style.css | 28 +- client/ui/multiline.js | 6 +- modules/hardware/atkbreadboardboard.js | 11 +- modules/hardware/atkseriallink.js | 2 +- modules/ui/multiline.js | 11 +- modules/ui/number.js | 2 - programs.js | 10 +- programs/mm2.json | 150 ++++++ programs/mm3.json | 320 +++++++++++++ programs/mm4.json | 462 ++++++++++++++++++ programs/mm5.json | 554 ++++++++++++++++++++++ programs/mm6.json | 583 +++++++++++++++++++++++ programs/mm7.json | 620 +++++++++++++++++++++++++ programs/mm8.json | 620 +++++++++++++++++++++++++ programs/mmother-1.json | 408 ++++++++++++++++ src/ui/multiline.js | 14 +- src/ui/uiButton.js | 2 +- 18 files changed, 3778 insertions(+), 28 deletions(-) create mode 100644 programs/mm2.json create mode 100644 programs/mm3.json create mode 100644 programs/mm4.json create mode 100644 programs/mm5.json create mode 100644 programs/mm6.json create mode 100644 programs/mm7.json create mode 100644 programs/mm8.json create mode 100644 programs/mmother-1.json diff --git a/README.md b/README.md index 6a0930c..3d7f6d7 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,9 @@ View.assignProgram(program) ## Immediately +- ui objects ... refresh ... use state model ? +- ui objects client drop below inputs / outputs + - ui / button - would like to send board with new buck out to fab diff --git a/client/style.css b/client/style.css index 7ad87f5..a06a9b9 100644 --- a/client/style.css +++ b/client/style.css @@ -45,11 +45,29 @@ body { color: #eee; } +.outputs { + width: 78px; + float: right; + margin-right: 2px; + text-align: right; + font-size: 11px; + background-color: #1a1a1a; + color: #eee; +} + .state { padding: 0 83px 0 83px; color: #eee; } +.uidiv { + width: 396px; + padding-top: 5px; + margin-left: 2px; + margin-right: 2px; + float: left; +} + textarea { resize: none; } @@ -75,16 +93,6 @@ textarea { margin-right: 0px; } -.outputs { - width: 78px; - float: right; - margin-right: 2px; - text-align: right; - font-size: 11px; - background-color: #1a1a1a; - color: #eee; -} - .clear { clear: both; } diff --git a/client/ui/multiline.js b/client/ui/multiline.js index 8f16cbe..a602147 100644 --- a/client/ui/multiline.js +++ b/client/ui/multiline.js @@ -11,7 +11,7 @@ li.appendChild(document.createElement('br')) var txtArea = document.createElement('textarea') txtArea.rows = 25 - txtArea.cols = 25 + txtArea.cols = 45 txtArea.value = '-' txtArea.addEventListener('change', function() { var data = { @@ -35,11 +35,11 @@ // upstream, and besides, wouldn't be able to get anything from // the server multiline.onMessage = function(msg) { - console.log('got message in client side ui object', msg) + //console.log('got message in client side ui object', msg) if (msg.call == 'setContents') { txtArea.value = msg.argument } else if (msg.call == 'setLabel'){ - label.innerHTML- msg.argument + label.textContent = msg.argument } else if (msg.call == 'setRows') { txtArea.rows = msg.argument } diff --git a/modules/hardware/atkbreadboardboard.js b/modules/hardware/atkbreadboardboard.js index 6a546c2..ae00978 100644 --- a/modules/hardware/atkbreadboardboard.js +++ b/modules/hardware/atkbreadboardboard.js @@ -33,11 +33,18 @@ function ATKBreadBoardBoard() { // and state as well var state = atkbbb.state - state.servoButton = Button('SEND VALUE', onServoValChange) state.servoVal = 0 // 0->100 does 1 -> 2ms duty on 20ms period state.onUiChange('servoVal', onServoValChange) - state.adcButton = Button('REQUEST ADC CONVERSION', onADCRequest) + var ui = atkbbb.ui + ui.addElement('servoButton', './ui/uiButton.js', onServoValChange) + ui.servoButton.onload = function(){ + ui.servoButton.setText('click to send servo value') + } + ui.addElement('adcReqButton', './ui/uiButton.js', onADCRequest) + ui.adcReqButton.onload = function(){ + ui.adcReqButton.setText('click to request adc conversion') + } // to send things down the well, we can use // atkbbb.route.send(packet) diff --git a/modules/hardware/atkseriallink.js b/modules/hardware/atkseriallink.js index 21f88b3..549c12a 100644 --- a/modules/hardware/atkseriallink.js +++ b/modules/hardware/atkseriallink.js @@ -15,7 +15,7 @@ function ATKSerialLink() { description: { isHardware: true, isLink: true, - name: 'Serialport ATK Link', + name: 'SerialportATKLink', alt: 'window into hardware world' }, routes: new Array() diff --git a/modules/ui/multiline.js b/modules/ui/multiline.js index 3660f5c..9c7e687 100644 --- a/modules/ui/multiline.js +++ b/modules/ui/multiline.js @@ -36,18 +36,22 @@ function MultiLineIn() { ui.previously.onload = function(){ ui.previously.setContents('-') ui.previously.setLabel('previously:') + ui.previously.setRows(15) } ui.addElement('justNow', './ui/multiline.js', null) ui.justNow.onload = function(){ ui.justNow.setContents('-') ui.justNow.setLabel('just now:') + ui.justNow.setRows(1) } ui.addElement('incoming', './ui/multiline.js', null) ui.incoming.onload = function(){ - ui.incoming.setContents('G0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\n') + //ui.incoming.setContents('G0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\nG0 F50 X10Y10Z10\nG0 X20Y20Z0\nG0 X0\nG0 Y10\n') ui.incoming.setLabel('incoming:') + ui.incoming.setRows(50) + onLoadFile('./files/dogbone.gcode') } multilinein.inputs = { @@ -104,15 +108,12 @@ function MultiLineIn() { if (err) throw err; console.log('Loading:') console.log(data); - //state.incoming.value = data - //state.incoming = state.incoming + ui.incoming.setContents(data) }) } multilinein.load = onLoadFile - onLoadFile('./files/dogbone.gcode') - function onExternalLine(str) { // push new str to bottom of queue } diff --git a/modules/ui/number.js b/modules/ui/number.js index 00620ae..6f429bd 100644 --- a/modules/ui/number.js +++ b/modules/ui/number.js @@ -36,8 +36,6 @@ function uiNum() { ui.onNumberButton.setText('number out ->') } - state.button = Button('WHAM', onNumberDesire) - // inputs are required, and must be Input('type', callback) uinum.inputs = { thru: Input('any', onThruInput), // makes anything into num event diff --git a/programs.js b/programs.js index 2478362..11d0887 100644 --- a/programs.js +++ b/programs.js @@ -61,9 +61,15 @@ function loadModuleFromSource(program, path, id) { // state items get wrapped in a getter / setter // so that changes from internal modules can // push to UI - mod.state.init(mod.description.id, socket) + // and not all have state + if(mod.state != null){ + mod.state.init(mod.description.id, socket) + } - mod.ui.init(mod.description.id, socket) + // not all have ui, + if(mod.ui != null){ + mod.ui.init(mod.description.id, socket) + } /* for (key in mod.state) { diff --git a/programs/mm2.json b/programs/mm2.json new file mode 100644 index 0000000..3f4045c --- /dev/null +++ b/programs/mm2.json @@ -0,0 +1,150 @@ +{ + "description": { + "name": "new program", + "counter": 2 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 650, + "top": 307 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 177, + "top": 118 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 183, + "top": 545 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + } + } +} \ No newline at end of file diff --git a/programs/mm3.json b/programs/mm3.json new file mode 100644 index 0000000..780ff16 --- /dev/null +++ b/programs/mm3.json @@ -0,0 +1,320 @@ +{ + "description": { + "name": "new program", + "counter": 6 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2379, + "top": 568 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 77 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1827, + "top": 499 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-4": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-4", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 928 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1834, + "top": 1354 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKBBB-Servo-6": { + "description": { + "name": "ATKBBB-Servo", + "alt": "software representation of networked hardware object", + "isHardware": true, + "id": "ATKBBB-Servo-6", + "path": "./modules/hardware/atkbreadboardboard.js", + "position": { + "left": 2320, + "top": 1484 + } + }, + "inputs": { + "servoVal": { + "accepts": "number" + }, + "adcRequest": { + "accepts": "event" + } + }, + "outputs": { + "servoConf": { + "emits": "event", + "calls": [] + }, + "adcValue": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "servoVal": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "servoButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "adcReqButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + } + } +} \ No newline at end of file diff --git a/programs/mm4.json b/programs/mm4.json new file mode 100644 index 0000000..42ab30c --- /dev/null +++ b/programs/mm4.json @@ -0,0 +1,462 @@ +{ + "description": { + "name": "new program", + "counter": 9 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2379, + "top": 568 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 77 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1827, + "top": 499 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-4": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-4", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 928 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1834, + "top": 1354 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKBBB-Servo-6": { + "description": { + "name": "ATKBBB-Servo", + "alt": "software representation of networked hardware object", + "isHardware": true, + "id": "ATKBBB-Servo-6", + "path": "./modules/hardware/atkbreadboardboard.js", + "position": { + "left": 2320, + "top": 1484 + } + }, + "inputs": { + "servoVal": { + "accepts": "number" + }, + "adcRequest": { + "accepts": "event" + } + }, + "outputs": { + "servoConf": { + "emits": "event", + "calls": [] + }, + "adcValue": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "servoVal": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "servoButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "adcReqButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Multi-line Text Input-7": { + "description": { + "name": "Multi-line Text Input", + "alt": "sequential txt input", + "id": "Multi-line Text Input-7", + "path": "./modules/ui/multiline.js", + "position": { + "left": 78, + "top": 172 + } + }, + "inputs": { + "req": { + "accepts": "number" + }, + "lineIn": { + "accepts": "string" + }, + "load": { + "accepts": "path" + } + }, + "outputs": { + "lineOut": { + "emits": "string", + "calls": [] + } + }, + "state": {}, + "ui": { + "thruButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "previously": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "justNow": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "incoming": { + "type": "button", + "clientPath": "ui/multiline.js" + } + } + }, + "Gcode Parser-8": { + "description": { + "name": "Gcode Parser", + "alt": "line of gcode -> planner recognized move", + "id": "Gcode Parser-8", + "path": "./modules/parsing/gcode.js", + "position": { + "left": 649, + "top": 167 + } + }, + "inputs": { + "lineIn": { + "accepts": "string" + } + }, + "outputs": { + "instructionOut": { + "emits": "move instruction", + "calls": [] + }, + "modeChange": { + "emits": "string", + "calls": [] + } + }, + "state": { + "mode": "G0", + "G0": 1200, + "G1": 400 + }, + "ui": {} + }, + "Lookahead-Motion-Planner-9": { + "description": { + "name": "Lookahead-Motion-Planner", + "alt": "movements -> acceleration planned moves", + "id": "Lookahead-Motion-Planner-9", + "path": "./modules/motion/planner.js", + "position": { + "left": 1155, + "top": 168 + } + }, + "inputs": { + "instruction": { + "accepts": "move instruction" + }, + "acks": { + "accepts": "move acknowledgement" + }, + "run": { + "accepts": "boolean" + } + }, + "outputs": { + "moves": { + "emits": "move instruction", + "calls": [] + }, + "moveComplete": { + "emits": "number", + "calls": [] + } + }, + "state": { + "axisIDs": "X,Y,Z", + "accel": 200, + "jd": 0.1, + "minSpeed": 1, + "position": [ + 0, + 0, + 0 + ], + "isRunning": 0, + "netWindow": 3, + "netState": [ + 0, + 0, + 0 + ] + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "startStopButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + } + } +} \ No newline at end of file diff --git a/programs/mm5.json b/programs/mm5.json new file mode 100644 index 0000000..b08b3cb --- /dev/null +++ b/programs/mm5.json @@ -0,0 +1,554 @@ +{ + "description": { + "name": "new program", + "counter": 12 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2379, + "top": 568 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 77 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1827, + "top": 499 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-4": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-4", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 928 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1834, + "top": 1354 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKBBB-Servo-6": { + "description": { + "name": "ATKBBB-Servo", + "alt": "software representation of networked hardware object", + "isHardware": true, + "id": "ATKBBB-Servo-6", + "path": "./modules/hardware/atkbreadboardboard.js", + "position": { + "left": 2320, + "top": 1484 + } + }, + "inputs": { + "servoVal": { + "accepts": "number" + }, + "adcRequest": { + "accepts": "event" + } + }, + "outputs": { + "servoConf": { + "emits": "event", + "calls": [] + }, + "adcValue": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "servoVal": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "servoButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "adcReqButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Multi-line Text Input-7": { + "description": { + "name": "Multi-line Text Input", + "alt": "sequential txt input", + "id": "Multi-line Text Input-7", + "path": "./modules/ui/multiline.js", + "position": { + "left": 78, + "top": 172 + } + }, + "inputs": { + "req": { + "accepts": "number" + }, + "lineIn": { + "accepts": "string" + }, + "load": { + "accepts": "path" + } + }, + "outputs": { + "lineOut": { + "emits": "string", + "calls": [] + } + }, + "state": {}, + "ui": { + "thruButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "previously": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "justNow": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "incoming": { + "type": "button", + "clientPath": "ui/multiline.js" + } + } + }, + "Gcode Parser-8": { + "description": { + "name": "Gcode Parser", + "alt": "line of gcode -> planner recognized move", + "id": "Gcode Parser-8", + "path": "./modules/parsing/gcode.js", + "position": { + "left": 649, + "top": 167 + } + }, + "inputs": { + "lineIn": { + "accepts": "string" + } + }, + "outputs": { + "instructionOut": { + "emits": "move instruction", + "calls": [] + }, + "modeChange": { + "emits": "string", + "calls": [] + } + }, + "state": { + "mode": "G0", + "G0": 1200, + "G1": 400 + }, + "ui": {} + }, + "Lookahead-Motion-Planner-9": { + "description": { + "name": "Lookahead-Motion-Planner", + "alt": "movements -> acceleration planned moves", + "id": "Lookahead-Motion-Planner-9", + "path": "./modules/motion/planner.js", + "position": { + "left": 1155, + "top": 168 + } + }, + "inputs": { + "instruction": { + "accepts": "move instruction" + }, + "acks": { + "accepts": "move acknowledgement" + }, + "run": { + "accepts": "boolean" + } + }, + "outputs": { + "moves": { + "emits": "move instruction", + "calls": [] + }, + "moveComplete": { + "emits": "number", + "calls": [] + } + }, + "state": { + "axisIDs": "X,Y,Z", + "accel": 200, + "jd": 0.1, + "minSpeed": 1, + "position": [ + 0, + 0, + 0 + ], + "isRunning": 0, + "netWindow": 3, + "netState": [ + 0, + 0, + 0 + ] + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "startStopButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "number-output-10": { + "description": { + "name": "number-output", + "alt": "for clicking", + "id": "number-output-10", + "path": "./modules/ui/number.js", + "position": { + "left": 649, + "top": 626 + } + }, + "inputs": { + "thru": { + "accepts": "any" + }, + "evt": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "number", + "calls": [] + } + }, + "state": { + "number": 10 + }, + "ui": { + "onNumberButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Button-11": { + "description": { + "name": "Button", + "alt": "for clicking", + "id": "Button-11", + "path": "./modules/ui/button.js", + "position": { + "left": 651, + "top": 473 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "whammy": { + "emits": "number", + "calls": [] + } + }, + "state": {}, + "ui": { + "btn": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "delay-12": { + "description": { + "name": "delay", + "alt": "in ... out", + "id": "delay-12", + "path": "./modules/util/delay.js", + "position": { + "left": 647, + "top": 811 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "any", + "calls": [] + } + }, + "state": { + "ms": 100 + }, + "ui": {} + } + } +} \ No newline at end of file diff --git a/programs/mm6.json b/programs/mm6.json new file mode 100644 index 0000000..455d6ba --- /dev/null +++ b/programs/mm6.json @@ -0,0 +1,583 @@ +{ + "description": { + "name": "new program", + "counter": 12 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2379, + "top": 568 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 77 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1827, + "top": 499 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-4": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-4", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 928 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1834, + "top": 1354 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKBBB-Servo-6": { + "description": { + "name": "ATKBBB-Servo", + "alt": "software representation of networked hardware object", + "isHardware": true, + "id": "ATKBBB-Servo-6", + "path": "./modules/hardware/atkbreadboardboard.js", + "position": { + "left": 2320, + "top": 1484 + } + }, + "inputs": { + "servoVal": { + "accepts": "number" + }, + "adcRequest": { + "accepts": "event" + } + }, + "outputs": { + "servoConf": { + "emits": "event", + "calls": [] + }, + "adcValue": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "servoVal": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "servoButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "adcReqButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Multi-line Text Input-7": { + "description": { + "name": "Multi-line Text Input", + "alt": "sequential txt input", + "id": "Multi-line Text Input-7", + "path": "./modules/ui/multiline.js", + "position": { + "left": 78, + "top": 172 + } + }, + "inputs": { + "req": { + "accepts": "number" + }, + "lineIn": { + "accepts": "string" + }, + "load": { + "accepts": "path" + } + }, + "outputs": { + "lineOut": { + "emits": "string", + "calls": [ + { + "parentId": "Gcode Parser-8", + "key": "lineIn" + } + ] + } + }, + "state": {}, + "ui": { + "thruButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "previously": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "justNow": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "incoming": { + "type": "button", + "clientPath": "ui/multiline.js" + } + } + }, + "Gcode Parser-8": { + "description": { + "name": "Gcode Parser", + "alt": "line of gcode -> planner recognized move", + "id": "Gcode Parser-8", + "path": "./modules/parsing/gcode.js", + "position": { + "left": 649, + "top": 167 + } + }, + "inputs": { + "lineIn": { + "accepts": "string" + } + }, + "outputs": { + "instructionOut": { + "emits": "move instruction", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "instruction" + } + ] + }, + "modeChange": { + "emits": "string", + "calls": [] + } + }, + "state": { + "mode": "G0", + "G0": 1200, + "G1": 400 + }, + "ui": {} + }, + "Lookahead-Motion-Planner-9": { + "description": { + "name": "Lookahead-Motion-Planner", + "alt": "movements -> acceleration planned moves", + "id": "Lookahead-Motion-Planner-9", + "path": "./modules/motion/planner.js", + "position": { + "left": 1155, + "top": 168 + } + }, + "inputs": { + "instruction": { + "accepts": "move instruction" + }, + "acks": { + "accepts": "move acknowledgement" + }, + "run": { + "accepts": "boolean" + } + }, + "outputs": { + "moves": { + "emits": "move instruction", + "calls": [] + }, + "moveComplete": { + "emits": "number", + "calls": [] + } + }, + "state": { + "axisIDs": "X,Y,Z", + "accel": 200, + "jd": 0.1, + "minSpeed": 1, + "position": [ + 0, + 0, + 0 + ], + "isRunning": 0, + "netWindow": 3, + "netState": [ + 0, + 0, + 0 + ] + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "startStopButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "number-output-10": { + "description": { + "name": "number-output", + "alt": "for clicking", + "id": "number-output-10", + "path": "./modules/ui/number.js", + "position": { + "left": 649, + "top": 626 + } + }, + "inputs": { + "thru": { + "accepts": "any" + }, + "evt": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "number", + "calls": [ + { + "parentId": "Multi-line Text Input-7", + "key": "req" + } + ] + } + }, + "state": { + "number": 10 + }, + "ui": { + "onNumberButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Button-11": { + "description": { + "name": "Button", + "alt": "for clicking", + "id": "Button-11", + "path": "./modules/ui/button.js", + "position": { + "left": 651, + "top": 473 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "whammy": { + "emits": "number", + "calls": [ + { + "parentId": "number-output-10", + "key": "evt" + }, + { + "parentId": "delay-12", + "key": "thru" + } + ] + } + }, + "state": {}, + "ui": { + "btn": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "delay-12": { + "description": { + "name": "delay", + "alt": "in ... out", + "id": "delay-12", + "path": "./modules/util/delay.js", + "position": { + "left": 647, + "top": 811 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "any", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "run" + } + ] + } + }, + "state": { + "ms": 100 + }, + "ui": {} + } + } +} \ No newline at end of file diff --git a/programs/mm7.json b/programs/mm7.json new file mode 100644 index 0000000..0456b0d --- /dev/null +++ b/programs/mm7.json @@ -0,0 +1,620 @@ +{ + "description": { + "name": "new program", + "counter": 12 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2379, + "top": 568 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 77 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "acks" + } + ] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1827, + "top": 499 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "acks" + } + ] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-4": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-4", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 928 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1834, + "top": 1354 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "acks" + } + ] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKBBB-Servo-6": { + "description": { + "name": "ATKBBB-Servo", + "alt": "software representation of networked hardware object", + "isHardware": true, + "id": "ATKBBB-Servo-6", + "path": "./modules/hardware/atkbreadboardboard.js", + "position": { + "left": 2320, + "top": 1484 + } + }, + "inputs": { + "servoVal": { + "accepts": "number" + }, + "adcRequest": { + "accepts": "event" + } + }, + "outputs": { + "servoConf": { + "emits": "event", + "calls": [] + }, + "adcValue": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "servoVal": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "servoButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "adcReqButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Multi-line Text Input-7": { + "description": { + "name": "Multi-line Text Input", + "alt": "sequential txt input", + "id": "Multi-line Text Input-7", + "path": "./modules/ui/multiline.js", + "position": { + "left": 78, + "top": 172 + } + }, + "inputs": { + "req": { + "accepts": "number" + }, + "lineIn": { + "accepts": "string" + }, + "load": { + "accepts": "path" + } + }, + "outputs": { + "lineOut": { + "emits": "string", + "calls": [ + { + "parentId": "Gcode Parser-8", + "key": "lineIn" + } + ] + } + }, + "state": {}, + "ui": { + "thruButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "previously": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "justNow": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "incoming": { + "type": "button", + "clientPath": "ui/multiline.js" + } + } + }, + "Gcode Parser-8": { + "description": { + "name": "Gcode Parser", + "alt": "line of gcode -> planner recognized move", + "id": "Gcode Parser-8", + "path": "./modules/parsing/gcode.js", + "position": { + "left": 649, + "top": 167 + } + }, + "inputs": { + "lineIn": { + "accepts": "string" + } + }, + "outputs": { + "instructionOut": { + "emits": "move instruction", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "instruction" + } + ] + }, + "modeChange": { + "emits": "string", + "calls": [] + } + }, + "state": { + "mode": "G0", + "G0": 1200, + "G1": 400 + }, + "ui": {} + }, + "Lookahead-Motion-Planner-9": { + "description": { + "name": "Lookahead-Motion-Planner", + "alt": "movements -> acceleration planned moves", + "id": "Lookahead-Motion-Planner-9", + "path": "./modules/motion/planner.js", + "position": { + "left": 1235, + "top": 299 + } + }, + "inputs": { + "instruction": { + "accepts": "move instruction" + }, + "acks": { + "accepts": "move acknowledgement" + }, + "run": { + "accepts": "boolean" + } + }, + "outputs": { + "moves": { + "emits": "move instruction", + "calls": [ + { + "parentId": "ATKStepper-1", + "key": "trapezoid" + }, + { + "parentId": "ATKStepper-2", + "key": "trapezoid" + }, + { + "parentId": "ATKStepper-4", + "key": "trapezoid" + }, + { + "parentId": "ATKStepper-5", + "key": "trapezoid" + } + ] + }, + "moveComplete": { + "emits": "number", + "calls": [ + { + "parentId": "Multi-line Text Input-7", + "key": "req" + } + ] + } + }, + "state": { + "axisIDs": "X,Y,Z", + "accel": 200, + "jd": 0.1, + "minSpeed": 1, + "position": [ + 0, + 0, + 0 + ], + "isRunning": 0, + "netWindow": 3, + "netState": [ + 0, + 0, + 0 + ] + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "startStopButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "number-output-10": { + "description": { + "name": "number-output", + "alt": "for clicking", + "id": "number-output-10", + "path": "./modules/ui/number.js", + "position": { + "left": 649, + "top": 626 + } + }, + "inputs": { + "thru": { + "accepts": "any" + }, + "evt": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "number", + "calls": [ + { + "parentId": "Multi-line Text Input-7", + "key": "req" + } + ] + } + }, + "state": { + "number": 10 + }, + "ui": { + "onNumberButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Button-11": { + "description": { + "name": "Button", + "alt": "for clicking", + "id": "Button-11", + "path": "./modules/ui/button.js", + "position": { + "left": 651, + "top": 473 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "whammy": { + "emits": "number", + "calls": [ + { + "parentId": "number-output-10", + "key": "evt" + }, + { + "parentId": "delay-12", + "key": "thru" + } + ] + } + }, + "state": {}, + "ui": { + "btn": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "delay-12": { + "description": { + "name": "delay", + "alt": "in ... out", + "id": "delay-12", + "path": "./modules/util/delay.js", + "position": { + "left": 647, + "top": 811 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "any", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "run" + } + ] + } + }, + "state": { + "ms": 100 + }, + "ui": {} + } + } +} \ No newline at end of file diff --git a/programs/mm8.json b/programs/mm8.json new file mode 100644 index 0000000..94dba11 --- /dev/null +++ b/programs/mm8.json @@ -0,0 +1,620 @@ +{ + "description": { + "name": "new program", + "counter": 12 + }, + "modules": { + "SerialportATKLink-0": { + "description": { + "isHardware": true, + "isLink": true, + "name": "SerialportATKLink", + "alt": "window into hardware world", + "id": "SerialportATKLink-0", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2379, + "top": 568 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-1": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-1", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 77 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "acks" + } + ] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 80, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-2": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-2", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1827, + "top": 499 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "acks" + } + ] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,3", + "rate": 2000, + "axis": "Y", + "spu": 80, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-4": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-4", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1826, + "top": 928 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,5", + "rate": 2000, + "axis": "Y", + "spu": -80, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1834, + "top": 1354 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "acks" + } + ] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,1", + "rate": 2000, + "axis": "Z", + "spu": -80, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKBBB-Servo-6": { + "description": { + "name": "ATKBBB-Servo", + "alt": "software representation of networked hardware object", + "isHardware": true, + "id": "ATKBBB-Servo-6", + "path": "./modules/hardware/atkbreadboardboard.js", + "position": { + "left": 2320, + "top": 1484 + } + }, + "inputs": { + "servoVal": { + "accepts": "number" + }, + "adcRequest": { + "accepts": "event" + } + }, + "outputs": { + "servoConf": { + "emits": "event", + "calls": [] + }, + "adcValue": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,2", + "servoVal": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "servoButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "adcReqButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Multi-line Text Input-7": { + "description": { + "name": "Multi-line Text Input", + "alt": "sequential txt input", + "id": "Multi-line Text Input-7", + "path": "./modules/ui/multiline.js", + "position": { + "left": 78, + "top": 172 + } + }, + "inputs": { + "req": { + "accepts": "number" + }, + "lineIn": { + "accepts": "string" + }, + "load": { + "accepts": "path" + } + }, + "outputs": { + "lineOut": { + "emits": "string", + "calls": [ + { + "parentId": "Gcode Parser-8", + "key": "lineIn" + } + ] + } + }, + "state": {}, + "ui": { + "thruButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "previously": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "justNow": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "incoming": { + "type": "button", + "clientPath": "ui/multiline.js" + } + } + }, + "Gcode Parser-8": { + "description": { + "name": "Gcode Parser", + "alt": "line of gcode -> planner recognized move", + "id": "Gcode Parser-8", + "path": "./modules/parsing/gcode.js", + "position": { + "left": 649, + "top": 167 + } + }, + "inputs": { + "lineIn": { + "accepts": "string" + } + }, + "outputs": { + "instructionOut": { + "emits": "move instruction", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "instruction" + } + ] + }, + "modeChange": { + "emits": "string", + "calls": [] + } + }, + "state": { + "mode": "G0", + "G0": 1200, + "G1": 400 + }, + "ui": {} + }, + "Lookahead-Motion-Planner-9": { + "description": { + "name": "Lookahead-Motion-Planner", + "alt": "movements -> acceleration planned moves", + "id": "Lookahead-Motion-Planner-9", + "path": "./modules/motion/planner.js", + "position": { + "left": 1235, + "top": 299 + } + }, + "inputs": { + "instruction": { + "accepts": "move instruction" + }, + "acks": { + "accepts": "move acknowledgement" + }, + "run": { + "accepts": "boolean" + } + }, + "outputs": { + "moves": { + "emits": "move instruction", + "calls": [ + { + "parentId": "ATKStepper-1", + "key": "trapezoid" + }, + { + "parentId": "ATKStepper-2", + "key": "trapezoid" + }, + { + "parentId": "ATKStepper-4", + "key": "trapezoid" + }, + { + "parentId": "ATKStepper-5", + "key": "trapezoid" + } + ] + }, + "moveComplete": { + "emits": "number", + "calls": [ + { + "parentId": "Multi-line Text Input-7", + "key": "req" + } + ] + } + }, + "state": { + "axisIDs": "X,Y,Z", + "accel": 200, + "jd": 0.1, + "minSpeed": 1, + "position": [ + 0, + 0, + 0 + ], + "isRunning": 0, + "netWindow": 3, + "netState": [ + 0, + 0, + 0 + ] + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "startStopButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "number-output-10": { + "description": { + "name": "number-output", + "alt": "for clicking", + "id": "number-output-10", + "path": "./modules/ui/number.js", + "position": { + "left": 649, + "top": 626 + } + }, + "inputs": { + "thru": { + "accepts": "any" + }, + "evt": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "number", + "calls": [ + { + "parentId": "Multi-line Text Input-7", + "key": "req" + } + ] + } + }, + "state": { + "number": 10 + }, + "ui": { + "onNumberButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Button-11": { + "description": { + "name": "Button", + "alt": "for clicking", + "id": "Button-11", + "path": "./modules/ui/button.js", + "position": { + "left": 651, + "top": 473 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "whammy": { + "emits": "number", + "calls": [ + { + "parentId": "number-output-10", + "key": "evt" + }, + { + "parentId": "delay-12", + "key": "thru" + } + ] + } + }, + "state": {}, + "ui": { + "btn": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "delay-12": { + "description": { + "name": "delay", + "alt": "in ... out", + "id": "delay-12", + "path": "./modules/util/delay.js", + "position": { + "left": 647, + "top": 811 + } + }, + "inputs": { + "thru": { + "accepts": "any" + } + }, + "outputs": { + "out": { + "emits": "any", + "calls": [ + { + "parentId": "Lookahead-Motion-Planner-9", + "key": "run" + } + ] + } + }, + "state": { + "ms": 100 + }, + "ui": {} + } + } +} \ No newline at end of file diff --git a/programs/mmother-1.json b/programs/mmother-1.json new file mode 100644 index 0000000..2511ba2 --- /dev/null +++ b/programs/mmother-1.json @@ -0,0 +1,408 @@ +{ + "description": { + "name": "new program", + "counter": 7 + }, + "modules": { + "Gcode Parser-0": { + "description": { + "name": "Gcode Parser", + "alt": "line of gcode -> planner recognized move", + "id": "Gcode Parser-0", + "path": "./modules/parsing/gcode.js", + "position": { + "left": 676, + "top": 96 + } + }, + "inputs": { + "lineIn": { + "accepts": "string" + } + }, + "outputs": { + "instructionOut": { + "emits": "move instruction", + "calls": [] + }, + "modeChange": { + "emits": "string", + "calls": [] + } + }, + "state": { + "mode": "G0", + "G0": 1200, + "G1": 400 + }, + "ui": {} + }, + "Multi-line Text Input-1": { + "description": { + "name": "Multi-line Text Input", + "alt": "sequential txt input", + "id": "Multi-line Text Input-1", + "path": "./modules/ui/multiline.js", + "position": { + "left": 109, + "top": 93 + } + }, + "inputs": { + "req": { + "accepts": "number" + }, + "lineIn": { + "accepts": "string" + }, + "load": { + "accepts": "path" + } + }, + "outputs": { + "lineOut": { + "emits": "string", + "calls": [] + } + }, + "state": {}, + "ui": { + "thruButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "previously": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "justNow": { + "type": "button", + "clientPath": "ui/multiline.js" + }, + "incoming": { + "type": "button", + "clientPath": "ui/multiline.js" + } + } + }, + "Lookahead-Motion-Planner-2": { + "description": { + "name": "Lookahead-Motion-Planner", + "alt": "movements -> acceleration planned moves", + "id": "Lookahead-Motion-Planner-2", + "path": "./modules/motion/planner.js", + "position": { + "left": 1223, + "top": 94 + } + }, + "inputs": { + "instruction": { + "accepts": "move instruction" + }, + "acks": { + "accepts": "move acknowledgement" + }, + "run": { + "accepts": "boolean" + } + }, + "outputs": { + "moves": { + "emits": "move instruction", + "calls": [] + }, + "moveComplete": { + "emits": "number", + "calls": [] + } + }, + "state": { + "axisIDs": "X,Y,Z", + "accel": 200, + "jd": 0.1, + "minSpeed": 1, + "position": [ + 0, + 0, + 0 + ], + "isRunning": 0, + "netWindow": 3, + "netState": [ + 0, + 0, + 0 + ] + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "startStopButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-3": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-3", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1913, + "top": 93 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "Serialport-ATK-Link-4": { + "description": { + "isHardware": true, + "isLink": true, + "name": "Serialport ATK Link", + "alt": "window into hardware world", + "id": "Serialport ATK Link-4", + "path": "./modules/hardware/atkseriallink.js", + "position": { + "left": 2477, + "top": 383 + } + }, + "inputs": {}, + "outputs": {}, + "state": { + "portName": "---", + "portStatus": "closed" + }, + "ui": { + "kickButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-5": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-5", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1917, + "top": 505 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-6": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-6", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1916, + "top": 910 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + }, + "ATKStepper-7": { + "description": { + "name": "ATKStepper", + "alt": "software representation of stepper motor", + "isHardware": true, + "id": "ATKStepper-7", + "path": "./modules/hardware/atkstepper.js", + "position": { + "left": 1919, + "top": 1319 + } + }, + "inputs": { + "trapezoid": { + "accepts": "move instruction" + }, + "accel": { + "accepts": "number" + }, + "rmtrig": { + "accepts": "event" + } + }, + "outputs": { + "ack": { + "emits": "move acknowledgement", + "calls": [] + }, + "position": { + "emits": "number", + "calls": [] + } + }, + "state": { + "message": "click below to test network", + "route": "0,0", + "rate": 2000, + "axis": "X", + "spu": 200, + "rawMove": -10, + "lead": 0, + "position": 0 + }, + "ui": { + "resetButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "testButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + }, + "rawButton": { + "type": "button", + "clientPath": "ui/uiButton.js" + } + } + } + } +} \ No newline at end of file diff --git a/src/ui/multiline.js b/src/ui/multiline.js index bb17f87..98c2de9 100644 --- a/src/ui/multiline.js +++ b/src/ui/multiline.js @@ -5,12 +5,13 @@ function Multiline() { clientPath: 'ui/multiline.js', callback: null, // this is loaded into our scope on load contents: null, // current value of multiline obj - label: null + label: null, + rows: null } // hook to recv messages from the ui counterpart multiline.onMessage = function(msg) { - console.log('message into server side object', msg) + //console.log('message into server side object', msg) if(msg == 'onload'){ this.onload() } else { @@ -27,6 +28,15 @@ function Multiline() { this.sendToUi(msg) } + multiline.setRows = function(num){ + this.rows = num + var msg = { + call: 'setRows', + argument: num + } + this.sendToUi(msg) + } + // example of a function to use within the module multiline.setContents = function(string) { this.contents = string diff --git a/src/ui/uiButton.js b/src/ui/uiButton.js index 576a3d5..e85b937 100644 --- a/src/ui/uiButton.js +++ b/src/ui/uiButton.js @@ -9,7 +9,7 @@ function UIButton() { // hook to recv messages from the ui counterpart uiButton.onMessage = function(msg) { - console.log('message into server side object', msg) + //console.log('message into server side object', msg) if(msg == 'onload'){ this.onload() } else { -- GitLab