forked from RnD/rotatingMachine
Compare commits
2 Commits
38408c7bc3
...
000bee7190
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
000bee7190 | ||
|
|
b0c18e7bae |
@@ -71,7 +71,7 @@ class Machine {
|
||||
this.config = this.configUtils.updateConfig(this.config, {general:{name: this.config.functionality?.softwareType + "_" + machineConfig.general.id}}); // add unique name if not present
|
||||
|
||||
if (!this.model || !this.curve) {
|
||||
this.logger.warn(`${!this.model ? 'Model not specified' : 'Curve not found for model ' + this.model} in machineConfig. Cannot make predictions.`);
|
||||
this.logger.error(`${!this.model ? 'Model not specified' : 'Curve not found for model ' + this.model} in machineConfig. Cannot make predictions.`);
|
||||
// Set prediction objects to null to prevent method calls
|
||||
this.predictFlow = null;
|
||||
this.predictPower = null;
|
||||
@@ -502,9 +502,8 @@ _callMeasurementHandler(measurementType, value, position, context) {
|
||||
}
|
||||
}
|
||||
|
||||
// ENHANCED: Your existing handler but with rich context
|
||||
// rich context handler for pressure updates
|
||||
updateMeasuredPressure(value, position, context = {}) {
|
||||
// Your existing operational check
|
||||
if (!this._isOperationalState()) {
|
||||
this.logger.warn(`Machine not operational, skipping pressure update from ${context.childName || 'unknown'}`);
|
||||
return;
|
||||
@@ -523,7 +522,7 @@ _callMeasurementHandler(measurementType, value, position, context) {
|
||||
this.logger.debug(`Using pressure: ${pressure} for calculations`);
|
||||
}
|
||||
|
||||
// NEW: Flow handler (following your pattern)
|
||||
// NEW: Flow handler
|
||||
updateMeasuredFlow(value, position, context = {}) {
|
||||
if (!this._isOperationalState()) {
|
||||
this.logger.warn(`Machine not operational, skipping flow update from ${context.childName || 'unknown'}`);
|
||||
|
||||
Reference in New Issue
Block a user