From 29180d8871410ef3ded1fc4d086104aac9726d80 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Fri, 20 Jun 2025 17:18:15 +0800 Subject: [PATCH] =?UTF-8?q?[8.1.0]=E4=BA=91=E6=8E=A7=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=BA=A2=E7=BB=BF=E7=81=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E4=B8=8D=E6=9B=B4=E6=96=B0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacenter/v2x/TrafficLightDispatcher.kt | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) 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 e708991a4f..df48ff67a7 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 @@ -107,6 +107,7 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight @Volatile private var lightCountDownTimer: CountDownTimer? = null private var lastLightTime: Long = System.currentTimeMillis() + private var cloudControlLightTime: Long = System.currentTimeMillis() //云控基础平台红绿灯超时倒计时 private var currentSpeed: Float = 0f private var isPrompted: Boolean = false //是否提示过起步提醒/提前减速,每个路口仅提示一次 @@ -586,6 +587,39 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight hasCloudControlLight = true //展示云控基础平台信号灯信息 CallerTrafficLightListenerManager.showCloudTrafficLight(currentState, currentDuration, nextState, nextDuration) + //倒计时,超时还未更新数据则隐藏红绿灯 + cloudControlLightTime = System.currentTimeMillis() + if (lightCountDownTimer == null){ + UiThreadHandler.post { + lightCountDownTimer = object : CountDownTimer(300000, 500) { + override fun onTick(millisUntilFinished: Long) { + if ((System.currentTimeMillis() - cloudControlLightTime) > 1000) { + //隐藏红绿灯显示 + hide("倒计时结束隐藏", DataSourceType.TELEMATIC_UNION_V2N) + CallerTrafficLightListenerManager.disableTrafficLight() + lightCountDownTimer?.cancel() + lightCountDownTimer = null + hasFusionLightStatus = false + isPrompted = false + isTurnGreen = false + } + } + + override fun onFinish() { + //隐藏红绿灯显示 + hide("倒计时结束隐藏", DataSourceType.TELEMATIC_UNION_V2N) + CallerTrafficLightListenerManager.disableTrafficLight() + lightCountDownTimer?.cancel() + lightCountDownTimer = null + hasFusionLightStatus = false + isPrompted = false + isTurnGreen = false + } + + } + lightCountDownTimer?.start() + } + } }else{ //隐藏云控基础信号红绿灯 CallerTrafficLightListenerManager.disableTrafficLight()