From 7269d4a4755fa48c45e827bdc5b5ac56c6eca99c Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 11 十二月 2020 17:27:01 +0800 Subject: [PATCH] 修改监测因子类型 --- src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt b/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt index b6eba76..1af1944 100644 --- a/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt +++ b/src/main/kotlin/com/flightfeather/uav/socket/decoder/impl/DataUnitDecoderImpl.kt @@ -45,7 +45,7 @@ val valid = b[i].toInt(16).toChar()//缁忕含搴︽槸鍚︽湁鏁堬紙鏈夋晥: A; 鏃犳晥: V锛� val a1 = b[i + 1].toInt(16) val b1 = b[i + 2].toInt(16) - var b2 = "${b[i + 3]}${b[i + 4]}".toInt(16).toLong() + var b2 = "${b[i + 3]}${b[i + 4]}".toInt(16).toDouble() while (b2 >= 1) { b2 /= 10 } @@ -62,7 +62,7 @@ FactorType.LAT -> { val a1 = b[i].toInt(16) val b1 = b[i + 1].toInt(16) - var b2 = "${b[i + 2]}${b[i + 3]}".toInt(16).toLong() + var b2 = "${b[i + 2]}${b[i + 3]}".toInt(16).toDouble() while (b2 >= 1) { b2 /= 10 } @@ -87,7 +87,7 @@ resultList.add(AirData().apply { factorId = it.factorType.value.toString() factorName = it.factorType.des - factorData = time + factorData = time.toDouble() statusList = listOf(date) }) } @@ -95,7 +95,7 @@ when (it.factorType.byteLength) { AirDataPackage.FACTOR_BIT_LENGTH_2 -> { val a1 = "${b[i]}${b[i + 1]}".toInt(16) - var b1 = b[i + 2].toInt(16).toLong() + var b1 = b[i + 2].toInt(16).toDouble() while (b1 >= 1) { b1 /= 10 } @@ -110,7 +110,7 @@ AirDataPackage.FACTOR_BIT_LENGTH_1 -> { //鏁版嵁瀹為檯鍊硷紙3浣嶅瓧鑺傝〃绀猴級 val a1 = "${b[i]}${b[i + 1]}".toInt(16) - var b1 = b[i + 2].toInt(16).toLong() + var b1 = b[i + 2].toInt(16).toDouble() while (b1 >= 1) { b1 /= 10 } @@ -118,7 +118,7 @@ //鏁版嵁鐗╃悊閲忥紙3浣嶅瓧鑺傝〃绀猴級 val a2 = "${b[i+3]}${b[i + 4]}".toInt(16) - var b2 = b[i + 5].toInt(16).toLong() + var b2 = b[i + 5].toInt(16).toDouble() while (b2 >= 1) { b2 /= 10 } -- Gitblit v1.9.3