From 217417f6b19f638ca0cf70992df35b02e5d6d4b4 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 10 Jul 2024 19:51:56 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0]=E5=85=BC=E5=AE=B9=E8=9E=8D=E5=90=88?= =?UTF-8?q?=E7=BA=A2=E7=BB=BF=E7=81=AF=EF=BC=8C=E7=9B=91=E6=B5=8B=E5=88=B0?= =?UTF-8?q?=E4=B8=8D=E5=8F=91=E6=95=B0=E6=8D=AE=E5=90=8E=EF=BC=8C=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E7=BA=A2=E7=BB=BF=E7=81=AF=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacenter/v2x/TrafficLightDispatcher.kt | 26 +++++++++++++++++++ 1 file changed, 26 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 61d7b636a0..5480b51607 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 @@ -174,6 +174,32 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener, IMoGoTrafficLight CallerTrafficLightListenerManager.disableTrafficLight() isPrompted = false }else{ + //倒计时,超时还未更新数据则隐藏红绿灯 + lastLightTime = System.currentTimeMillis() + if (lightCountDownTimer == null){ + UiThreadHandler.post { + lightCountDownTimer = object : CountDownTimer(300000, 1000) { + override fun onTick(millisUntilFinished: Long) { + if ((System.currentTimeMillis() - lastLightTime) > 1500) { + //隐藏红绿灯显示 + hide("倒计时结束隐藏", DataSourceType.TELEMATIC_UNION_V2N) + lightCountDownTimer?.cancel() + lightCountDownTimer = null + } + } + + override fun onFinish() { + //隐藏红绿灯显示 + hide("倒计时结束隐藏", DataSourceType.TELEMATIC_UNION_V2N) + lightCountDownTimer?.cancel() + lightCountDownTimer = null + } + + } + lightCountDownTimer?.start() + } + } + //有下一和下二灯态,则为融合V2N红绿灯数据 onFusionTrafficLight(convert(light.state),light.duration.toInt(), convert(light.nextState),light.nextDuration.toInt(),