From 92934cb76df8ab6338533ae959163cfb778843bb Mon Sep 17 00:00:00 2001
From: Jake Read <jake.read@cba.mit.edu>
Date: Fri, 31 Aug 2018 21:25:59 -0400
Subject: [PATCH] about to rid of dat gui

---
 README.md          |  17 +++++++++++++++++
 client/client.js   |  12 +++++++++---
 client/favicon.ico | Bin 0 -> 318 bytes
 client/style.css   |   6 +++---
 server.js          |  13 ++++++++++++-
 5 files changed, 41 insertions(+), 7 deletions(-)
 create mode 100644 client/favicon.ico

diff --git a/README.md b/README.md
index 363e5fb..9af1d70 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,13 @@ javascript system for jake for building robot applications,
 .. rn: do terminal HTML? 
 .. then: consider model for node.js server, model-view-controller or w/e ?
 
+## remember
+
+you have friends
+ - bro
+ - sean
+ - nathan 
+
 ## links to things 
 
 http://designmodo.github.io/Flat-UI/
@@ -39,3 +46,13 @@ To wrap, we write a representation in api-type rep, with one connection. We outp
 
 For extra points, we read in the connection also with an SVG layer - iterating through connections of the represented program.
 
+# The RPI
+
+ - sudo apt-get update
+ - sudo apt-get upgrade
+ - install nvm
+  -  
+ - install git 
+
+- https://cnc.js.org/ 
+- https://github.com/cncjs/cncjs/wiki/Setup-Guide:-Raspberry-Pi-%7C-Install-Node.js-via-Node-Version-Manager-(NVM) 
\ No newline at end of file
diff --git a/client/client.js b/client/client.js
index c662cec..42ad1ab 100644
--- a/client/client.js
+++ b/client/client.js
@@ -118,6 +118,11 @@ function addRep(rep) {
     domElem.style.left = lastPos.X + 'px'
     domElem.style.top = lastPos.Y + 'px'
 
+    if(rep.ui != null){
+        domElem.style.left = rep.ui.left +'px'
+        domElem.style.top = rep.ui.top + 'px'
+    }
+
     // more html: the title
     var title = document.createElement('div')
     title.className = 'modname'
@@ -125,11 +130,13 @@ function addRep(rep) {
     title.alt = rep.description.alt
     domElem.appendChild(title)
 
+    // if having UI element, place them 
+
     // we'll hold on to this, useful!
     rep.ui = {}
     rep.ui.domElem = domElem
 
-    // using datgui to write the interface for state
+    // WRITE UI ELEMENTS 
     var datElem = document.createElement('div')
     datElem.className = 'inside'
     var datui = new dat.GUI({ autoplace: false })
@@ -161,8 +168,7 @@ function addRep(rep) {
     // add this as well to the representation obj
     rep.ui.dat = datui
 
-    // add the inputs and outputs 
-    // get more involved here, do ln 241
+    // WRITE INPUTS AND OUTPUTS 
     var inElem = document.createElement('div')
     inElem.className = 'inputs'
     rep.ui.inputs = {}
diff --git a/client/favicon.ico b/client/favicon.ico
new file mode 100644
index 0000000000000000000000000000000000000000..9f5f5395265a82ec5a3de1daada8b80e62bcfbce
GIT binary patch
literal 318
zcmZQzU}Ruq5D*YxU}Run&|qX>5My9q&|qL-5MW?nP+$PbvoL@_1BifPkQ|iB@V^Dd
zqKp<46a*WKjb;=SWB`dX3W9+E5)Bhar$Gv_szY|=|NjgO{~1wnGa~~-0~CYUFpMGw
J()XW%0RV8d76t$S

literal 0
HcmV?d00001

diff --git a/client/style.css b/client/style.css
index e134317..782e38e 100644
--- a/client/style.css
+++ b/client/style.css
@@ -21,7 +21,7 @@ body {
 }
 
 .inputs {
-	width: 58px;
+	width: 78px;
 	float: left;
 	margin-left: 2px;
 	font-size: 11px;
@@ -30,7 +30,7 @@ body {
 }
 
 .inside {
-	padding: 0 63px 0 63px;
+	padding: 0 83px 0 83px;
 }
 
 .dg.a {
@@ -38,7 +38,7 @@ body {
 }
 
 .outputs {
-	width: 58px;
+	width: 78px;
 	float: right;
 	margin-right: 2px;
 	text-align: right;
diff --git a/server.js b/server.js
index 42cc0bf..05a47d0 100644
--- a/server.js
+++ b/server.js
@@ -112,6 +112,17 @@ var gcode = addModule('./src/parsing/gcode.js')
 
 term.outputs.lineOut.attach(gcode.inputs.lineIn)
 
+// to add UI vars to prgmem / save them
+// typically, set in ui, saved in ui
+
+term.ui = {}
+term.ui.left = 10
+term.ui.top = 10
+
+gcode.ui = {}
+gcode.ui.left = 200
+gcode.ui.top = 200
+
 console.log('modules at prgmem start', modules)
 
 /*
@@ -136,7 +147,7 @@ function addModule(path) {
         // get and set skullduggery 
         for (item in mod.state) {
             // turn into 'don't f with' property
-            mod.state['_' + item] = 'item'
+            mod.state['_' + item] = mod.state[item]
             // make oj ptr into object
             mod.state[item] = {}
             // write getter and setter for object
-- 
GitLab