diff --git a/README.md b/README.md index 2cf43db977f7d4116d84638bbb9376ba8854e8f6..f7a5a120cf336de384ecf2e19475a39ebf46f95c 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 30dbe7329f0302ca01ff2f0cb8e6c5d04a0c6866..e5f901747a9f19482a7e29c089321e0fdb6ece00 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) /* ------------------------------------------------------