This commit is contained in:
tongchenfei
2020-10-30 14:12:14 +08:00
parent 1c2c84a30d
commit 8a8c66ebb7
2 changed files with 15 additions and 8 deletions

2
.idea/misc.xml generated
View File

@@ -4,7 +4,7 @@
<asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" /> <asm skipDebug="false" skipFrames="false" skipCode="false" expandFrames="false" />
<groovy codeStyle="LEGACY" /> <groovy codeStyle="LEGACY" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="SuppressionsComponent"> <component name="SuppressionsComponent">

View File

@@ -59,6 +59,8 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
private Handler handler = new Handler(this); private Handler handler = new Handler(this);
private boolean isObuLightData = false;
private View selfCar; private View selfCar;
private boolean lightCenter = true; private boolean lightCenter = true;
@@ -95,10 +97,6 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
if(!lightCenter) { if(!lightCenter) {
handler.sendEmptyMessageDelayed(MSG_REFRESH_CAR_STRATEGY, STRATEGY_DELAY); handler.sendEmptyMessageDelayed(MSG_REFRESH_CAR_STRATEGY, STRATEGY_DELAY);
} }
// debug code
// tvSelfSpeed.setVisibility(View.VISIBLE);
// tvTrafficLight.setVisibility(View.VISIBLE);
// tvLimitSpeed.setVisibility(View.VISIBLE);
} }
} }
@@ -209,11 +207,12 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
tvLimitSpeed.setVisibility(View.GONE); tvLimitSpeed.setVisibility(View.GONE);
return true; return true;
case MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD: case MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD:
if (!handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { if (!isObuLightData && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) {
tvTrafficLight.setVisibility(View.GONE); tvTrafficLight.setVisibility(View.GONE);
} }
return true; return true;
case MSG_HIDE_TRAFFIC_LIGHT_BY_OBU: case MSG_HIDE_TRAFFIC_LIGHT_BY_OBU:
isObuLightData = false;
if (!handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD)) { if (!handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD)) {
tvTrafficLight.setVisibility(View.GONE); tvTrafficLight.setVisibility(View.GONE);
} }
@@ -237,8 +236,11 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
String action = intent.getAction(); String action = intent.getAction();
if("com.mogo.launcher.adas".equals(action)){ if("com.mogo.launcher.adas".equals(action)){
// 收到限速信息 // 收到限速信息
limitSpeed = intent.getIntExtra("adas_speed_limit", -1); int limit = intent.getIntExtra("adas_speed_limit", -1);
drawLimitSpeed(); if(limit>0) {
limitSpeed = limit;
drawLimitSpeed();
}
}else { }else {
int type = intent.getIntExtra("type", -1); int type = intent.getIntExtra("type", -1);
if (type == 2) { if (type == 2) {
@@ -272,6 +274,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
} }
private void handleObuTrafficLightInfo(String lightStatus, String surplusTime) { private void handleObuTrafficLightInfo(String lightStatus, String surplusTime) {
isObuLightData = true;
if (tvTrafficLight != null) { if (tvTrafficLight != null) {
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU); handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD);
@@ -282,6 +285,10 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
} }
private void handleCloudTrafficLight(CloudRoadData roadData) { private void handleCloudTrafficLight(CloudRoadData roadData) {
if (isObuLightData) {
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD);
return;
}
if (tvTrafficLight != null && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) { if (tvTrafficLight != null && !handler.hasMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU)) {
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD); handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_CLOUD);
// todo drawTrafficLight // todo drawTrafficLight