合并2.13.2的obu验收相关功能
This commit is contained in:
@@ -144,7 +144,7 @@ object CallerHmiManager {
|
||||
* 展示红绿灯预警
|
||||
*
|
||||
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
* @param lightSource 1:云端下发;2:自车感知;3:OBU
|
||||
*/
|
||||
fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||
waringProviderApi?.showWarningTrafficLight(checkLightId, lightSource)
|
||||
@@ -205,10 +205,11 @@ object CallerHmiManager {
|
||||
* 展示限速预警
|
||||
*
|
||||
* @param limitingSpeed 限速速度
|
||||
* @param limitSpeedSource 限速来源 1:MAP, 2:RSU
|
||||
*/
|
||||
@BizConfig(V2I, "", BIZ_SLW)
|
||||
fun showLimitingVelocity(limitingSpeed: Int) {
|
||||
waringProviderApi?.showLimitingVelocity(limitingSpeed)
|
||||
fun showLimitingVelocity(limitingSpeed: Int, limitSpeedSource: Int) {
|
||||
waringProviderApi?.showLimitingVelocity(limitingSpeed, limitSpeedSource)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
|
||||
object CallerObuTrafficLightListenerManager : CallerBase<IMoGoObuTrafficLightListener>() {
|
||||
|
||||
private val M_OBU_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, IMoGoObuTrafficLightListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
var mLight: Int = 0
|
||||
|
||||
|
||||
fun invokeObuTrafficLight(light: Int) {
|
||||
this.mLight = light
|
||||
M_OBU_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onObuTrafficLight(light)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.mogo.eagle.core.function.call.obucombine
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import mogo.v2x.ObuWarningEvent
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* obu和dc数据通道 回调监听
|
||||
*/
|
||||
object CallerObuDcCombineListenerManager : CallerBase<IMoGoObuDcCombineListener>() {
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_DC_COMBINE_LISTENERS: ConcurrentHashMap<String, IMoGoObuDcCombineListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加 obu和dc数据通道 监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
// fun addListener(
|
||||
// @Nullable tag: String,
|
||||
// @Nullable listener: IMoGoObuDcCombineListener
|
||||
// ) {
|
||||
// if (M_DC_COMBINE_LISTENERS.containsKey(tag)) {
|
||||
// return
|
||||
// }
|
||||
// M_DC_COMBINE_LISTENERS[tag] = listener
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
// fun removeListener(@Nullable tag: String) {
|
||||
// if (!M_DC_COMBINE_LISTENERS.containsKey(tag)) {
|
||||
// return
|
||||
// }
|
||||
// M_DC_COMBINE_LISTENERS.remove(tag)
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
// fun removeListener(@Nullable listener: IMoGoObuDcCombineListener) {
|
||||
// M_DC_COMBINE_LISTENERS.forEach {
|
||||
// if (it.value == listener) {
|
||||
// M_DC_COMBINE_LISTENERS.remove(it.key)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* v2i数据
|
||||
*/
|
||||
fun invokeObuDcData(obuWarningData: ObuWarningEvent.ObuWarningData?){
|
||||
M_DC_COMBINE_LISTENERS.forEach{
|
||||
val listener = it.value
|
||||
listener.onMoGoObuDcCombineData(obuWarningData)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
import com.mogo.eagle.core.function.api.v2x.ObuLimitingSpeedListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* 限速信息监听
|
||||
*/
|
||||
object CallObuLimitingSpeedListenerManager : CallerBase<ObuLimitingSpeedListener>(){
|
||||
|
||||
private const val TAG = "CallObuLimitingSpeedListenerManager"
|
||||
private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, ObuLimitingSpeedListener> =
|
||||
ConcurrentHashMap()
|
||||
private var mObuLimitSpeed = 0
|
||||
|
||||
fun invokeOnObuLimitingSpeedChange(limitingSpeed: Int) {
|
||||
this.mObuLimitSpeed = limitingSpeed
|
||||
M_TRAFFIC_LIGHT_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onObuLimitingSpeedChange(limitingSpeed)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user