diff --git a/advanced-reactor.html b/advanced-reactor.html index d63f71b..a18e6a3 100644 --- a/advanced-reactor.html +++ b/advanced-reactor.html @@ -21,6 +21,7 @@ }, inputs: 1, outputs: 1, + outputLabels: "Effluent", icon: "font-awesome/fa-recycle", label: function() { return this.name || "advanced-reactor"; diff --git a/advanced-reactor.js b/advanced-reactor.js index bd364c8..0a0bbcd 100644 --- a/advanced-reactor.js +++ b/advanced-reactor.js @@ -31,16 +31,21 @@ module.exports = function(RED) { case "clock": reactor.updateState(msg); break; - case "Influx": + case "Influent": + reactor.setInflux = msg; + break; + case "Effluent": reactor.setInflux = msg; break; case "OTR": reactor.setOTR = msg; break; default: - console.log("Unknown topic: " + msg.topic) + console.log("Unknown topic: " + msg.topic); } + send(reactor.getEffluent); + if (done) { done(); } diff --git a/dependencies/reactor_class.js b/dependencies/reactor_class.js index a50ca23..29a3111 100644 --- a/dependencies/reactor_class.js +++ b/dependencies/reactor_class.js @@ -26,6 +26,10 @@ class Reactor_CSTR { this.OTR = input.payload; } + get getEffluent() { + return {topic: "Effluent", payload: {F: this.F, C_in:this.state}}; + } + // expect update with timestamp updateState(input) { let newTime = input.payload;