Implemented basic process output

This commit is contained in:
2025-07-24 15:38:27 +02:00
parent edd37a707b
commit 24a7b96883
2 changed files with 12 additions and 3 deletions

View File

@@ -80,7 +80,7 @@ class nodeClass {
* Execute a single tick and send outputs. * Execute a single tick and send outputs.
*/ */
_tick() { _tick() {
processMsg = null; processMsg = this.source.getOutput();
influxMsg = null; influxMsg = null;
// Send only updated outputs on ports 0 & 1 // Send only updated outputs on ports 0 & 1

View File

@@ -14,17 +14,26 @@ class liquidFlowHandler {
updateState(timeStamp) { updateState(timeStamp) {
effluent = this.reactors[1].getEffluent(); effluent = this.reactors[1].getEffluent();
effluent.F = this.debit; effluent.payload.F = this.debit;
this.reactors[0].setInfluent = effluent; this.reactors[0].setInfluent = effluent;
} }
handleChildChange() { handleChildChange() {
return;
} }
handlePressureChange(machine) { handlePressureChange(machine) {
this.debit = machine.measurements.type("flow").variant("predicted").position("downstream").getCurrentValue(); this.debit = machine.measurements.type("flow").variant("predicted").position("downstream").getCurrentValue();
} }
getOutput() {
mainEffluent = this.reactors[1].getEffluent();
sideStream = structuredClone(mainEffluent);
mainEffluent.payload.F -= this.debit;
sideStream.payload.F = this.debit;
sideStream.payload.inlet = 1;
return {payload: [mainEffluent.payload, sideStream.payload]};
}
} }
module.exports = { liquidFlowHandler }; module.exports = { liquidFlowHandler };