Compare commits
1 Commits
c464b66b27
...
26e253d030
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26e253d030 |
@@ -967,10 +967,14 @@ _callMeasurementHandler(measurementType, value, position, context) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cFlow = this.predictFlow.y(x);
|
// Clamp: at position ≤ 0 the pump isn't rotating — physical flow is 0.
|
||||||
|
// Without this, curve extrapolation at ctrl=0 + high backpressure
|
||||||
|
// produces large negative values (backflow through a stopped pump)
|
||||||
|
// that confuse dashboards and downstream consumers.
|
||||||
|
const rawFlow = this.predictFlow.y(x);
|
||||||
|
const cFlow = (x <= 0) ? 0 : Math.max(0, rawFlow);
|
||||||
this.measurements.type("flow").variant("predicted").position("downstream").value(cFlow,Date.now(),this.unitPolicy.canonical.flow);
|
this.measurements.type("flow").variant("predicted").position("downstream").value(cFlow,Date.now(),this.unitPolicy.canonical.flow);
|
||||||
this.measurements.type("flow").variant("predicted").position("atEquipment").value(cFlow,Date.now(),this.unitPolicy.canonical.flow);
|
this.measurements.type("flow").variant("predicted").position("atEquipment").value(cFlow,Date.now(),this.unitPolicy.canonical.flow);
|
||||||
//this.logger.debug(`Calculated flow: ${cFlow} for pressure: ${this.getMeasuredPressure()} and position: ${x}`);
|
|
||||||
return cFlow;
|
return cFlow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -991,10 +995,9 @@ _callMeasurementHandler(measurementType, value, position, context) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//this.predictPower.currentX = x; Decrepated
|
const rawPower = this.predictPower.y(x);
|
||||||
const cPower = this.predictPower.y(x);
|
const cPower = (x <= 0) ? 0 : Math.max(0, rawPower);
|
||||||
this.measurements.type("power").variant("predicted").position('atEquipment').value(cPower, Date.now(), this.unitPolicy.canonical.power);
|
this.measurements.type("power").variant("predicted").position('atEquipment').value(cPower, Date.now(), this.unitPolicy.canonical.power);
|
||||||
//this.logger.debug(`Calculated power: ${cPower} for pressure: ${this.getMeasuredPressure()} and position: ${x}`);
|
|
||||||
return cPower;
|
return cPower;
|
||||||
}
|
}
|
||||||
// If no curve data is available, log a warning and return 0
|
// If no curve data is available, log a warning and return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user