去掉提示频繁的限制,数据存储修改
This commit is contained in:
@@ -33,7 +33,7 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
|
||||
override fun init(context: Context) {
|
||||
//obu融合数据
|
||||
// MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
MogoObuDcCombineManager.INSTANCE.init(context)
|
||||
CallerLogger.d("$M_OBU$TAG", "初始化蘑菇自研OBU…… localIp = " + CommonUtils.getLocalIPAddress())
|
||||
//bus乘客版本obu功能去掉
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode) && AppIdentityModeUtils.isPassenger(
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.msgbox.DataSourceType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
@@ -13,7 +14,6 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
import com.mogo.eagle.core.function.call.obucombine.CallerObuDcCombineListenerManager
|
||||
import com.mogo.eagle.core.function.obu.mogo.utils.TrafficDataConvertUtils
|
||||
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.support.obu.constants.MogoObuConstants
|
||||
@@ -89,7 +89,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
)
|
||||
if (rsiWarningData != null && rsiWarningData.warningMsgList != null && rsiWarningData.warningMsgList.size > 0) {
|
||||
var alertContent = ""
|
||||
var ttsContent = "" //TODO 列表还是只有一项吗?
|
||||
var ttsContent = "" //列表只有一项
|
||||
var appId = rsiWarningData.warningMsgList[0].sceneType.toString()
|
||||
val status = rsiWarningData.status
|
||||
val level = rsiWarningData.warningMsgList[0].warningLevel
|
||||
@@ -265,10 +265,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply {
|
||||
// sourceType = DataSourceType.TELEMATIC
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.TELEMATIC
|
||||
}
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
appId,
|
||||
@@ -363,10 +362,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply { //TODO
|
||||
// sourceType = DataSourceType.TELEMATIC
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.TELEMATIC
|
||||
}
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
v2xType,
|
||||
@@ -560,10 +558,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply {
|
||||
// sourceType = DataSourceType.TELEMATIC
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.TELEMATIC
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
@@ -604,10 +601,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply { //TODO
|
||||
// sourceType = DataSourceType.TELEMATIC
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.TELEMATIC
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
|
||||
@@ -2,13 +2,15 @@ package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeHelper
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
@@ -16,18 +18,12 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
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.obu.mogo.utils.TrafficDataConvertUtils
|
||||
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.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.data.enums.EventTypeHelper
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
|
||||
//import com.mogo.service.IMogoServiceApis
|
||||
import com.zhidao.support.obu.MogoObuManager
|
||||
import com.zhidao.support.obu.OnMogoObuListener
|
||||
import com.zhidao.support.obu.constants.ObuConstants
|
||||
@@ -48,14 +44,11 @@ class MogoPrivateObuManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
// private var mMogoServiceApis: IMogoServiceApis? = null
|
||||
private var mContext: Context? = null
|
||||
private var mObuStatusInfo = CallerObuListenerManager.getObuStatusInfo()
|
||||
|
||||
fun init(context: Context, ipAddress: String) {
|
||||
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_OBU}", "obuManager初始化--")
|
||||
// mMogoServiceApis = ARouter.getInstance().build(MogoServicePaths.PATH_SERVICE_APIS)
|
||||
// .navigation(context) as IMogoServiceApis
|
||||
mContext = context
|
||||
//连接obu设备
|
||||
connectObu(context, ipAddress)
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
//import com.mogo.eagle.core.data.msgbox.DataSourceType
|
||||
import com.mogo.eagle.core.data.msgbox.DataSourceType
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxType
|
||||
import com.mogo.eagle.core.data.msgbox.V2XMsg
|
||||
@@ -193,20 +193,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
level = data.warningMsg.warningData[0].warningLevel
|
||||
appId = data.warningMsg.warningData[0].warningType.toString()
|
||||
status = data.warningMsg.warningData[0].status
|
||||
|
||||
//30秒内同一个事件只出现一次
|
||||
if (rvMap.containsKey(appId)) {
|
||||
var oldTime = rvMap[appId]
|
||||
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
||||
if (timeDiff < 30) {
|
||||
return
|
||||
}
|
||||
rvMap.remove(appId)
|
||||
rvMap[appId] = System.currentTimeMillis()
|
||||
} else {
|
||||
rvMap[appId] = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
//拼凑数据
|
||||
if (appId != null) {
|
||||
handleSdkObu(appId, direction, status, level, data)
|
||||
@@ -242,11 +228,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
val rvMap = mutableMapOf<String, Long>()
|
||||
val rsiMap = mutableMapOf<String, Long>()
|
||||
val rsmMap = mutableMapOf<String, Long>()
|
||||
val rsmPtcIdMap = mutableMapOf<String, Long>()
|
||||
|
||||
/**
|
||||
* RSI预警信息 onMogoObuRsiWarning(交通标志预警(前方限速、前方学校等等),交通事件预警(前方拥堵、前方积水等等))
|
||||
*/
|
||||
@@ -317,9 +298,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
MogoObuConstants.RTS.RTI_TYPE_BRIDGE -> { //桥梁
|
||||
appId = EventTypeEnumNew.TYPE_ID_BRIDGE.poiType
|
||||
}
|
||||
// MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人 TODO 暂时去掉
|
||||
// appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType
|
||||
// }
|
||||
MogoObuConstants.RTS.RTI_TYPE_PEDESTRIAN -> { //行人
|
||||
appId = EventTypeEnumNew.TYPE_ID_PEDESTRIAN.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_SLIPPERY_ROAD -> { //路滑
|
||||
appId = EventTypeEnumNew.TYPE_ID_SLIPPERY_ROAD.poiType
|
||||
}
|
||||
@@ -420,19 +401,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
//30秒内同一个事件只出现一次
|
||||
if (rsiMap.containsKey(appId)) {
|
||||
var oldTime = rsiMap[appId]
|
||||
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
||||
if (timeDiff < 30) {
|
||||
return
|
||||
}
|
||||
rsiMap.remove(appId)
|
||||
rsiMap[appId] = System.currentTimeMillis()
|
||||
} else {
|
||||
rsiMap[appId] = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
|
||||
"new onMogoObuRsiWarning appId = $appId ---status = $status --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} ---direction = ${direction.direction} --distance = ${
|
||||
@@ -456,10 +424,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply {
|
||||
// sourceType = DataSourceType.OBU
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
appId,
|
||||
@@ -543,7 +510,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
|
||||
//物体数据绘制 TODO 这里与dc通过工控机有区别
|
||||
//物体数据绘制
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onMogoObuRsmWarning ---- data.status = ${data.status} ---data.participant.ptcId = ${data.participant.ptcId} ---data.participant.ptcType = ${data.participant.ptcType} ---data.warningMsg = ${data.warningMsg} -----data = ${data.toString()}")
|
||||
when (data.status) {
|
||||
@@ -598,19 +565,6 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
when (data.warningMsg.warningData[0].status) {
|
||||
MogoObuConstants.STATUS.ADD -> { // 添加
|
||||
//更新模型的颜色
|
||||
//30秒内同一个事件只出现一次
|
||||
if (rsmMap.containsKey(v2xType)) {
|
||||
var oldTime = rsmMap[v2xType]
|
||||
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
||||
if (timeDiff < 30) {
|
||||
return
|
||||
}
|
||||
rsmMap.remove(v2xType)
|
||||
rsmMap[v2xType] = System.currentTimeMillis()
|
||||
} else {
|
||||
rsmMap[v2xType] = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)
|
||||
?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
@@ -630,10 +584,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply { //TODO
|
||||
// sourceType = DataSourceType.OBU
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
@@ -883,10 +836,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply {
|
||||
// sourceType = DataSourceType.OBU
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
CallerHmiManager.warningV2X(
|
||||
appId,
|
||||
@@ -1021,10 +973,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply {
|
||||
// sourceType = DataSourceType.OBU
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
@@ -1079,10 +1030,9 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
alertContent,
|
||||
ttsContent
|
||||
)
|
||||
)
|
||||
// .apply { //TODO
|
||||
// sourceType = DataSourceType.OBU
|
||||
// }
|
||||
).apply {
|
||||
sourceType = DataSourceType.OBU
|
||||
}
|
||||
)
|
||||
|
||||
CallerHmiManager.warningV2X(
|
||||
|
||||
Reference in New Issue
Block a user