agent updates
This commit is contained in:
@@ -332,7 +332,7 @@ class MeasurementContainer {
|
||||
// Convert if needed
|
||||
if (measurement.unit && requestedUnit !== measurement.unit) {
|
||||
try {
|
||||
const convertedValue = convertModule(value).from(measurement.unit).to(requestedUnit);
|
||||
const convertedValue = convertModule(sample.value).from(measurement.unit).to(requestedUnit);
|
||||
//replace old value in sample and return obj
|
||||
sample.value = convertedValue ;
|
||||
sample.unit = requestedUnit;
|
||||
@@ -364,7 +364,7 @@ class MeasurementContainer {
|
||||
// Convert if needed
|
||||
if (measurement.unit && requestedUnit !== measurement.unit) {
|
||||
try {
|
||||
const convertedValue = convertModule(value).from(measurement.unit).to(requestedUnit);
|
||||
const convertedValue = convertModule(sample.value).from(measurement.unit).to(requestedUnit);
|
||||
//replace old value in sample and return obj
|
||||
sample.value = convertedValue ;
|
||||
sample.unit = requestedUnit;
|
||||
@@ -619,16 +619,16 @@ class MeasurementContainer {
|
||||
}
|
||||
|
||||
_convertPositionNum2Str(positionValue) {
|
||||
switch (positionValue) {
|
||||
case 0:
|
||||
if (positionValue === 0) {
|
||||
return "atEquipment";
|
||||
case (positionValue < 0):
|
||||
return "upstream";
|
||||
case (positionValue > 0):
|
||||
return "downstream";
|
||||
default:
|
||||
console.log(`Invalid position provided: ${positionValue}`);
|
||||
}
|
||||
if (positionValue < 0) {
|
||||
return "upstream";
|
||||
}
|
||||
if (positionValue > 0) {
|
||||
return "downstream";
|
||||
}
|
||||
console.log(`Invalid position provided: ${positionValue}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user