Fix recirculation flow measurement to use getCurrentValue and handle undefined values
This commit is contained in:
@@ -76,8 +76,8 @@ class Reactor {
|
||||
const Cs = isArray(this.state.at(-1)) ? this.state.at(-1) : this.state;
|
||||
const effluent = [{ topic: "Fluent", payload: { inlet: 0, F: math.sum(this.Fs), C: Cs }, timestamp: this.currentTime }];
|
||||
if (this.returnPump) {
|
||||
const recirculationFlow = this.returnPump.measurements.type("flow").variant("measured").position("atEquipement").getValue();
|
||||
effluent[0].F -= recirculationFlow;
|
||||
const recirculationFlow = this.returnPump.measurements.type("flow").variant("measured").position("atEquipement").getCurrentValue();
|
||||
effluent[0].F -= recirculationFlow || 0;
|
||||
effluent.push({ topic: "Fluent", payload: { inlet: 1, F: recirculationFlow, C: Cs }, timestamp: this.currentTime });
|
||||
}
|
||||
return effluent;
|
||||
|
||||
Reference in New Issue
Block a user