优化弱势交通 开关
This commit is contained in:
@@ -3,6 +3,7 @@ package com.mogo.eagle.core.function.obu.mogo
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.WarningDirectionEnum
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
@@ -273,7 +274,8 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_SLW.poiType
|
||||
}
|
||||
MogoObuConstants.RTE.RTI_TYPE_RETRIGRADE -> { //车辆逆行
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
|
||||
appId =
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_VEHICLE_RETROGRADE.poiType
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +336,8 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_GO_STRAIGHT_TURN_RIGHT -> { //直行或右转
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType
|
||||
appId =
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_GO_STRAIGHT_TURN_RIGHT.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_BUS_WARNING -> { //公交提醒
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_BUS_WARNING.poiType
|
||||
@@ -346,7 +349,8 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_GAS_STATION.poiType
|
||||
}
|
||||
MogoObuConstants.RTS.RTI_TYPE_SCHOOL -> { //学校
|
||||
appId = V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType
|
||||
appId =
|
||||
V2iEventTypeEnum.TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL.poiType
|
||||
}
|
||||
|
||||
MogoObuConstants.RTS.RTI_TYPE_ACCIDENT -> { //事故
|
||||
@@ -361,8 +365,16 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
alertContent = V2iEventTypeEnum.getWarningContent(appId)
|
||||
ttsContent = V2iEventTypeEnum.getWarningTts(appId)
|
||||
|
||||
alertContent = String.format(alertContent, data.warningMsg[0].distance.toString(), data.warningMsg[0].eventRadius.toString())
|
||||
ttsContent = String.format(ttsContent, data.warningMsg[0].distance.toString(), data.warningMsg[0].eventRadius.toString())
|
||||
alertContent = String.format(
|
||||
alertContent,
|
||||
data.warningMsg[0].distance.toString(),
|
||||
data.warningMsg[0].eventRadius.toString()
|
||||
)
|
||||
ttsContent = String.format(
|
||||
ttsContent,
|
||||
data.warningMsg[0].distance.toString(),
|
||||
data.warningMsg[0].eventRadius.toString()
|
||||
)
|
||||
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
@@ -393,7 +405,8 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
)
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it)
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
@@ -418,72 +431,76 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
*/
|
||||
override fun onMogoObuRsmWarning(data: MogoObuRsmWarningData?) {
|
||||
super.onMogoObuRsmWarning(data)
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ------> $data"
|
||||
)
|
||||
Log.d(TAG, "data = ${data.toString()}")
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (data != null && data.participant != null && (data.participant.ptcType == 1 || data.participant.ptcType == 3)) {
|
||||
|
||||
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status}"
|
||||
"onMogoObuRsmWarning ------> $data"
|
||||
)
|
||||
var v2xType = ""
|
||||
if (data.participant.ptcType == 1) { //摩托车
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType
|
||||
} else if (data.participant.ptcType == 2) { //行人
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
|
||||
}
|
||||
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
|
||||
val alertContent = EventTypeEnumNew.getWarningContent(v2xType)
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
|
||||
level = data.warningMsg.warningData[0].warningLevel
|
||||
}
|
||||
|
||||
when (data.status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE// 更新
|
||||
-> {
|
||||
// if (level == 2 || level == 3) { //不考虑level
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
},
|
||||
true,
|
||||
3000L
|
||||
)
|
||||
// }
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(it)
|
||||
}
|
||||
Log.d(TAG, "data = ${data.toString()}")
|
||||
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
|
||||
if (data != null && data.participant != null && (data.participant.ptcType == 1 || data.participant.ptcType == 3)) {
|
||||
CallerLogger.d(
|
||||
"$M_OBU${MogoObuConst.TAG_MOGO_OBU}",
|
||||
"onMogoObuRsmWarning ---status---> ${data.status}"
|
||||
)
|
||||
var v2xType = ""
|
||||
if (data.participant.ptcType == 1) { //摩托车
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTORBIKE.poiType
|
||||
} else if (data.participant.ptcType == 2) { //行人
|
||||
v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType
|
||||
}
|
||||
val ttsContent = EventTypeEnumNew.getWarningTts(v2xType)
|
||||
val alertContent = EventTypeEnumNew.getWarningContent(v2xType)
|
||||
var level = -1
|
||||
val direction = getMessageDirection(data.participant.targetPosition)
|
||||
if (data.warningMsg != null && data.warningMsg.warningData != null && data.warningMsg.warningData.size > 0) {
|
||||
level = data.warningMsg.warningData[0].warningLevel
|
||||
}
|
||||
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficThreatLevelInfo(it)
|
||||
when (data.status) {
|
||||
// 添加
|
||||
MogoObuConstants.STATUS.ADD,
|
||||
MogoObuConstants.STATUS.UPDATE// 更新
|
||||
-> {
|
||||
// if (level == 2 || level == 3) { //不考虑level
|
||||
//显示警告红边
|
||||
CallerHmiManager.showWarning(direction)
|
||||
CallerHmiManager.showWarningV2X(
|
||||
v2xType,
|
||||
alertContent,
|
||||
ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒
|
||||
(v2xType + direction.direction),//使用当前事件类型+方向记录tag,当发生变化的时候关闭当前弹出新的
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
}
|
||||
},
|
||||
true,
|
||||
3000L
|
||||
)
|
||||
// }
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
CallerMapUIServiceManager.getMarkerService()?.updateITrafficInfo(it)
|
||||
}
|
||||
}
|
||||
//TODO
|
||||
|
||||
// 删除
|
||||
MogoObuConstants.STATUS.DELETE -> {
|
||||
// 关闭警告红边
|
||||
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
|
||||
// 更新数据
|
||||
TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(data)?.let {
|
||||
// 事件结束,还原交通参与者颜色
|
||||
it.threatLevel = 0x01
|
||||
CallerMapUIServiceManager.getMarkerService()
|
||||
?.updateITrafficThreatLevelInfo(it)
|
||||
}
|
||||
//TODO
|
||||
// CallerHmiManager.disableWarningV2X(ObuConstants.USE_CASE_ID.VRUCW.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user