bug fixes

This commit is contained in:
znetsixe
2025-11-30 09:24:37 +01:00
parent 446ef81f24
commit 108d2e23ca

View File

@@ -16,7 +16,7 @@ class Machine {
// Load a specific curve // Load a specific curve
this.model = machineConfig.asset.model; // Get the model from the machineConfig this.model = machineConfig.asset.model; // Get the model from the machineConfig
this.curve = this.model ? loadCurve(this.model) : null; this.curve = this.model ? loadCurve(this.model) : null; // we need to convert the curve and add units to the curve information
//Init config and check if it is valid //Init config and check if it is valid
this.config = this.configUtils.initConfig(machineConfig); this.config = this.configUtils.initConfig(machineConfig);
@@ -106,8 +106,8 @@ class Machine {
const isOperational = this._isOperationalState(); const isOperational = this._isOperationalState();
if(!isOperational){ if(!isOperational){
//overrule the last prediction this should be 0 now //overrule the last prediction this should be 0 now
this.measurements.type("flow").variant("predicted").position("downstream").value(0); this.measurements.type("flow").variant("predicted").position("downstream").value(0,Date.now(),this.config.general.unit);
this.measurements.type("flow").variant("predicted").position("atEquipment").value(0); this.measurements.type("flow").variant("predicted").position("atEquipment").value(0,Date.now(),this.config.general.unit);
} }
} }
@@ -363,8 +363,8 @@ _callMeasurementHandler(measurementType, value, position, context) {
// If no curve data is available, log a warning and return 0 // If no curve data is available, log a warning and return 0
this.logger.warn(`No curve data available for flow calculation. Returning 0.`); this.logger.warn(`No curve data available for flow calculation. Returning 0.`);
this.measurements.type("flow").variant("predicted").position("downstream").value(0); this.measurements.type("flow").variant("predicted").position("downstream").value(0, Date.now(),this.config.general.unit);
this.measurements.type("flow").variant("predicted").position("atEquipment").value(0); this.measurements.type("flow").variant("predicted").position("atEquipment").value(0, Date.now(),this.config.general.unit);
return 0; return 0;
} }