[2.13.2] 修改红绿灯优先级显示
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.call.hmi
|
||||
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
@@ -187,6 +188,7 @@ object CallerHmiManager : CallerBase() {
|
||||
* @param lightSource 1:云端下发;2:自车感知;3:OBU
|
||||
*/
|
||||
fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||
Log.d("liyz", "showWarningTrafficLight checkLightId = $checkLightId ---lightSource = $lightSource")
|
||||
waringProviderApi?.showWarningTrafficLight(checkLightId, lightSource)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
object CallerObuTrafficLightListenerManager {
|
||||
|
||||
private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, IMoGoObuTrafficLightListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
var mLight: Int = 0
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun registerObuTrafficLightListener(
|
||||
tag: String,
|
||||
listener: IMoGoObuTrafficLightListener
|
||||
) {
|
||||
if (M_OBU_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
listener.onObuTrafficLight(mLight)
|
||||
M_OBU_TRAFFIC_LIGHT_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun unRegisterObuTrafficLightListener(tag: String) {
|
||||
if (!M_OBU_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_OBU_TRAFFIC_LIGHT_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun unRegisterObuTrafficLightListener(listener: IMoGoObuTrafficLightListener) {
|
||||
if (!M_OBU_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
|
||||
return
|
||||
}
|
||||
M_OBU_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_OBU_TRAFFIC_LIGHT_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeObuTrafficLight(light: Int) {
|
||||
this.mLight = light
|
||||
M_OBU_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onObuTrafficLight(light)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user