From 5f21dfd6271f54d57ffd70f9aa9505d39852c137 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 18 May 2023 11:25:36 +0800 Subject: [PATCH] [3.2.0] fix traffic --- .../datacenter/v2x/TrafficLightDispatcher.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt index bd745e614b..ad5e57f222 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/v2x/TrafficLightDispatcher.kt @@ -106,13 +106,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight * AI云获取红绿灯状态 */ override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) { + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.SHOW_TRAFFIC_LIGHT, GsonUtils.toJson(trafficLightResult).toByteArray()) + } if (!hasObuLightStatus) { hasAiLightStatus = true CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "onTrafficLightStatus trafficLightResult = $trafficLightResult ") updateTrafficLight(trafficLightResult) - if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - CallerTelematicManager.sendMsgToAllClients(TelematicConstant.SHOW_TRAFFIC_LIGHT, GsonUtils.toJson(trafficLightResult).toByteArray()) - } } } @@ -126,13 +126,13 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight Handler().postDelayed({ hasAiLightStatus = false }, 5000) + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { + CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray()) + } //如果没有OBU灯态则进行隐藏,如果有OBU灯态,则交由OBU管理 if(!hasObuLightStatus){ CallerTrafficLightListenerManager.resetTrafficLightStatus(!hasObuLightStatus) hide() - if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) { - CallerTelematicManager.sendMsgToAllClients(TelematicConstant.HIDE_TRAFFIC_LIGHT, "0".toByteArray()) - } } } }