From d3f60b1cb4eaaf60201e6a792d57a88ba9142000 Mon Sep 17 00:00:00 2001 From: Jake <jake.read@cba.mit.edu> Date: Thu, 8 Nov 2018 18:33:37 -0500 Subject: [PATCH] about to break everything --- README.md | 39 ++++++++++++++++++++++++++++++ server.js | 71 ++++++++++++++++++++++++++----------------------------- 2 files changed, 72 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 2cf43db..f7a5a12 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,47 @@ This project serves the developement environment / api we use to write and repre  +## For MW + + - fundament + - load / save programs (req. prgmem representation) + - UI + - title bar descr. how to operate + - 'L' for load, 'M' for new module, type for module search ? + - right-click delete / copy etc + - evt line highlight on hover + - hover display type + +## WRT Representations + +OK + +Module have + Inputs + Outputs + State (initial states are settings) + +Also + Names, IDs + Paths-to-source + +Modules-that-represent-remote-computing also have + Ports + that connect to + Link + +To assemble a representation of these, we want to have a kind of 'netlist' that, for convenience, we'll treat like a JSON object. We want heirarchy, so consider the representation having 'top-level' outputs / inputs / state as well ? + + + ## Programming Notes + +title bar +L for load prgmem +M for add module + + - once we can plan gcode sequence, work towards more - better hardware abstraction, i.e. stepper.port = bridge.port('0,1') diff --git a/server.js b/server.js index 30dbe73..e5f9017 100644 --- a/server.js +++ b/server.js @@ -136,46 +136,41 @@ PROGRAM AS API var modules = new Array() -var test = addModule('./src/hardware/test.js') -var bridge = addModule('./src/hardware/bridge.js') - -test.outputs.packet.attach(bridge.inputs.B) - -bridge.outputs.B.attach(test.inputs.packet) - -var t2 = addModule('./src/hardware/test.js') -var t3 = addModule('./src/hardware/test.js') - -t2.outputs.packet.attach(bridge.inputs.A) -bridge.outputs.A.attach(t2.inputs.packet) - -t3.outputs.packet.attach(bridge.inputs.F) -bridge.outputs.F.attach(t3.inputs.packet) - -/* -var serialATKLink = addModule('./src/hardware/serialATKLink.js') - -/* -var rtr = addModule('./src/hardware/atkrouter.js') -rtr.port.route = '0' -serialATKLink.attach(rtr) - -var bbs = addModule('./src/hardware/atkbbbs.js') -bbs.port.route = '0,2' -serialATKLink.attach(bbs.port) -*/ - -bridge.init() - -var plCol = 1060 - -setUiPos(test, plCol,718 + 200) -setUiPos(t2, plCol, 850 + 200) -setUiPos(t3, plCol, 970 + 200) +// a program is a list of modules, +// modules have internal lists of modules that they call + +var prgmem = { + // we want to describe all of the nodes first, + // then we can add connections once we have hooks + // to each of them + modules: { + gate: { + path: './src/util/gate.js', + conn: { + + } + ui:{ + pos: [100, 100] + } + }, + delay: { + path: './src/util/delay.js', + state: { + ms: 500 + } + }, + log: { + path: './src/util.log.js' + } + }, + connections: ['gate.outputs.out', 'delay.inputs.thru'] +} -var hwCol = 1629 +function loadPrgmem(desc) { + console.log(desc) +} -setUiPos(bridge, hwCol,890) +loadPrgmem(prgmem) /* ------------------------------------------------------ -- GitLab