Add effluent output handling
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
},
|
},
|
||||||
inputs: 1,
|
inputs: 1,
|
||||||
outputs: 1,
|
outputs: 1,
|
||||||
|
outputLabels: "Effluent",
|
||||||
icon: "font-awesome/fa-recycle",
|
icon: "font-awesome/fa-recycle",
|
||||||
label: function() {
|
label: function() {
|
||||||
return this.name || "advanced-reactor";
|
return this.name || "advanced-reactor";
|
||||||
|
|||||||
@@ -31,16 +31,21 @@ module.exports = function(RED) {
|
|||||||
case "clock":
|
case "clock":
|
||||||
reactor.updateState(msg);
|
reactor.updateState(msg);
|
||||||
break;
|
break;
|
||||||
case "Influx":
|
case "Influent":
|
||||||
|
reactor.setInflux = msg;
|
||||||
|
break;
|
||||||
|
case "Effluent":
|
||||||
reactor.setInflux = msg;
|
reactor.setInflux = msg;
|
||||||
break;
|
break;
|
||||||
case "OTR":
|
case "OTR":
|
||||||
reactor.setOTR = msg;
|
reactor.setOTR = msg;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
console.log("Unknown topic: " + msg.topic)
|
console.log("Unknown topic: " + msg.topic);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
send(reactor.getEffluent);
|
||||||
|
|
||||||
if (done) {
|
if (done) {
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
|
|||||||
4
dependencies/reactor_class.js
vendored
4
dependencies/reactor_class.js
vendored
@@ -26,6 +26,10 @@ class Reactor_CSTR {
|
|||||||
this.OTR = input.payload;
|
this.OTR = input.payload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get getEffluent() {
|
||||||
|
return {topic: "Effluent", payload: {F: this.F, C_in:this.state}};
|
||||||
|
}
|
||||||
|
|
||||||
// expect update with timestamp
|
// expect update with timestamp
|
||||||
updateState(input) {
|
updateState(input) {
|
||||||
let newTime = input.payload;
|
let newTime = input.payload;
|
||||||
|
|||||||
Reference in New Issue
Block a user