Added seperate process, DB and parent outputs

This commit is contained in:
2025-07-16 10:57:35 +02:00
parent 6227bbe256
commit d5db1ae0a0
2 changed files with 19 additions and 4 deletions

View File

@@ -26,8 +26,9 @@
X_TS_init: { value: 125.0009, required: true }
},
inputs: 1,
outputs: 1,
outputLabels: "Effluent",
outputs: 3,
inputLabels: ["input"],
outputLabels: ["process", "dbase", "parent"],
icon: "font-awesome/fa-recycle",
label: function() {
return this.name || "advanced-reactor";

View File

@@ -16,7 +16,7 @@ class nodeClass {
this.name = nameOfNode;
this._loadConfig(uiConfig)
this._registerChild();
this._setupClass();
this._attachInputHandler();
@@ -60,7 +60,7 @@ class nodeClass {
if (toggleUpdate) {
this.reactor.updateState(msg.timestamp);
send(this.reactor.getEffluent);
send([this.reactor.getEffluent, null, null]);
}
if (done) {
@@ -100,6 +100,20 @@ class nodeClass {
}
}
/**
* Register this node as a child upstream and downstream.
* Delayed to avoid Node-RED startup race conditions.
*/
_registerChild() {
setTimeout(() => {
this.node.send([
null,
null,
{ topic: 'registerChild', payload: this.node.id , positionVsParent: this.config?.functionality?.positionVsParent || 'atEquipment' },
]);
}, 100);
}
/**
* Setup reactor class based on config
*/