[2.13.2] 保存对应类型数据,对接消息盒子

This commit is contained in:
lixiaopeng
2023-01-06 15:55:26 +08:00
parent d49694f1f4
commit 3ade6ef883
4 changed files with 106 additions and 1094 deletions

View File

@@ -4,10 +4,15 @@ 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
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.obucombine.IMoGoObuDcCombineListener
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.TrafficDataConvertDcCombineUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -253,7 +258,19 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
MogoObuConstants.STATUS.ADD -> {
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
appId,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.TELEMATIC
}
)
CallerHmiManager.warningV2X(
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
@@ -336,10 +353,21 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
when (rsmWarningData.warningMsg.warningDataList.get(0).status) {
MogoObuConstants.STATUS.ADD -> { // 添加
// if (level == 2 || level == 3) { //不考虑level
//显示警告红边
CallerHmiManager.showWarning(direction)
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
v2xType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.TELEMATIC
}
)
CallerHmiManager.warningV2X(
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
@@ -347,13 +375,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.showWarning(
WarningDirectionEnum.ALERT_WARNING_NON
)
}
},
true,
5000L
)
// }
// 更新数据 TODO
TrafficDataConvertDcCombineUtils.cvxPtcThreatIndInfo2TrafficData(rsmWarningData)?.let {
@@ -522,6 +551,19 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerLogger.d("${M_OBU}${TAG}","MogoObuDcCombineManager changeTrafficLightStatus 闯红灯 --------> ttsContent = $ttsContent ---alertContent = $alertContent ")
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.TELEMATIC
}
)
CallerHmiManager.showWarningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L)
@@ -552,16 +594,28 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
)
val maxSpeed = currentLight.suggestMaxSpeed*3.6
if (maxSpeed > 0) {
CallerHmiManager.showWarningV2X(
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.TELEMATIC
}
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
appId.toString(),
null,
true,
5000L
)
}
}
}

View File

@@ -6,6 +6,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig.isShowObuLimitSpeedView
import com.mogo.eagle.core.data.enums.*
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
@@ -417,13 +418,15 @@ class MogoPrivateObuNewManager private constructor() {
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
MsgBoxType.V2X,
V2XMsg(
appId,
alertContent,
ttsContent
)
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
appId,
@@ -437,7 +440,7 @@ class MogoPrivateObuNewManager private constructor() {
}
},
true,
3000L
5000L
)
// 更新数据
@@ -525,13 +528,15 @@ class MogoPrivateObuNewManager private constructor() {
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
MsgBoxType.V2X,
V2XMsg(
v2xType,
alertContent,
ttsContent
)
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
v2xType,
@@ -759,13 +764,15 @@ class MogoPrivateObuNewManager private constructor() {
//不显示弹框,其它保留
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
MsgBoxType.V2X,
V2XMsg(
appId,
alertContent,
ttsContent
)
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
appId,
@@ -789,7 +796,7 @@ class MogoPrivateObuNewManager private constructor() {
}
},
true,
3000L
5000L
)
//显示警告红边
CallerHmiManager.showWarning(direction)
@@ -873,11 +880,24 @@ class MogoPrivateObuNewManager private constructor() {
isShowRunRedLight = true
CallerHmiManager.disableWarningV2X(0x2.toString())
CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ")
ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(
appId.toString(), alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(), null, true, 5000L)
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L)
}
}
@@ -911,13 +931,15 @@ class MogoPrivateObuNewManager private constructor() {
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OBU,
MsgBoxType.V2X,
V2XMsg(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent
)
)
).apply {
sourceType = DataSourceType.OBU
}
)
CallerHmiManager.warningV2X(

View File

@@ -133,7 +133,7 @@ enum class EventTypeEnumNew(
// 违章停车
ALERT_ILLEGAL_PARK("99992"),
//-------------v2n start ------------>
//-------------obu v2n start ------------>
TYPE_USECASE_ID_FCW(
2000.toString(),
"前向碰撞预警",
@@ -205,10 +205,9 @@ enum class EventTypeEnumNew(
content = "注意特种车辆通行",
tts = "请避让特种车辆"
),
//-------------v2n end ------------>
//-------------obu v2n end ------------>
//---------弱势交通参与者 start ------>
//---------弱势交通参与者 obu and cloud start ------>
TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES(
1001.toString(),
"弱势交通参与者碰撞预警",
@@ -237,8 +236,7 @@ enum class EventTypeEnumNew(
content = "前方有未知障碍物",
tts = "前方有未知障碍物"
),
//---------弱势交通参与者 end -------->
//---------弱势交通参与者 obu and cloud end -------->
//--------------红绿灯 start -------> TODO 修改重复
TYPE_USECASE_ID_IVP_RED(
@@ -258,7 +256,7 @@ enum class EventTypeEnumNew(
),
//-------------红绿灯 end ---------->
//-----------道路危险情况预警 start --------------->
//-----------道路危险情况预警 obu start --------------->
TYPE_USECASE_ID_BREAKDOWN_WARNING( //故障车辆
101.toString(),
"车辆故障",
@@ -308,10 +306,9 @@ enum class EventTypeEnumNew(
content = "您已超速,请减速行驶",
tts = "您已超速,请减速行驶"
),
//------------道路危险情况预警 end ----------->
//------------道路危险情况预警 obu end ----------->
//------------车内标牌 start -------------->
//------------车内标牌 obu start -------------->
TYPE_ID_SHAPR_TURNS(
2.toString(),
"急转弯",
@@ -452,8 +449,7 @@ enum class EventTypeEnumNew(
content = "前方%s米事故",
tts = "前方%s米事故"
),
//------------车内标牌 end -------------->
//------------车内标牌 obu end -------------->
TYPE_ERROR(
0.toString(),