diff --git a/app/src/main/java/com/yinuo/safetywatcher/watcher/port/ParseHelper.kt b/app/src/main/java/com/yinuo/safetywatcher/watcher/port/ParseHelper.kt index d48e4b5..37ac6bb 100644 --- a/app/src/main/java/com/yinuo/safetywatcher/watcher/port/ParseHelper.kt +++ b/app/src/main/java/com/yinuo/safetywatcher/watcher/port/ParseHelper.kt @@ -116,6 +116,7 @@ object ParseHelper { } value = correctValueByOtherGas(type, value) + LogUtils.w("receive msg 多气体矫正后 $type, 浓度 = $value $unit") //根据单位进行数值转换 val localGasUnit = getLocalGasUnit(type.desc) @@ -318,8 +319,9 @@ object ParseHelper { if (gasMap.isNotEmpty()) { gasMap.forEach { entry -> val gas = entry.value - if (gas.gasValue > 0) { - offset += gas.gasValue * getInfluenceCoefficient(type, gas.gasName) + val coefficient = getInfluenceCoefficient(type, gas.gasName) + if (gas.gasValue > 0f && coefficient != 0f) { + offset += gas.gasValue * coefficient } } }