diff --git a/save/systems/dbg-l1.json b/save/systems/dbg-l1.json index 211a22733c3284b35464a9e0dcc2f131451e34ec..af8c6936ffb1913f2a13f0329d7e9206f60d3b59 100644 --- a/save/systems/dbg-l1.json +++ b/save/systems/dbg-l1.json @@ -267,6 +267,32 @@ "name": "motionSegment", "type": "MDmseg" } + ], + "outputs": [ + { + "name": "dmSegX", + "type": "Dmseg" + }, + { + "name": "dmSegY", + "type": "Dmseg" + }, + { + "name": "dmSegZ", + "type": "Dmseg" + } + ], + "states": [ + { + "name": "ticks/s", + "type": "uint32", + "value": "65535" + }, + { + "name": "steps/u", + "type": "uint32", + "value": "200" + } ] } ] diff --git a/typeset.js b/typeset.js index 0de90e6d42b8615cf8a872cd6181a0e929a014fd..d9f2b130b9813bd47ec00255f31b44a6c1490844 100644 --- a/typeset.js +++ b/typeset.js @@ -543,7 +543,6 @@ const TSET = [ let btarr = new Uint8Array(f32arr.buffer) let rtarr = Array.from(btarr) rtarr.unshift(this.key) - console.log('MDseg bytes', rtarr) return rtarr }, read: function(arr, start) { diff --git a/view/vptch.js b/view/vptch.js index 226dd463c52ba25f8ed242d4011406eaf0c98bf2..30225c9fbe730e254aa974e5ce2ed4cb8078bd0a 100644 --- a/view/vptch.js +++ b/view/vptch.js @@ -114,8 +114,8 @@ function PatchSet(View, MsgBox) { // what we want, let spec = patch.hunks[n] let existing = view.defs[n] - if(debug) console.log(`PATCH ${view.interpreterName}: hunkmerge, at ${n}`) - if(debug){ + if (debug) console.log(`PATCH ${view.interpreterName}: hunkmerge, at ${n}`) + if (debug) { console.log('view shows:', view.defs[n]) console.log('patch wants:', patch.hunks[n]) } @@ -128,22 +128,26 @@ function PatchSet(View, MsgBox) { } else { // check state, for (let st in existing.states) { - if (existing.states[st].value === spec.states[st].value) continue - // oh boy - //console.log(`${n} UPPER BOUND STATECHANGE CALL`) - try { - if(debug) console.log(`PATCH ${view.interpreterName}: req change for state: ${existing.states[st].name}`) - await view.requestStateChange(existing.states[st], spec.states[st].value) - } catch (err) { - reject(`error in requesting state change during patch merge ${err}`) + // check if each exists, tho + if (spec.states[st]) { + if (existing.states[st].value === spec.states[st].value) continue + } else { + // oh boy + //console.log(`${n} UPPER BOUND STATECHANGE CALL`) + try { + if (debug) console.log(`PATCH ${view.interpreterName}: req change for state: ${existing.states[st].name}`) + await view.requestStateChange(existing.states[st], spec.states[st].value) + } catch (err) { + reject(`error in requesting state change during patch merge ${err}`) + } + //console.log(`${n} LOWER BOUND STATECHANGE CALL`) } - //console.log(`${n} LOWER BOUND STATECHANGE CALL`) } } } else { // not existing, so just a straightforward add try { - if(debug) console.log(`PATCH ${view.interpreterName}: req add new hunk of type ${spec.type} and name ${spec.name}`) + if (debug) console.log(`PATCH ${view.interpreterName}: req add new hunk of type ${spec.type} and name ${spec.name}`) await view.requestAddHunk(spec.type, spec.name, spec.states).then((def) => { loadedDefsList.push(def) })