[6.5.0]兼容融合红绿灯,监测到不发数据后,隐藏红绿灯视图

This commit is contained in:
xuxinchao
2024-07-10 19:51:56 +08:00
parent ef48aba162
commit 217417f6b1

View File

@@ -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(),