diff --git a/README.md b/README.md index a8936dd706667bee7ce97c74077e3b8cf72f5422..ec5449d6fdc08d534219ca69b7624aa9f34cf287 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ # Automatakit API -## what it do - -- state variables good, -- should only change in UI on server ack (so need to write our own ui classes) - - doesn't even change on ack at the moment - - let's get to the pnt when we can see a g0 come thru the mode state - -- for attaching inputs / outsput to / from with ui and loading etc / have to hold onto inputs / outputs and connections differently? i.e. can send from ui -> server to conn. id to id. but can't read out of server rep. which ids con. to which ids +## oy + +- state variables good +- final steps before writing gcode consumption program + - clear obj | rep | memory | ui structure + - event connections at top level ? so that can pass to ui + - ui svg's for links, how to draw, when to draw ? ## remember diff --git a/client/divtools.js b/client/divtools.js index de2dedde25d14ac0cebebca057c94e7ab3f86c8a..8593b3a8230313d16a6dd13f97b87ffd152f1167 100644 --- a/client/divtools.js +++ b/client/divtools.js @@ -1,9 +1,8 @@ function writeStateRep(container, rep, key){ var variable = rep.state[key] if(typeof variable == 'string'){ - console.log('STR') - var div = document.createElement('div') - div.appendChild(document.createTextNode(key)) + var li = document.createElement('li') + li.appendChild(document.createTextNode(key)) var input = document.createElement('input') input.type = 'text' input.size = 24 @@ -12,11 +11,24 @@ function writeStateRep(container, rep, key){ rep.state[key] = input.value putState(rep) }) - div.appendChild(input) - container.appendChild(div) + li.appendChild(input) + container.appendChild(li) return input } else if (typeof variable == 'number'){ console.log('NUM') + var li = document.createElement('li') + li.appendChild(document.createTextNode(key)) + var input = document.createElement('input') + input.type = 'text' + input.size = 24 + input.value = variable.toString() + input.addEventListener('change', function(){ + rep.state[key] = parseFloat(input.value) + putState(rep) + }) + li.appendChild(input) + container.appendChild(li) + return input } else { console.log("unui'd type:", typeof variable) } diff --git a/client/style.css b/client/style.css index 35074a918d9c38459207afed9936d2d68822cb13..b919c3f9f8198df3dbb7cad339f94a0a993e1486 100644 --- a/client/style.css +++ b/client/style.css @@ -31,6 +31,17 @@ body { .state { padding: 0 83px 0 83px; + color: #eee; +} + +.state input { + background-color: #1a1a1a; + color: #fcd17b; + font-size: 12px; + width: 75%; + float: right; + border: 1px solid black; + border-radius: 2px; } .dg.a {