1 Commits

Author SHA1 Message Date
a748cd9407 pub 2025-11-17 15:28:59 +01:00

View File

@@ -58,10 +58,14 @@ class MachineGroup {
this.handlePressureChange();
});
// listen to machine flow changes
this.logger.debug(`Listening for flow changes from machine ${child.config.general.id}`);
child.measurements.emitter.on("flow.predicted.downstream", (eventData) => {
this.logger.debug(`Flow prediction update from ${child.config.general.id}: ${eventData.value} ${eventData.unit}`);
//later change to this.handleFlowPredictionChange();
this.handlePressureChange();
this.handlePressureChange(); // nu nog zo maar straks specifiek voor flow
//this.handleFlowChange();
});
@@ -196,6 +200,7 @@ class MachineGroup {
this.logger.debug(`Dynamic Totals after pressure change - Flow: Min ${flow.min}, Max ${flow.max}, Act ${flow.act} | Power: Min ${power.min}, Max ${power.max}, Act ${power.act}`);
this.measurements.type("flow").variant("predicted").position("downstream").value(flow.act);
console.log('XXXXXXXXXXXXXXXXXXXX, flow.act ', flow.act, 'XXXXXXXXXXXXXXXXXXXXXXX ');
this.measurements.type("power").variant("predicted").position("atEquipment").value(power.act);
const { maxEfficiency, lowestEfficiency } = this.calcGroupEfficiency(this.machines);
@@ -203,6 +208,7 @@ class MachineGroup {
this.calcDistanceBEP(efficiency,maxEfficiency,lowestEfficiency);
}
calcDistanceFromPeak(currentEfficiency,peakEfficiency){
return Math.abs(currentEfficiency - peakEfficiency);
}