From 08b4bde348d580d68f43c615c22b9282fced3ce9 Mon Sep 17 00:00:00 2001 From: xinfengkun Date: Thu, 27 Jan 2022 17:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E8=BD=AC=E5=90=91=E7=81=AF?= =?UTF-8?q?=E5=B8=B8=E5=BC=80=E5=B8=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhidao/support/adas/high/msg/UdpCarStateMessage.java | 7 ++++--- .../zhidao/support/adas/high/msg/WsAutopilotIdentify.java | 7 +------ 2 files changed, 5 insertions(+), 9 deletions(-) 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){