[dev_arch_opt_3.0] 优化代码
This commit is contained in:
@@ -6,8 +6,6 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.obu.MogoObuConst
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuProvider
|
||||
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.CommonUtils
|
||||
|
||||
@@ -24,13 +22,12 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
get() = TAG
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
MogoObuDcCombineManager.INSTANCE.destoryListener()
|
||||
}
|
||||
|
||||
override fun init(context: Context) {
|
||||
//obu融合数据
|
||||
MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
|
||||
//bus乘客版本obu功能去掉,大理项目需要全部车辆接收,不再限制
|
||||
mContext = context
|
||||
|
||||
@@ -56,19 +56,27 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
}
|
||||
|
||||
override fun onMoGoObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData) {
|
||||
onMogoObuDcRsiWarning(rsiWarningData)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
onMogoObuDcRsiWarning(rsiWarningData)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMoGoObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData) {
|
||||
onMogoObuDcRsmWarning(rsmWarningData)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
onMogoObuDcRsmWarning(rsmWarningData)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMoGoObuSpatWarning(spatWarningData: ObuScene.SpatWarningData) {
|
||||
onMogoObuDcSpatWarning(spatWarningData)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
onMogoObuDcSpatWarning(spatWarningData)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onMoGoObuMapMath(mapMatchData: ObuScene.MapMatchData) {
|
||||
onMogoObuMapMath(mapMatchData)
|
||||
if (HmiBuildConfig.isShowObuV2iView) {
|
||||
onMogoObuMapMath(mapMatchData)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,8 +245,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}"
|
||||
)
|
||||
"MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}")
|
||||
when (status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD -> {
|
||||
@@ -380,33 +387,31 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
|
||||
* 地图匹配 是OBU算法输出地图匹配结果,主车匹配道路哪条路或者哪条车道
|
||||
*/
|
||||
fun onMogoObuMapMath(data: ObuScene.MapMatchData?) {
|
||||
if (HmiBuildConfig.isShowObuLimitSpeedView) {
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
|
||||
Math.round(
|
||||
(data.speedMaxLimit * 0.02 * 3.6)
|
||||
)
|
||||
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
if (data != null) {
|
||||
CallerLogger.d(
|
||||
"${M_OBU}${TAG}",
|
||||
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
|
||||
Math.round(
|
||||
(data.speedMaxLimit * 0.02 * 3.6)
|
||||
)
|
||||
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
|
||||
)
|
||||
when (data.status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
MogoObuConstants.STATUS.UPDATE -> { // 更新
|
||||
}
|
||||
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
MogoObuConstants.STATUS.DELETE -> { // 删除
|
||||
CallerLimitingVelocityListenerManager.invokeUnion(
|
||||
-1,
|
||||
DataSourceType.OBU
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -661,7 +661,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
|
||||
/**
|
||||
* 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示
|
||||
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容 TODO 添加事件频繁播报拦截
|
||||
* @param appId 使用WarningTypeEnum获取icon、提示内容、tts内容
|
||||
* @see com.mogo.module.common.enums.EventTypeEnumNew
|
||||
* EventTypeEnumNew在定义的id为了防止重复,和原始数据是不一样的,有对应关系
|
||||
*/
|
||||
@@ -806,7 +806,6 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
|
||||
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
when (status) {
|
||||
|
||||
Reference in New Issue
Block a user