|
|
|
@ -109,8 +109,10 @@ object ParseHelper {
|
|
|
|
|
// val rangHexLong: Long = HexUtils.hexToLong(rangHex)
|
|
|
|
|
// 是否超量程
|
|
|
|
|
val overRange = value > type.rangMax || status == 8
|
|
|
|
|
|
|
|
|
|
LogUtils.w("receive msg 单位转换前 $type, 浓度 = $value $unit, 最大量程 = ${type.rangMax}")
|
|
|
|
|
if (overRange) {
|
|
|
|
|
value = type.rangMax.toFloat()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据单位进行数值转换
|
|
|
|
|
val localGasUnit = getLocalGasUnit(type.desc)
|
|
|
|
@ -151,7 +153,7 @@ object ParseHelper {
|
|
|
|
|
unit: String,
|
|
|
|
|
overRange: Boolean
|
|
|
|
|
) {
|
|
|
|
|
GlobalScope.launch(Dispatchers.IO) {
|
|
|
|
|
GlobalScope.launch(Dispatchers.Unconfined) {
|
|
|
|
|
// 阈值范围
|
|
|
|
|
val min = getGasLowThreshold(typeEnum.desc, unit)
|
|
|
|
|
val max = getGasHighThreshold(typeEnum.desc, unit)
|
|
|
|
|