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 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 }];
|
const effluent = [{ topic: "Fluent", payload: { inlet: 0, F: math.sum(this.Fs), C: Cs }, timestamp: this.currentTime }];
|
||||||
if (this.returnPump) {
|
if (this.returnPump) {
|
||||||
const recirculationFlow = this.returnPump.measurements.type("flow").variant("measured").position("atEquipement").getValue();
|
const recirculationFlow = this.returnPump.measurements.type("flow").variant("measured").position("atEquipement").getCurrentValue();
|
||||||
effluent[0].F -= recirculationFlow;
|
effluent[0].F -= recirculationFlow || 0;
|
||||||
effluent.push({ topic: "Fluent", payload: { inlet: 1, F: recirculationFlow, C: Cs }, timestamp: this.currentTime });
|
effluent.push({ topic: "Fluent", payload: { inlet: 1, F: recirculationFlow, C: Cs }, timestamp: this.currentTime });
|
||||||
}
|
}
|
||||||
return effluent;
|
return effluent;
|
||||||
|
|||||||
Reference in New Issue
Block a user