From 2bf337ab074f1c047c4f4e4df29ed994d3decaf1 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期二, 17 九月 2019 13:57:32 +0800 Subject: [PATCH] 修改一些属性及类的命名 --- src/main/kotlin/com/flightfeather/obd/socket/decoder/impl/RealTimeDataDecoderImpl.kt | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/com/flightfeather/obd/socket/decoder/impl/RealTimeDataDecoderImpl.kt b/src/main/kotlin/com/flightfeather/obd/socket/decoder/impl/RealTimeDataDecoderImpl.kt index e1067f6..a1a4e22 100644 --- a/src/main/kotlin/com/flightfeather/obd/socket/decoder/impl/RealTimeDataDecoderImpl.kt +++ b/src/main/kotlin/com/flightfeather/obd/socket/decoder/impl/RealTimeDataDecoderImpl.kt @@ -1,11 +1,10 @@ package com.flightfeather.obd.socket.decoder.impl -import com.flightfeather.obd.socket.bean.EngineDataFlow +import com.flightfeather.obd.socket.bean.EngineDataStream import com.flightfeather.obd.socket.bean.ObdData -import com.flightfeather.obd.socket.bean.SupplementDataFlow +import com.flightfeather.obd.socket.bean.SupplementDataStream import com.flightfeather.obd.socket.decoder.RealTimeDataDecoder import com.flightfeather.obd.socket.eunm.ObdDataType -import org.springframework.stereotype.Component import java.util.* /** @@ -53,7 +52,7 @@ diagnosisSupportStatus = "${dataList[2]}${dataList[3]}".toIntOrNull(16)?.toString(2) diagnosisReadyStatus = "${dataList[4]}${dataList[5]}".toIntOrNull(16)?.toString(2) obdVin = vin.toString() - obdSoftwareCode = softwareCode.toString() + obdCrn = softwareCode.toString() obdCvn = cvn.toString() this.IUPR = IUPR.toString() obdFaultCodeNum = faultCodeNum @@ -64,7 +63,7 @@ } } - override fun getEngineDataFlow(time: Date?, serialNum: Int, b: List<String>): EngineDataFlow? { + override fun getEngineDataStream(time: Date?, serialNum: Int, b: List<String>): EngineDataStream? { val dataList = mutableListOf<String>().apply { addAll(b) } if (b.isNotEmpty()) { //鍘婚櫎 淇℃伅绫诲瀷鏍囧織 @@ -72,7 +71,7 @@ } return if (dataList.size >= 37) { - EngineDataFlow(time, serialNum).apply { + EngineDataStream(time, serialNum).apply { obdSpeed = "${dataList[0]}${dataList[1]}".toIntOrNull(16)?.toDouble()?.times((1 / 256).toDouble()) obdAirPressure = dataList[2].toIntOrNull(16)?.toDouble()?.times(0.5) obdEngineTorque = dataList[3].toIntOrNull(16)?.minus(125)?.toDouble()?.div(100) @@ -98,7 +97,7 @@ } } - override fun getSupplementDataFlow(time: Date?, serialNum: Int, b: List<String>): SupplementDataFlow? { + override fun getSupplementDataStream(time: Date?, serialNum: Int, b: List<String>): SupplementDataStream? { val dataList = mutableListOf<String>().apply { addAll(b) } if (b.isNotEmpty()) { //鍘婚櫎 淇℃伅绫诲瀷鏍囧織 @@ -106,7 +105,7 @@ } return if (dataList.size >= 17) { - SupplementDataFlow(time, serialNum).apply { + SupplementDataStream(time, serialNum).apply { obdEngineTorqueMode = dataList[0].toIntOrNull(16) obdAcceleratorPedal = dataList[1].toIntOrNull(16)?.toDouble()?.times(0.4)?.div(100) obdTotalOilConsumption = "${dataList[2]}${dataList[3]}${dataList[4]}${dataList[5]}".toIntOrNull(16)?.toDouble()?.times(0.5) -- Gitblit v1.9.3