diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/UdpCarStateMessage.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/UdpCarStateMessage.java index acb257dada..9e20a668c0 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/UdpCarStateMessage.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/UdpCarStateMessage.java @@ -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++; } diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/WsAutopilotIdentify.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/WsAutopilotIdentify.java index 304fa09864..82187a79a3 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/WsAutopilotIdentify.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/msg/WsAutopilotIdentify.java @@ -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){