obu 完善 同时兼容两种 obu能力

This commit is contained in:
lixiaopeng
2022-11-15 17:36:53 +08:00
parent 3e2b3620ca
commit 30a9c2507c
4 changed files with 1113 additions and 268 deletions

View File

@@ -17,7 +17,7 @@ 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.module.common.drawer.TrafficMarkerDrawer
import com.mogo.module.common.enums.EventTypeEnum
import com.mogo.module.common.enums.EventTypeEnumNew
import com.mogo.module.common.enums.V2iEventTypeEnum
import com.mogo.support.obu.MogoObuManager
import com.mogo.support.obu.OnMogoObuListener
@@ -375,12 +375,12 @@ class MogoPrivateObuNewManager private constructor() {
)
var v2xType = ""
if (data.participant.ptcType == 1) { //摩托车
v2xType = EventTypeEnum.TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType
} else if (data.participant.ptcType == 2) { //行人
v2xType = EventTypeEnum.TYPE_USECASE_ID_VRUCW_PERSON.poiType
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
}
val ttsContent = EventTypeEnum.getWarningTts(v2xType)
val alertContent = EventTypeEnum.getWarningContent(v2xType)
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
val alertContent = EventTypeEnumNew.getWarningContent(v2xType)
var level = -1
val direction = getMessageDirection(data.participant.targetPosition)
if (data.m_warning_msg != null && data.m_warning_msg.warningData != null && data.m_warning_msg.warningData.size > 0) {
@@ -490,7 +490,7 @@ class MogoPrivateObuNewManager private constructor() {
level: Int,
info: MogoObuRvWarningData
) {
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnum 提供的
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
"handleSdkObu appId = $appId --- handleDirection = $direction ---level = $level ---status = $status"
@@ -504,9 +504,9 @@ class MogoPrivateObuNewManager private constructor() {
var changeVisualAngle = false
when (appId) {
// 变道预警,注意左后车辆/注意右后车辆
EventTypeEnum.TYPE_USECASE_ID_LCW.poiType -> {
alertContent = EventTypeEnum.getWarningContent(appId)
ttsContent = EventTypeEnum.getWarningTts(appId)
EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType -> {
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
@@ -525,9 +525,9 @@ class MogoPrivateObuNewManager private constructor() {
}
//车辆失控预警
EventTypeEnum.TYPE_USECASE_ID_CLW.poiType -> {
alertContent = EventTypeEnum.getWarningContent(appId)
ttsContent = EventTypeEnum.getWarningTts(appId)
EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType -> {
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
@@ -539,17 +539,17 @@ class MogoPrivateObuNewManager private constructor() {
// }
//异常车辆提醒
EventTypeEnum.TYPE_USECASE_ID_AVW.poiType -> {
alertContent = EventTypeEnum.getWarningContent(appId)
ttsContent = EventTypeEnum.getWarningTts(appId)
EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType -> {
alertContent = EventTypeEnumNew.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//盲区预警
EventTypeEnum.TYPE_USECASE_ID_BSW.poiType -> {
ttsContent = EventTypeEnum.getWarningTts(appId)
alertContent = EventTypeEnum.getWarningContent(appId)
EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType -> {
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = EventTypeEnumNew.getWarningContent(appId)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
@@ -571,8 +571,8 @@ class MogoPrivateObuNewManager private constructor() {
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
else -> {
ttsContent = EventTypeEnum.getWarningTts(appId)
alertContent = EventTypeEnum.getWarningContent(appId)
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = EventTypeEnumNew.getWarningContent(appId)
}
}
@@ -697,8 +697,8 @@ class MogoPrivateObuNewManager private constructor() {
CallerHmiManager.disableWarningV2X(appId.toString())
}
0x2 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT
ttsContent = EventTypeEnum.getWarningTts(appId.toString())
alertContent = EventTypeEnum.getWarningContent(appId.toString())
ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
CallerHmiManager.showWarningV2X(
appId.toString(), alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(), null, true, 3000L
@@ -751,19 +751,19 @@ class MogoPrivateObuNewManager private constructor() {
"${currentLight.suggestMinSpeed}${currentLight.suggestMaxSpeed}"
ttsContent =
String.format(
EventTypeEnum.getWarningTts(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeedTts
)
alertContent =
String.format(
EventTypeEnum.getWarningContent(EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType),
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed
)
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
CallerHmiManager.showWarningV2X(
EventTypeEnum.TYPE_USECASE_ID_IVP_GREEN.poiType,
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(),