[8.1.0]云控基础平台红绿灯增加超时不更新自动隐藏
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user