diff --git a/README.md b/README.md index 857af22367ca5c7cc4c0a47fb653e83ef8dbf822..a9ccb0ad30b47018929ced872cf5f5580bda2153 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,16 @@ There's some UI leftovers in the view. - want to kick around on spreading things out properly using force layout - can't add links, did this actually work before ? drag correct zoom factor, and cancel other moves -- towards using state-load-at-program-load to set retrycount to 0 +- ok , the two bigbois right now are + - the link is a hot mess, unwritten, you have to do this to start serialization + - the view is still itchy + - force layout ... zoom to extents always (or if checked state?) + - force layout ... no overlapping + - force layout ... use links as forces + - force layout ... push relationships between constituents + - drawing links is yikes, + - push to the back, address multiple-link issue when you have multiples to show + - connecting things ? wtf ? - loading is messy, - load in state objects before init (rolling through much old code) diff --git a/hunks/comm/websocketclient.js b/hunks/comm/websocketclient.js index ba9e87cf0f5a0c5b734168fc24b5ffbca7d6b425..790c955446e01bcbdd4382ba64bf5db79ffaf7e5 100644 --- a/hunks/comm/websocketclient.js +++ b/hunks/comm/websocketclient.js @@ -30,7 +30,7 @@ function WebSocketClient() { this.outbuffer = new Array() this.init = () => { - startWs() + setCheck(100) } let startWs = () => { @@ -82,8 +82,8 @@ function WebSocketClient() { if (retrycount < 1) { // give up this.state.status.set('not connected') - this.state.retrycount.set(retrycount) - checking = false + this.state.retrycount.set(0) + checking = false } else { this.state.retrycount.set(retrycount) checking = false diff --git a/hunks/link.js b/hunks/link.js index 79994e5d8a14013d4e6e448e996d6417c83ba6ea..e538c057fd8cb720e4593f826a283d4d1b5f902a 100644 --- a/hunks/link.js +++ b/hunks/link.js @@ -28,6 +28,8 @@ function Link() { let inports = [this.inputs.zero, this.inputs.zero, this.inputs.one] let outports = [this.outputs.zero, this.outputs.zero] + // ok, on init look at state list + /* // these are *special link inputs* keeping track of downstream status diff --git a/hunks/view.js b/hunks/view.js index 7a61b40791e53eca1bf5d46a72d2e12a963f9c7f..d87c114a501f7824f80df7cc5ad9d97763dc203f 100644 --- a/hunks/view.js +++ b/hunks/view.js @@ -96,15 +96,18 @@ function View() { let height = 0; $(this.msgbox).children().each(function(child){ // jquery.each() syntax is a bit odd / different than elsewhere, sorry for inconsistency - height += this.clientHeight + height += this.clientHeight + 5 }) return height } // if too tall, remove - if(heightcheck() > $(this.msgbox).clientHeight){ + let ch = this.msgbox.clientHeight + if(heightcheck() > ch){ + console.log('rm 1', heightcheck(), ch) $(this.msgbox).children().get(0).remove() // two at most, sloppy but fast - if(heightcheck() > $(this.msgbox).clientHeight){ + if(heightcheck() > ch){ + console.log('rm 2', heightcheck(), ch) $(this.msgbox).children().get(0).remove() } } @@ -176,7 +179,7 @@ function View() { let menu = $('<div>').addClass('contextmenu') .append('<ul> hello -> </ul>').get(0) let ct = readTransform(this.plane) - console.log('write to ', ct) + ///console.log('write to ', ct) writeTransform(menu, { s: 1, x: evt.layerX - ct.x * ct.s, @@ -235,7 +238,7 @@ function View() { // init and/or update if (!flsimrun && blocks.length > 1) { // Case for starting sim - console.log('starting force sim') + writeToMessageBox('starting force sim') flsimrun = true // start with two nodes let positions = this.getAllHunkPositions() @@ -259,7 +262,7 @@ function View() { // donot } else { // case for adding / rming from sim - this.log('UPD8 Force Sim') + writeToMessageBox('UPD8 Force Sim') let positions = this.getAllHunkPositions() if (positions.length > flnodes.length) { let last = positions.length - 1 @@ -274,7 +277,7 @@ function View() { flnodes.push(newNode) // console.log('SIM adds now this', newNode.x, newNode.y) } else { - console.log("SIM DELETE CASE NOT WRITTEN") + writeToMessageBox("SIM DELETE CASE NOT WRITTEN") } flsim.nodes(flnodes) flsim.alpha(1) @@ -496,6 +499,7 @@ function View() { } } drawLinks() + updateForceLoop() } let putLink = (outId, outName, inId, inName) => { @@ -503,8 +507,10 @@ function View() { let outp = $(this.plane).children('.block').children('.outputs').children('#' + outId + '_output_' + outName).get(0) outp.connectedTo.push('#' + inId + '_input_' + inName) drawLinks() + updateForceLoop() } catch (err) { console.log('ERR at putlink', err) + writeToMessageBox('ERR at putlink' + err) return false } return true @@ -517,6 +523,7 @@ function View() { drawLinks() } catch (err) { console.log('ERR at rmlink', err) + writeToMessageBox('ERR at rmlink' + err) return true } return false diff --git a/style.css b/style.css index 6a367eaf12f33996211486b0ee2be63c8cf8b7f5..2465b8776ea731cf3559ed8f2938c79ff5676ab8 100644 --- a/style.css +++ b/style.css @@ -56,7 +56,7 @@ body { .msgbox { width: 300px; - height: 500px; + height: 90%; padding: 10px; margin: 10px; float: right;