diff --git a/README.md b/README.md
index c04f2ada8dc96af1fa665fe4bc8f1d53cdc0f625..87564ea3120ea8c5bef93a3e66aab8ce458584fe 100644
--- a/README.md
+++ b/README.md
@@ -244,6 +244,10 @@ Logging, the right-hand-side thing is also not worth your time, and an obvious c
change title of index.html ...
+## Making this Useable
+
+To dev... should be able to reload a hunk. Delete, undo es6 impement, call again, load in old links if possible.
+
## Program 'Recipes'
Notes below about loading and saving patches walk into this note.
diff --git a/bootstrap.js b/bootstrap.js
index c779d534ddcd6905716980966c3df0fb23b6adda..8f974dd1147ca647a70820b8c33d521d4a840b44 100644
--- a/bootstrap.js
+++ b/bootstrap.js
@@ -43,7 +43,7 @@ function bootloop() {
window.onload = () => {
console.log('BOOTUP')
- NROL.addHunk('view', null, 'tlview').then((vw) => {
+ NROL.addHunk('view', 'tlview').then((vw) => {
// console.log('ADDHUNK VIEW RESOLVES')
// gotta git this
view = vw
diff --git a/hunks/image/readpng.js b/hunks/image/readpng.js
index b15ab50c5962dacc505f1d9fb061ec99605d46af..29d3071e4c0f7e87e1c470ce63936b89064348c3 100644
--- a/hunks/image/readpng.js
+++ b/hunks/image/readpng.js
@@ -39,11 +39,14 @@ function ReadPNG() {
// as is tradition,
this.dom = {}
+ let button
+
this.init = () => {
// manager calls this once
// it is loaded and state is updated (from program)
console.log('HELLO Read PNG')
this.dom = document.createElement('div')
+ //
}
this.onload = () => {
diff --git a/hunks/link.js b/hunks/link.js
index 88afe05111e332270d2915994b4641fa7335c94a..883e5fd33ee5787771e4bab68e439750b2ef5224 100644
--- a/hunks/link.js
+++ b/hunks/link.js
@@ -242,11 +242,6 @@ function Link() {
// serialize messages:
let sermsg = (port, data, type) => {
if (typeof port !== 'number' || port > 254) throw new Error('port is no good at serialize')
- // type via this handy object:
- let phy = TSET.find((item) => {
- return item.name === type
- })
- if (phy === undefined) throw new Error(`type not found at serialization: ${type}`)
// we r ready,
let msg = [port]
MSGS.writeTo(msg, data, type)
diff --git a/hunks/manager.js b/hunks/manager.js
index 6fe8c8ab3a77b203ba47d5d89eab555f82a0534b..9378d676a58e3f76571803aa87f006500d0bfa23 100644
--- a/hunks/manager.js
+++ b/hunks/manager.js
@@ -158,7 +158,7 @@ function Manager() {
// type, (opt) name, (opt) state
// work backwards
- this.addHunk = (hunkType, states, name) => {
+ this.addHunk = (hunkType, name, states) => {
// hunks are named by path in js
let path = './hunks/' + hunkType + '.js'
if (verbose) console.log('ok, loading hunk from path', path)
@@ -541,30 +541,32 @@ function Manager() {
// pull the rest out,
// unknown-len types return with return.item and return.increment
inc++
- let strname = MSGS.readFrom(msg, inc, 'string')
- inc += strname.increment
- strname = strname.item
+ let strtype = MSGS.readFrom(msg, inc, 'string')
+ inc += strtype.increment
+ strtype = strtype.item
+ // also might exist,
+ let hnknm
+ if (inc < msg.length && msg[inc] === HK.NAME) {
+ inc ++
+ hnknm = MSGS.readFrom(msg, inc, 'string')
+ inc += hnknm.increment;
+ hnknm = hnknm.item;
+ }
// might exist,
let state
if (inc < msg.length) {
state = stateSetFromSerial(msg, inc)
inc += state.increment
state = state.item
- console.log('MGR to add', strname, 'with state included:', state)
+ console.log('MGR to add', strtype, 'with state included:', state)
} else {
- console.log('MGR to add', strname)
- }
- // also might exist,
- let hnknm
- if (inc < msg.length && msg[inc] === HK.NAME) {
- inc ++
- hnknm = MSGS.readFrom(msg, inc, 'string').item
+ console.log('MGR to add', strtype)
}
// a meta comment is that this add promise doesn't fail for
// things like path-loading errors, that would be inside of gogetter.js
// i.e. pulling a hunk loads it into that import script hack, that just
// gets evaluated into the dom ...
- this.addHunk(strname, state, hnknm).then((hunk) => {
+ this.addHunk(strtype, hnknm, state).then((hunk) => {
console.log('successfully added hunk', hunk.name)
// serialize
resp.push(MK.HUNKALIVE)
diff --git a/hunks/view.js b/hunks/view.js
index 3108ca3bc543ff52d03005bb4d0ebbb44bb7584f..6e1373a489fc64362c0067aaf4b916cb1f737c4e 100644
--- a/hunks/view.js
+++ b/hunks/view.js
@@ -118,6 +118,7 @@ function View() {
})
// to log, type, etc
msgbox.init()
+ msgbox.toggleHidden()
// append
$(this.dom).append(this.plane)
// more space
@@ -345,14 +346,14 @@ function View() {
}
})
- // key listeners (are global, bc ...)
+ // key listeners (are global, bc ...) KEYCODES
document.addEventListener('keydown', (evt) => {
- if (evt.key === 'k') {
+ if (evt.key === 'k' && evt.ctrlKey) {
this.kick()
//writeMessage('addhunk', 'link')
- } else if (evt.key === 'z') {
+ } else if (evt.key === 'z' && evt.ctrlKey) {
zoomExtents()
- } else if (evt.key === 'd') {
+ } else if (evt.key === 'd' && evt.ctrlKey) {
// your debug land,
this.restoreEntireSystem('pdevone').then(()=>{
this.defs[2].floaters[0].fixTo(400, 300)
@@ -362,9 +363,9 @@ function View() {
this.refreshAnyFreshViews()
})
//writeMessage('addprogram', 'ntlink')
- } else if (evt.key === 'h') {
+ } else if (evt.key === 'h' && evt.ctrlKey) {
console.warn("pls write h to hide msgboxes")
- } else if (evt.key === 'v') {
+ } else if (evt.key === 'v' && evt.ctrlKey) {
//writeMessage('addprogram', 'llink')
} else if (evt.keyCode === 27) {
// escapekey
@@ -1364,7 +1365,7 @@ function View() {
}
// ask to add one,
- this.requestAddHunk = (type, states, name) => {
+ this.requestAddHunk = (type, name, states) => {
//console.log('type, states, name', type, states, name)
return new Promise((resolve, reject) => {
let msg = [MK.REQADDHUNK]
@@ -1375,6 +1376,11 @@ function View() {
// these will not always be used, but this is an
// exercise in consistency at the moment
// in an array
+ // if its named,
+ if (name) {
+ msg.push(HK.NAME)
+ MSGS.writeTo(msg, name, 'string')
+ }
if (states) {
for (let st of states) {
msg.push(HK.STATE)
@@ -1383,11 +1389,6 @@ function View() {
MSGS.writeTo(msg, st.value, st.type)
}
}
- // if its named,
- if (name) {
- msg.push(HK.NAME)
- MSGS.writeTo(msg, name, 'string')
- }
promiseThis(msg, (def) => {
resolve(def)
}, (errmsg) => {
@@ -1738,6 +1739,7 @@ function View() {
case MK.LINKALIVE:
if (msgverbose) console.log('VIEW MSG is a link to put')
let nlnk = {}
+ //console.log("LINK MSG IS", msg)
nlnk.outInd = MSGS.readFrom(msg, inc + 1, 'uint16').item
nlnk.outputInd = MSGS.readFrom(msg, inc + 4, 'uint8').item
nlnk.inInd = MSGS.readFrom(msg, inc + 6, 'uint16').item
diff --git a/save/systems/pdevthree.json b/save/systems/pdevthree.json
new file mode 100644
index 0000000000000000000000000000000000000000..c792a6c2b9805dfe3a1a5fadcc4c601bc0f149c0
--- /dev/null
+++ b/save/systems/pdevthree.json
@@ -0,0 +1,540 @@
+{
+ "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": "link",
+ "name": "link_2",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray"
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray"
+ },
+ {
+ "name": "numIn",
+ "type": "uint32"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 4,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 5,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "numout",
+ "type": "uint32",
+ "connections": [
+ {
+ "inHunkIndex": 7,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "isActive",
+ "type": "boolean",
+ "value": true
+ },
+ {
+ "name": "otherLink",
+ "type": "uint16",
+ "value": 1
+ },
+ {
+ "name": "inputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray), numIn (uint32)"
+ },
+ {
+ "name": "outputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray), numout (uint32)"
+ }
+ ],
+ "contains": {
+ "interpreterName": "nautilus",
+ "interpreterVersion": "v0.1",
+ "hunks": [
+ {
+ "type": "manager",
+ "name": "nautilus",
+ "inputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 1
+ }
+ ]
+ }
+ ],
+ "states": []
+ },
+ {
+ "type": "link",
+ "name": "link_1",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray"
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray"
+ },
+ {
+ "name": "numTop",
+ "type": "uint32"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 0,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 1
+ }
+ ]
+ },
+ {
+ "name": "numnum",
+ "type": "uint32",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 2
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "isActive",
+ "type": "boolean",
+ "value": true
+ },
+ {
+ "name": "otherLink",
+ "type": "uint16",
+ "value": 2
+ },
+ {
+ "name": "inputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray), numTop (uint32)"
+ },
+ {
+ "name": "outputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray), numnum (uint32)"
+ }
+ ]
+ },
+ {
+ "type": "comm/websocketserver",
+ "name": "comm/websocketserver_2",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "status",
+ "type": "string",
+ "value": "connected"
+ },
+ {
+ "name": "port",
+ "type": "number",
+ "value": 2042
+ }
+ ]
+ },
+ {
+ "type": "link",
+ "name": "link_3",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray"
+ },
+ {
+ "name": "numThru",
+ "type": "uint32"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 4,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 2
+ }
+ ]
+ },
+ {
+ "name": "numOut",
+ "type": "uint32",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 3
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "isActive",
+ "type": "boolean",
+ "value": false
+ },
+ {
+ "name": "otherLink",
+ "type": "uint16",
+ "value": 0
+ },
+ {
+ "name": "inputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), numThru (uint32)"
+ },
+ {
+ "name": "outputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), numOut (uint32)"
+ }
+ ]
+ },
+ {
+ "type": "comm/cobserial",
+ "name": "comm/cobserial_4",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "status",
+ "type": "string",
+ "value": "closed"
+ },
+ {
+ "name": "pid",
+ "type": "string",
+ "value": "8022"
+ },
+ {
+ "name": "refresh",
+ "type": "boolean",
+ "value": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "type": "comm/websocketclient",
+ "name": "comm/websocketclient_3",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "status",
+ "type": "string",
+ "value": "open"
+ },
+ {
+ "name": "retrycount",
+ "type": "number",
+ "value": 3
+ },
+ {
+ "name": "retryreset",
+ "type": "boolean",
+ "value": false
+ },
+ {
+ "name": "address",
+ "type": "string",
+ "value": "127.0.0.1"
+ },
+ {
+ "name": "port",
+ "type": "number",
+ "value": 2042
+ }
+ ]
+ },
+ {
+ "type": "view",
+ "name": "view_4",
+ "inputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 1
+ }
+ ]
+ }
+ ],
+ "states": []
+ },
+ {
+ "type": "view",
+ "name": "view_5",
+ "inputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 2
+ }
+ ]
+ }
+ ],
+ "states": []
+ },
+ {
+ "type": "interface/number",
+ "name": "interface/number_6",
+ "inputs": [],
+ "outputs": [
+ {
+ "name": "num",
+ "type": "number",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 3
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "numrep",
+ "type": "number",
+ "value": 275074
+ }
+ ]
+ },
+ {
+ "type": "interface/logger",
+ "name": "interface/logger_7",
+ "inputs": [
+ {
+ "name": "tolog",
+ "type": "any"
+ }
+ ],
+ "outputs": [],
+ "states": [
+ {
+ "name": "prefix",
+ "type": "string",
+ "value": "LOG:"
+ },
+ {
+ "name": "console",
+ "type": "boolean",
+ "value": true
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/save/systems/pdevtwo.json b/save/systems/pdevtwo.json
new file mode 100644
index 0000000000000000000000000000000000000000..eaea93b718dedacc8d7e0015268f049fd13929f3
--- /dev/null
+++ b/save/systems/pdevtwo.json
@@ -0,0 +1,467 @@
+{
+ "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": "link",
+ "name": "link_2",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray"
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray"
+ },
+ {
+ "name": "numIn",
+ "type": "uint32"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 4,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 5,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "numout",
+ "type": "uint32"
+ }
+ ],
+ "states": [
+ {
+ "name": "isActive",
+ "type": "boolean",
+ "value": true
+ },
+ {
+ "name": "otherLink",
+ "type": "uint16",
+ "value": 1
+ },
+ {
+ "name": "inputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray), numIn (uint32)"
+ },
+ {
+ "name": "outputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray), numout (uint32)"
+ }
+ ],
+ "contains": {
+ "interpreterName": "nautilus",
+ "interpreterVersion": "v0.1",
+ "hunks": [
+ {
+ "type": "manager",
+ "name": "nautilus",
+ "inputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 1
+ }
+ ]
+ }
+ ],
+ "states": []
+ },
+ {
+ "type": "link",
+ "name": "link_1",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray"
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 0,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "ldive_0",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 1
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "isActive",
+ "type": "boolean",
+ "value": true
+ },
+ {
+ "name": "otherLink",
+ "type": "uint16",
+ "value": 2
+ },
+ {
+ "name": "inputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray)"
+ },
+ {
+ "name": "outputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), ldive_0 (byteArray)"
+ }
+ ]
+ },
+ {
+ "type": "comm/websocketserver",
+ "name": "comm/websocketserver_2",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "status",
+ "type": "string",
+ "value": "connected"
+ },
+ {
+ "name": "port",
+ "type": "number",
+ "value": 2042
+ }
+ ]
+ },
+ {
+ "type": "link",
+ "name": "link_3",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray"
+ },
+ {
+ "name": "numThru",
+ "type": "uint32"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 4,
+ "inHunkInput": 0
+ }
+ ]
+ },
+ {
+ "name": "mgrMsgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 1,
+ "inHunkInput": 2
+ }
+ ]
+ },
+ {
+ "name": "numOut",
+ "type": "uint32"
+ }
+ ],
+ "states": [
+ {
+ "name": "isActive",
+ "type": "boolean",
+ "value": false
+ },
+ {
+ "name": "otherLink",
+ "type": "uint16",
+ "value": 0
+ },
+ {
+ "name": "inputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), numThru (uint32)"
+ },
+ {
+ "name": "outputList",
+ "type": "string",
+ "value": "mgrMsgs (byteArray), numOut (uint32)"
+ }
+ ]
+ },
+ {
+ "type": "comm/cobserial",
+ "name": "comm/cobserial_4",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 3,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "status",
+ "type": "string",
+ "value": "closed"
+ },
+ {
+ "name": "pid",
+ "type": "string",
+ "value": "8022"
+ },
+ {
+ "name": "refresh",
+ "type": "boolean",
+ "value": false
+ }
+ ]
+ }
+ ]
+ }
+ },
+ {
+ "type": "comm/websocketclient",
+ "name": "comm/websocketclient_3",
+ "inputs": [
+ {
+ "name": "data",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "data",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 0
+ }
+ ]
+ }
+ ],
+ "states": [
+ {
+ "name": "status",
+ "type": "string",
+ "value": "open"
+ },
+ {
+ "name": "retrycount",
+ "type": "number",
+ "value": 3
+ },
+ {
+ "name": "retryreset",
+ "type": "boolean",
+ "value": false
+ },
+ {
+ "name": "address",
+ "type": "string",
+ "value": "127.0.0.1"
+ },
+ {
+ "name": "port",
+ "type": "number",
+ "value": 2042
+ }
+ ]
+ },
+ {
+ "type": "view",
+ "name": "view_4",
+ "inputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 1
+ }
+ ]
+ }
+ ],
+ "states": []
+ },
+ {
+ "type": "view",
+ "name": "view_5",
+ "inputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray"
+ }
+ ],
+ "outputs": [
+ {
+ "name": "msgs",
+ "type": "byteArray",
+ "connections": [
+ {
+ "inHunkIndex": 2,
+ "inHunkInput": 2
+ }
+ ]
+ }
+ ],
+ "states": []
+ }
+ ]
+}
\ No newline at end of file
diff --git a/view/vmsg.js b/view/vmsg.js
index 919bfd477ad7993b9c6fc490649d9424d9e772de..e8dbba0811b2e9a87eded548d7736b900f7944d5 100644
--- a/view/vmsg.js
+++ b/view/vmsg.js
@@ -69,9 +69,18 @@ function MessageBox(View) {
view.refresh()
}).get(0))
// and then
+ this.isHidden = false
$(view.dom).append(this.msgbox)
}
+ this.toggleHidden = () => {
+ if(this.isHidden){
+ $(this.msgbox).show()
+ } else {
+ $(this.msgbox).hide()
+ }
+ }
+
let tpad = 10
this.setTopMargin = (num) => {
diff --git a/view/vptch.js b/view/vptch.js
index 6ab43e220afbc5c5f7500d49e114b681c183ea78..80e662f4cc16ff350d98a111b6ef1d17e8197a5d 100644
--- a/view/vptch.js
+++ b/view/vptch.js
@@ -137,7 +137,7 @@ function PatchSet(View, MsgBox) {
} else {
// not existing, so just a straightforward add
try {
- await view.requestAddHunk(spec.type, spec.states, spec.name).then((def) => {
+ await view.requestAddHunk(spec.type, spec.name, spec.states).then((def) => {
loadedDefsList.push(def)
})
} catch (err) {