[dev_arch_opt_3.0]
[Change] [ 1、拆分Obu数据回调接口,等待凤坤pb提交后在统一数据调用 ] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -37,9 +37,8 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
//bus乘客版本obu功能去掉
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
//不处理
|
||||
} else {
|
||||
@@ -73,9 +72,8 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
* 通过控制面板设置ip,进行传递
|
||||
*/
|
||||
override fun connect(ipAddress: String) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
|
||||
FunctionBuildConfig.appIdentityMode
|
||||
)
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
//不处理
|
||||
} else {
|
||||
|
||||
@@ -15,13 +15,12 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.Default
|
||||
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager.Scene.TooClose
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
import com.mogo.eagle.core.function.datacenter.obu.utils.TrafficDataConvertUtilsNew
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.support.obu.MogoObuManager
|
||||
import com.mogo.support.obu.OnMogoObuListener
|
||||
@@ -48,9 +47,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private var mObuStatusInfo = CallerObuListenerManager.getObuStatusInfo()
|
||||
|
||||
private var mObuStatusInfo = CallerObuConnectListenerManager.getObuStatusInfo()
|
||||
|
||||
fun connectObu(context: Context, obuIpAddress: String, padIpAddress: String) {
|
||||
MogoObuManager.getInstance().registerMogoObuListener(mogoObuListener)
|
||||
@@ -102,14 +99,10 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
mObuStatusInfo.obuStatus = false
|
||||
mObuStatusInfo.obuHvStatus = false
|
||||
mObuStatusInfo.obuRvStatus = false
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) }
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) }
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
} else if (connectStatus == 1) { //连接成功
|
||||
mObuStatusInfo.obuStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +111,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
override fun onMogoObuHvBasics(p0: MogoObuHvBasicsData?) {
|
||||
mObuStatusInfo.obuHvStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
|
||||
if (p0 != null && p0.vehBasicsMsg != null) {
|
||||
CallerLogger.d(
|
||||
@@ -169,7 +162,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
super.onMogoObuRvWarning(data)
|
||||
// if (HmiBuildConfig.isShowObuV2vView) { //TODO 临时需要关闭v2v开关
|
||||
mObuStatusInfo.obuRvStatus = true
|
||||
CallerObuListenerManager.invokeListener(mObuStatusInfo)
|
||||
CallerObuConnectListenerManager.invokeObuConnectListener(mObuStatusInfo)
|
||||
if (!data.warningMsg.warningData.isNullOrEmpty()) {
|
||||
// 更新数据,远车数据,之前要匹配uuid
|
||||
TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(data)?.let {
|
||||
@@ -192,9 +185,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
appId = data.warningMsg.warningData[0].warningType.toString()
|
||||
status = data.warningMsg.warningData[0].status
|
||||
//拼凑数据
|
||||
if (appId != null) {
|
||||
handleSdkObu(appId, direction, status, level, data)
|
||||
}
|
||||
handleSdkObu(appId, direction, status, level, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,15 +206,11 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) {
|
||||
super.onMogoObuSpatWarning(data)
|
||||
if (data != null) {
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
handlerTrafficLight(
|
||||
data.warningType,
|
||||
data.status,
|
||||
data.lights
|
||||
)
|
||||
// }
|
||||
}
|
||||
handlerTrafficLight(
|
||||
data.warningType,
|
||||
data.status,
|
||||
data.lights
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,7 +219,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) {
|
||||
super.onMogoObuRsiWarning(data)
|
||||
// if (HmiBuildConfig.isShowObuV2iView) {
|
||||
if (data != null && data.warningMsg != null && data.warningMsg.size > 0) {
|
||||
if (data.warningMsg != null && data.warningMsg.size > 0) {
|
||||
var alertContent = ""
|
||||
var ttsContent = ""
|
||||
var appId = data.warningMsg[0].sceneType.toString()
|
||||
@@ -411,7 +398,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
//显示警告红边
|
||||
// CallerHmiManager.showWarning(direction)
|
||||
//不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
@@ -571,7 +558,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
if (alertContent.isEmpty() || ttsContent.isEmpty()) {
|
||||
return
|
||||
}
|
||||
//显示警告红边
|
||||
@@ -650,7 +637,10 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
UiThreadHandler.post {
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1,DataSourceType.OBU)
|
||||
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.eagle.core.function.datacenter.obu.adapter
|
||||
|
||||
import com.mogo.support.obu.OnMogoObuListener
|
||||
import com.mogo.support.obu.constants.Define.ConnectStatus
|
||||
import com.mogo.support.obu.model.*
|
||||
|
||||
/**
|
||||
* 适配 OBU 回调监听分发,这里不做业务,只做数据包装及分发处理
|
||||
* @author dong hong yu
|
||||
*/
|
||||
object MoGoObuListenerImpl : OnMogoObuListener() {
|
||||
|
||||
/**
|
||||
* 连接状态
|
||||
*
|
||||
* @param connectStatus 连接状态
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onConnectStatus(@ConnectStatus connectStatus: Int) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HV车辆基础信息
|
||||
*
|
||||
* @param data 数据
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuHvBasics(data: MogoObuHvBasicsData) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* V2V预警信息
|
||||
*
|
||||
* @param data 数据
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuRvWarning(data: MogoObuRvWarningData) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 红绿灯预警信息
|
||||
*
|
||||
* @param data 数据
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuSpatWarning(data: MogoObuSpatWarningData) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* RSI预警信息
|
||||
*
|
||||
* @param data 数据
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuRsiWarning(data: MogoObuRsiWarningData) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* RSM预警信息
|
||||
*
|
||||
* @param data 数据
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 地图匹配结果
|
||||
*
|
||||
* @param data 数据
|
||||
* @since 1.0.0
|
||||
*/
|
||||
override fun onMogoObuMapMath(data: MogoObuMapMathData) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user