[dev_arch_opt_3.0]
[Change] [ 1、MoGoObuListenerImpl实现数据回调 ] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -51,7 +51,6 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager.invokeAutopilotRotting
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager.invokeAutopilotTrajectory
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
|
||||
@@ -97,8 +97,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
override fun onConnectStatus(connectStatus: Int) {
|
||||
if (connectStatus == 0) { //断开连接
|
||||
mObuStatusInfo.obuStatus = false
|
||||
mObuStatusInfo.obuHvStatus = false
|
||||
mObuStatusInfo.obuRvStatus = false
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
} else if (connectStatus == 1) { //连接成功
|
||||
mObuStatusInfo.obuStatus = true
|
||||
@@ -110,9 +108,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
* HV车辆基础信息 CvxHvCarIndInfo CvxHvInfoIndInfo
|
||||
*/
|
||||
override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) {
|
||||
mObuStatusInfo.obuHvStatus = true
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
|
||||
if (p0 != null && p0.vehBasicsMsg != null) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
@@ -161,8 +156,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
|
||||
super.onMogoObuRvWarning(data)
|
||||
// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关
|
||||
mObuStatusInfo.obuRvStatus = true
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
if (!data.warningMsg.warningData.isNullOrEmpty()) {
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.datacenter.obu.adapter
|
||||
|
||||
import com.mogo.eagle.core.function.call.obu.*
|
||||
import com.mogo.support.obu.OnMogoObuListener
|
||||
import com.mogo.support.obu.constants.Define.ConnectStatus
|
||||
import com.mogo.support.obu.model.*
|
||||
@@ -17,7 +18,15 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onConnectStatus(@ConnectStatus connectStatus: Int) {
|
||||
|
||||
//断开连接
|
||||
if (connectStatus == 0) {
|
||||
CallerObuConnectListenerManager.getObuStatusInfo().obuStatus = false
|
||||
}
|
||||
//连接成功
|
||||
else if (connectStatus == 1) {
|
||||
CallerObuConnectListenerManager.getObuStatusInfo().obuStatus = true
|
||||
}
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener()
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +37,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuHvBasics(data: MogoObuHvBasicsData) {
|
||||
|
||||
CallerObuLocationWGS84ListenerManager.invokeObuLocationWGS84(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -38,7 +47,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
|
||||
|
||||
CallerObuWarningRvListenerManager.invokeObuRvWarning(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,7 +57,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) {
|
||||
|
||||
CallerObuWarningSpatListenerManager.invokeObuSpatWarning(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +67,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) {
|
||||
|
||||
CallerObuWarningRsiListenerManager.invokeObuRsiWarning(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +77,7 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData) {
|
||||
|
||||
CallerObuWarningRsmListenerManager.invokeObuRsmWarning(data)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,6 +87,6 @@ object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuMapMath(data: MogoObuMapMathData) {
|
||||
|
||||
CallerObuMapMathListenerManager.invokeObuMapMath(data)
|
||||
}
|
||||
}
|
||||
@@ -21,16 +21,6 @@ class ObuStatusInfo {
|
||||
*/
|
||||
var obuStatus = false
|
||||
|
||||
/**
|
||||
* false--没有链接,true--链接成功
|
||||
*/
|
||||
var obuHvStatus = false
|
||||
|
||||
/**
|
||||
* false--没有链接,true--链接成功
|
||||
*/
|
||||
var obuRvStatus = false
|
||||
|
||||
/**
|
||||
* Stack information
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.concurrent.ConcurrentHashMap
|
||||
open class CallerBase<T : Any> {
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
val M_LISTENERS: ConcurrentHashMap<String, T> = ConcurrentHashMap()
|
||||
protected val M_LISTENERS: ConcurrentHashMap<String, T> = ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加 监听
|
||||
@@ -21,8 +21,8 @@ open class CallerBase<T : Any> {
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
tag: String,
|
||||
listener: T
|
||||
tag: String,
|
||||
listener: T
|
||||
) {
|
||||
if (M_LISTENERS.containsKey(tag)) {
|
||||
return
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.eagle.core.function.call.obu
|
||||
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.support.obu.model.MogoObuHvBasicsData
|
||||
|
||||
/**
|
||||
* OBU HV 自车车辆基础信息数据,自车定位数据 WGS84 坐标系
|
||||
*/
|
||||
object CallerObuLocationWGS84ListenerManager : CallerBase<IMoGoObuLocationWGS84Listener>() {
|
||||
|
||||
fun invokeObuLocationWGS84(data: MogoObuHvBasicsData) {
|
||||
M_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
listener.onObuLocationWGS84(data)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.mogo.support.obu.model.MogoObuMapMathData
|
||||
/**
|
||||
* OBU 地图匹配结果,车道线、红绿灯、建议最大车速、建议最小车速
|
||||
*/
|
||||
object CallerObuWarningMapListenerManager : CallerBase<IMoGoObuWarningMapListener>() {
|
||||
object CallerObuMapMathListenerManager : CallerBase<IMoGoObuWarningMapListener>() {
|
||||
|
||||
fun invokeObuMapMath(data: MogoObuMapMathData) {
|
||||
M_LISTENERS.forEach {
|
||||
Reference in New Issue
Block a user