加入转向灯常开常关数据解析

This commit is contained in:
xinfengkun
2022-01-27 17:39:59 +08:00
parent 59264794fc
commit 08b4bde348
2 changed files with 5 additions and 9 deletions

View File

@@ -41,7 +41,6 @@ public class UdpCarStateMessage extends MyAbstractMessageHandler {
CarStateInfo carStateInfo = new CarStateInfo();
carStateInfo.setAction("state");
CarStateInfo.ValuesBean values = new CarStateInfo.ValuesBean();
setTurnLightState(values);
values.setLon(status.getLon());
values.setLat(status.getLat());
values.setAlt(status.getAlt());
@@ -57,6 +56,7 @@ public class UdpCarStateMessage extends MyAbstractMessageHandler {
values.setBrake_light(status.getBrakeLight());
values.setFrame_num(status.getFrameNum());
carStateInfo.setValues(values);
setTurnLightState(values);
if (adasListener != null) {
adasListener.onCarStateData(carStateInfo);
CupidLogUtils.w("UdpCarStateMessage", "" + carStateInfo.toString());
@@ -72,14 +72,15 @@ public class UdpCarStateMessage extends MyAbstractMessageHandler {
*/
private int turnLightTimes = 0;
private boolean isOnTurnLight = false;
private int turnLight = 0;
public void setTurnLightState(CarStateInfo.ValuesBean values) {
int turnLight = 0;
int turn_light = values.getTurn_light();
if (turn_light == 0) {
if (isOnTurnLight) {
if (turnLightTimes >= 12) {
if (turnLightTimes >= 10) {
isOnTurnLight = false;
turnLight = 0;
}
turnLightTimes++;
}

View File

@@ -3,15 +3,11 @@ package com.zhidao.support.adas.high.msg;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import com.google.gson.Gson;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.bean.record.AutopilotIdentifyInfo;
import com.zhidao.support.adas.high.bean.record.AutopilotRecordResult;
import com.zhidao.support.adas.high.common.AppPreferenceHelper;
import com.zhidao.support.adas.high.common.CupidLogUtils;
import com.zhidao.support.adas.high.common.HandlerThreadManager;
import com.zhidao.support.adas.high.common.MgContextUtils;
import com.zhidao.support.recorder.RecordDataManager;
@@ -28,11 +24,10 @@ public class WsAutopilotIdentify extends MyAbstractMessageHandler {
@Override
public void handlerMsg(Gson gson, OnAdasListener adasListener, String msg) {
Log.i("WsAutopilotIdentify","WsAutopilotIdentify===>" + msg);
AutopilotIdentifyInfo info = gson.fromJson(msg, AutopilotIdentifyInfo.class);
AutopilotIdentifyInfo.Result result = info.getResult();
AutopilotRecordResult panel = result.getPanel();
if (adasListener!=null){
if (adasListener != null) {
adasListener.onAutopilotRecord(panel);
}
// if (panel!=null){