diff --git a/gogetter.js b/gogetter.js index c1af8c96237d43750c4a6cd06b8d966ac6b7155a..6a315d5bb8e91cb317740fb0d41137f5547c570f 100644 --- a/gogetter.js +++ b/gogetter.js @@ -68,14 +68,16 @@ function GoGetter() { // now, writing menu options for each path // sort alphabetically // hacking this to death bc tbd replaced by server side req not string parsing - for(let i in returned){ - returned[i] = returned[i].slice(1) - } - for(let i in returned){ - if(returned[i] === "hunks") returned.splice(i, 1) - } - for(let i in returned){ - if(returned[i] === "manager") returned.splice(i, 1) + if(extension == '.js'){ + for(let i in returned){ + returned[i] = returned[i].slice(1) + } + for(let i in returned){ + if(returned[i] === "hunks") returned.splice(i, 1) + } + for(let i in returned){ + if(returned[i] === "manager") returned.splice(i, 1) + } } returned.sort() if(debug) console.log('GG returns this', JSON.parse(JSON.stringify(returned))) diff --git a/hunks/flowcontrol/gate.js b/hunks/flowcontrol/gate.js index d68be6f243331454a057b125a477fa489f90db0d..bf30204fd972881846cadeb769660ecbbb207ad5 100644 --- a/hunks/flowcontrol/gate.js +++ b/hunks/flowcontrol/gate.js @@ -25,6 +25,10 @@ function Gate(){ let runState = new State('boolean', 'run', false) this.states.push(runState) + this.init = () => { + console.log('hello gate') + } + this.loop = () => { if(runStateIn.io()){ runState.set(runStateIn.get()) diff --git a/save/contexts/cuttlefish/arrow-plotter.json b/save/contexts/cuttlefish/arrow-plotter.json new file mode 100644 index 0000000000000000000000000000000000000000..241ab37eb5dae25cf33979a7da1d2dd3f43b72ee --- /dev/null +++ b/save/contexts/cuttlefish/arrow-plotter.json @@ -0,0 +1,396 @@ +{ + "interpreterName": "cuttlefish", + "interpreterVersion": "v0.1", + "hunks": [ + { + "type": "manager", + "name": "nrol", + "inputs": [ + { + "name": "msgs", + "type": "byteArray" + } + ], + "outputs": [ + { + "name": "msgs", + "type": "byteArray", + "connections": [ + { + "inHunkIndex": 1, + "inHunkInput": 0 + } + ] + } + ], + "states": [] + }, + { + "type": "view", + "name": "tlview", + "inputs": [ + { + "name": "msgs", + "type": "byteArray" + } + ], + "outputs": [ + { + "name": "msgs", + "type": "byteArray", + "connections": [ + { + "inHunkIndex": 0, + "inHunkInput": 0 + } + ] + } + ], + "states": [] + }, + { + "type": "flowcontrol/gate", + "name": "flowcontrol/gate_2", + "inputs": [ + { + "name": "thru", + "type": "boolean" + }, + { + "name": "gate", + "type": "boolean" + } + ], + "outputs": [ + { + "name": "thru", + "type": "boolean", + "connections": [ + { + "inHunkIndex": 5, + "inHunkInput": 0 + } + ] + } + ], + "states": [ + { + "name": "run", + "type": "boolean", + "value": false + } + ] + }, + { + "type": "flowcontrol/pressure", + "name": "flowcontrol/pressure_3", + "inputs": [ + { + "name": "thru", + "type": "boolean" + }, + { + "name": "run", + "type": "boolean" + } + ], + "outputs": [ + { + "name": "thru", + "type": "boolean", + "connections": [ + { + "inHunkIndex": 2, + "inHunkInput": 0 + } + ] + } + ], + "states": [ + { + "name": "run", + "type": "boolean", + "value": true + } + ] + }, + { + "type": "interface/arrowpad", + "name": "interface/arrowpad_4", + "inputs": [], + "outputs": [ + { + "name": "left", + "type": "boolean", + "connections": [ + { + "inHunkIndex": 3, + "inHunkInput": 0 + }, + { + "inHunkIndex": 2, + "inHunkInput": 1 + } + ] + }, + { + "name": "right", + "type": "boolean", + "connections": [ + { + "inHunkIndex": 6, + "inHunkInput": 1 + }, + { + "inHunkIndex": 7, + "inHunkInput": 0 + } + ] + }, + { + "name": "up", + "type": "boolean" + }, + { + "name": "down", + "type": "boolean" + }, + { + "name": "pgup", + "type": "boolean" + }, + { + "name": "pgdown", + "type": "boolean" + } + ], + "states": [] + }, + { + "type": "primitive/counter", + "name": "primitive/counter_6", + "inputs": [ + { + "name": "increment", + "type": "any" + }, + { + "name": "decrement", + "type": "any" + }, + { + "name": "reset", + "type": "boolean" + } + ], + "outputs": [ + { + "name": "count", + "type": "number", + "connections": [ + { + "inHunkIndex": 8, + "inHunkInput": 0 + }, + { + "inHunkIndex": 10, + "inHunkInput": 0 + }, + { + "inHunkIndex": 11, + "inHunkInput": 2 + } + ] + } + ], + "states": [ + { + "name": "reset", + "type": "boolean", + "value": false + } + ] + }, + { + "type": "flowcontrol/gate", + "name": "flowcontrol/gate_7", + "inputs": [ + { + "name": "thru", + "type": "boolean" + }, + { + "name": "gate", + "type": "boolean" + } + ], + "outputs": [ + { + "name": "thru", + "type": "boolean", + "connections": [ + { + "inHunkIndex": 5, + "inHunkInput": 1 + } + ] + } + ], + "states": [ + { + "name": "run", + "type": "boolean", + "value": false + } + ] + }, + { + "type": "flowcontrol/pressure", + "name": "flowcontrol/pressure_8", + "inputs": [ + { + "name": "thru", + "type": "boolean" + }, + { + "name": "run", + "type": "boolean" + } + ], + "outputs": [ + { + "name": "thru", + "type": "boolean", + "connections": [ + { + "inHunkIndex": 6, + "inHunkInput": 0 + } + ] + } + ], + "states": [ + { + "name": "run", + "type": "boolean", + "value": true + } + ] + }, + { + "type": "data/logger", + "name": "data/logger_9", + "inputs": [ + { + "name": "tolog", + "type": "any" + } + ], + "outputs": [], + "states": [ + { + "name": "prefix", + "type": "string", + "value": "LOG:" + }, + { + "name": "console", + "type": "boolean", + "value": false + } + ] + }, + { + "type": "data/linechart", + "name": "data/linechart_9", + "inputs": [ + { + "name": "array", + "type": "reference" + } + ], + "outputs": [], + "states": [ + { + "name": "displayCount", + "type": "number", + "value": 50 + } + ] + }, + { + "type": "primitive/counter", + "name": "primitive/counter_10", + "inputs": [ + { + "name": "increment", + "type": "any" + }, + { + "name": "decrement", + "type": "any" + }, + { + "name": "reset", + "type": "boolean" + } + ], + "outputs": [ + { + "name": "count", + "type": "number", + "connections": [ + { + "inHunkIndex": 11, + "inHunkInput": 1 + } + ] + } + ], + "states": [ + { + "name": "reset", + "type": "boolean", + "value": false + } + ] + }, + { + "type": "data/accumulator", + "name": "data/accumulator_11", + "inputs": [ + { + "name": "reset", + "type": "boolean" + }, + { + "name": "x", + "type": "number" + }, + { + "name": "y", + "type": "number" + } + ], + "outputs": [ + { + "name": "accumulated", + "type": "reference", + "connections": [ + { + "inHunkIndex": 9, + "inHunkInput": 0 + } + ] + } + ], + "states": [ + { + "name": "reset", + "type": "boolean", + "value": false + } + ] + } + ] +} \ No newline at end of file