Add effluent output handling

This commit is contained in:
2025-06-13 15:31:31 +02:00
parent d71698d94e
commit 5b7f7a3cef
3 changed files with 12 additions and 2 deletions

View File

@@ -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";

View File

@@ -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();
} }

View File

@@ -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;