This commit is contained in:
znetsixe
2026-02-23 13:17:03 +01:00
parent 9e0e3e3859
commit c587ed9c7b
4 changed files with 43 additions and 19 deletions

View File

@@ -1,6 +1,10 @@
const EventEmitter = require('events');
const {logger,configUtils,configManager,MeasurementContainer} = require('generalFunctions');
/**
* Measurement domain model.
* Handles scaling, smoothing, outlier filtering and emits normalized measurement output.
*/
class Measurement {
constructor(config={}) {
@@ -506,7 +510,10 @@ class Measurement {
}
toggleOutlierDetection() {
this.config.outlierDetection = !this.config.outlierDetection;
// Keep the outlier configuration shape stable and only toggle the enabled flag.
const currentState = Boolean(this.config?.outlierDetection?.enabled);
this.config.outlierDetection = this.config.outlierDetection || {};
this.config.outlierDetection.enabled = !currentState;
}
getOutput() {
@@ -586,4 +593,4 @@ function changeInput(){
//m.inputValue = 5;
}
// */
// */