[2.13.2] 修改事件类型冲突

This commit is contained in:
lixiaopeng
2023-01-11 14:47:18 +08:00
parent c57e9d86e8
commit d760154a89
2 changed files with 6 additions and 19 deletions

View File

@@ -95,7 +95,6 @@ class MogoPrivateObuNewManager private constructor() {
*/
override fun onConnectStatus(connectStatus: Int) {
if (connectStatus == 0) { //断开连接
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnectFail ------> ")
mObuStatusInfo.obuStatus = false
mObuStatusInfo.obuHvStatus = false
mObuStatusInfo.obuRvStatus = false
@@ -104,7 +103,6 @@ class MogoPrivateObuNewManager private constructor() {
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_HV", false) }
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU_RV", false) }
} else if (connectStatus == 1) { //连接成功
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "onConnected ------> ")
mObuStatusInfo.obuStatus = true
CallerObuListenerManager.invokeListener(mObuStatusInfo)
mContext?.let { SharedPrefsMgr.getInstance(it).putBoolean("OBU", true) }
@@ -246,7 +244,7 @@ class MogoPrivateObuNewManager private constructor() {
val direction = getMessageDirection(data.warningMsg[0].targetPosition)
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}"
"onMogoObuRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} --- direction = $direction -- targetPosition = ${data.warningMsg[0].targetPosition}"
)
when (appId) {
@@ -378,7 +376,6 @@ class MogoPrivateObuNewManager private constructor() {
// 拥堵
MogoObuConstants.RSI_SCENE_TYPE.TJW.toString() -> {
appId = EventTypeEnumNew.TYPE_USECASE_ID_TJW.poiType
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format( //事件才有影响范围
@@ -403,16 +400,13 @@ class MogoPrivateObuNewManager private constructor() {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"new onMogoObuRsiWarning ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}"
"new onMogoObuRsiWarning appId = $appId --- ttsContent = $ttsContent --alertContent = $alertContent -- eventSerialNum = ${data.warningMsg[0].eventSerialNum} ---signSerialNum = ${data.warningMsg[0].signSerialNum} ---direction = ${direction.direction} --distance = ${Math.round(data.warningMsg[0].distance)} ---eventRadius = ${Math.round(data.warningMsg[0].eventRadius)} --speedMaxLimit = ${data.warningMsg[0].speedMaxLimit.toInt()}"
)
when (status) {
MogoObuConstants.STATUS.ADD -> { // 添加
//显示警告红边
// CallerHmiManager.showWarning(direction)
//不显示弹框,语音提示,数据在消息盒子里面展示,此处不在处理弹框
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
Log.d("MsgBox-PriObuNewMana1", "alertContent或ttsContent为空!")
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
@@ -451,10 +445,6 @@ class MogoPrivateObuNewManager private constructor() {
}
MogoObuConstants.STATUS.DELETE -> { // 删除
// 关闭警告红边
// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 移除顶部弹窗
// CallerHmiManager.disableWarningV2X((appId + direction.direction))
// 更新数据
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)
?.let {
@@ -507,7 +497,7 @@ class MogoPrivateObuNewManager private constructor() {
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
level = data.warningMsg.warningData[0].warningLevel //默认是1个
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"new onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent "
"onMogoObuRsmWarning ---status---> ${data.status} ---data.warningMsg.warningData[0].status = ${data.warningMsg.warningData[0].status} ---v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent "
)
when (data.warningMsg.warningData[0].status) {
@@ -515,9 +505,6 @@ class MogoPrivateObuNewManager private constructor() {
// if (level == 2 || level == 3) { //不考虑level
//显示警告红边
CallerHmiManager.showWarning(direction)
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
Log.d("MsgBox-PriObuNewMana2", "alertContent或ttsContent为空!")
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
@@ -591,7 +578,7 @@ class MogoPrivateObuNewManager private constructor() {
if (data != null) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuMapMathstatus = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}")
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*3.6))}")
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
UiThreadHandler.post {