|
|
|
@@ -498,7 +498,7 @@ class Measurement {
|
|
|
|
updateOutputAbs(val) {
|
|
|
|
updateOutputAbs(val) {
|
|
|
|
|
|
|
|
|
|
|
|
//only update on change
|
|
|
|
//only update on change
|
|
|
|
if(val != this.outputAbs){
|
|
|
|
if (val != this.outputAbs) {
|
|
|
|
|
|
|
|
|
|
|
|
// Constrain value within process range
|
|
|
|
// Constrain value within process range
|
|
|
|
if (val < this.config.scaling.absMin || val > this.config.scaling.absMax) {
|
|
|
|
if (val < this.config.scaling.absMin || val > this.config.scaling.absMax) {
|
|
|
|
@@ -512,8 +512,13 @@ class Measurement {
|
|
|
|
this.emitter.emit('mAbs', this.outputAbs);// DEPRECATED: Use measurements container instead
|
|
|
|
this.emitter.emit('mAbs', this.outputAbs);// DEPRECATED: Use measurements container instead
|
|
|
|
|
|
|
|
|
|
|
|
// In the new method just update the measurement container and let the parent subscribe to it
|
|
|
|
// In the new method just update the measurement container and let the parent subscribe to it
|
|
|
|
|
|
|
|
if (typeof this.config.functionality.distance !== 'undefined') {
|
|
|
|
|
|
|
|
this.logger.debug(`Updating type: ${this.config.asset.type}, variant: ${"measured"}, postition : ${this.config.functionality.distance} container with new value: ${this.outputAbs}`);
|
|
|
|
|
|
|
|
this.measurements.type(this.config.asset.type).variant("measured").position(this.config.functionality.distance).value(this.outputAbs, Date.now(),this.config.asset.unit );
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
this.logger.debug(`Updating type: ${this.config.asset.type}, variant: ${"measured"}, postition : ${this.config.functionality.positionVsParent} container with new value: ${this.outputAbs}`);
|
|
|
|
this.logger.debug(`Updating type: ${this.config.asset.type}, variant: ${"measured"}, postition : ${this.config.functionality.positionVsParent} container with new value: ${this.outputAbs}`);
|
|
|
|
this.measurements.type(this.config.asset.type).variant("measured").position(this.config.functionality.positionVsParent).value(this.outputAbs, Date.now(),this.config.asset.unit ); // New method
|
|
|
|
this.measurements.type(this.config.asset.type).variant("measured").position(this.config.functionality.positionVsParent).value(this.outputAbs, Date.now(),this.config.asset.unit );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|