Implemented basic process output
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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 };
|
||||||
Reference in New Issue
Block a user