| | |
| | | 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.* |
| | | |
| | | /** |
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | 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()) { |
| | | //去除 信息类型标志 |
| | |
| | | } |
| | | |
| | | 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) |
| | |
| | | } |
| | | } |
| | | |
| | | 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()) { |
| | | //去除 信息类型标志 |
| | |
| | | } |
| | | |
| | | 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) |