Starting to add scale factors & linearisation

Added breakpoints property to the node
Building the breakpoints editor (nearly there!)
This commit is contained in:
Maxwell Hadley
2014-02-08 22:36:23 +00:00
parent c6108cffb4
commit 68080df45e
2 changed files with 93 additions and 1 deletions

View File

@@ -32,11 +32,17 @@ function AnalogInputNode(n) {
// Store local copies of the node configuration (as defined in the .html)
this.topic = n.topic;
this.pin = n.pin;
this.breakpoints = n.breakpoints;
// Define 'node' to allow us to access 'this' from within callbacks (the 'var' is essential -
// otherwise there is only one global 'node' for all instances of AnalogInputNode!)
var node = this;
node.log("breakpoints:");
for (var i = 0; i < node.breakpoints.length; i++) {
node.log(i + ": {input:" + node.breakpoints[i].input + ", output:" + node.breakpoints[i].output + ", mutable:" + node.breakpoints[i].mutable +"}");
}
// A callback function variable seems to be more reliable than a lambda ?!
var readCallback = function (x) {
var msg = {};