Commit a17dd15b authored by Jake Read's avatar Jake Read

state loads

parent 7a5a83c0
......@@ -123,4 +123,8 @@ li:active{
width: 80px;
padding: 3px;
background-color: #303030;
}
#nav {
font-size: 15px;
}
\ No newline at end of file
......@@ -32,8 +32,8 @@ function Delay() {
}
function onMsChange(){
// a test fn
console.log("noting state change", state.ms)
state.ms = 1200
}
function onDelayBegin(input){
......
......@@ -200,10 +200,10 @@ function openProgram(path) {
// restoring state
for (key in mdlRep.state) {
if (isStateKey(key)) {
console.log("STATE - NEEDS WORK", key)
// want to do this without asserting the change though
// actually, if new paradigm, we don't call .onChange
// rename .onChange for 'onUiChange' or something
// I think this is OK?
// would prefer to do this before we write getters and setters
// for now we walk-around to secret key ...
mdl.state['_' + key] = mdlRep.state[key]
}
}
......
{
"description": {
"name": "tstprgmem",
"counter": 3
},
"modules": {
"gate-1": {
"description": {
"id": "gate-1",
"name": "gate",
"alt": "in ... out",
"path": "./modules/util/gate.js",
"position": {
"left": 10,
"top": 30
}
},
"inputs": {
"thru": {
"accepts": "any"
}
},
"outputs": {
"out": {
"emits": "any",
"calls": [
{
"parentId": "delay-2",
"key": "thru"
}
]
}
},
"state": {
"toggle": {
"type": "button",
"isPressed": false,
"label": "Open / Close"
},
"message": "closed"
}
},
"delay-2": {
"description": {
"id": "delay-2",
"name": "delay",
"alt": "in ... out",
"path": "./modules/util/delay.js",
"position": {
"left": 132,
"top": 225
}
},
"inputs": {
"thru": {
"accepts": "any"
}
},
"outputs": {
"out": {
"emits": "any",
"calls": [
{
"parentId": "logger-3",
"key": "thru"
}
]
}
},
"state": {
"ms": 1200
}
},
"logger-3": {
"description": {
"id": "logger-3",
"name": "logger",
"alt": "in ... out to console",
"path": "./modules/util/log.js",
"position": {
"left": 123,
"top": 367
}
},
"inputs": {
"thru": {
"accepts": "any"
}
},
"outputs": {
"throughput": {
"emits": "any",
"calls": []
}
},
"state": {
"prefix": "LOGGER:",
"message": "---"
}
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment