bug fixes
This commit is contained in:
@@ -16,7 +16,7 @@ class Machine {
|
||||
|
||||
// Load a specific curve
|
||||
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
|
||||
this.config = this.configUtils.initConfig(machineConfig);
|
||||
@@ -106,8 +106,8 @@ class Machine {
|
||||
const isOperational = this._isOperationalState();
|
||||
if(!isOperational){
|
||||
//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("atEquipment").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,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
|
||||
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("atEquipment").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, Date.now(),this.config.general.unit);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user