[2.13.0-arch-opt] merge

This commit is contained in:
zhongchao
2023-02-02 20:37:41 +08:00
parent d032e77f6e
commit 40e9fdb708
44 changed files with 455 additions and 740 deletions

View File

@@ -2,10 +2,10 @@ package com.mogo.eagle.core.function.datacenter.obu
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.enums.DataSourceType
import com.mogo.eagle.core.data.enums.EventTypeEnumNew
import com.mogo.eagle.core.data.enums.TrafficLightEnum
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
@@ -98,7 +98,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
val status = rsiWarningData.status
val level = rsiWarningData.warningMsgList[0].warningLevel
val direction = getMessageDirection(rsiWarningData.warningMsgList[0].targetPosition)
CallerLogger.d("${M_OBU}${TAG}",
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuDcRsiWarning appId = $appId --status = $status --level = $level -- eventSerialNum = ${rsiWarningData.warningMsgList[0].eventSerialNum} ---signSerialNum = ${rsiWarningData.warningMsgList[0].signSerialNum} --- direction = $direction -- targetPosition = ${rsiWarningData.warningMsgList[0].targetPosition}"
)
@@ -277,15 +278,12 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(appId + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
}
},
true,
5000L
}
)
// 更新数据,是否需要
@@ -302,8 +300,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
MogoObuConstants.STATUS.DELETE -> {
// 关闭警告红边
// CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
// 移除顶部弹窗
CallerHmiManager.disableWarningV2X((appId + direction.direction))
// 更新数据,删除标牌?
// TrafficDataConvertUtilsNew.cvxRtiThreatIndInfo2TrafficData(rsiWarningData)
// ?.let {
@@ -351,7 +347,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
level = rsmWarningData.warningMsg.warningDataList[0].warningLevel
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${rsmWarningData.warningMsg.warningDataList.get(0).status} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
"MogoObuDcCombineManager onMogoObuRsmWarning ---status---> ${rsmWarningData.status} --list status----> ${
rsmWarningData.warningMsg.warningDataList.get(
0
).status
} --v2xType--- $v2xType ---alertContent = $alertContent ---ttsContent= $ttsContent"
)
when (rsmWarningData.warningMsg.warningDataList.get(0).status) {
@@ -374,17 +374,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(v2xType + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(
WarningDirectionEnum.ALERT_WARNING_NON
CallerHmiManager.dismissWarning(
WarningDirectionEnum.ALERT_WARNING_ALL
)
}
},
true,
5000L
}
)
// 更新数据 TODO
@@ -426,7 +423,10 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
* 红绿灯预警信息
*/
fun onMogoObuDcSpatWarning(spatWarningData: SpatWarningData?) {
CallerLogger.d("${M_OBU}${TAG}", "onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}")
CallerLogger.d(
"${M_OBU}${TAG}",
"onMogoObuDcSpatWarning warningType = ${spatWarningData!!.warningType} --status = ${spatWarningData?.status} --lightsList = ${spatWarningData.lightsList}"
)
handlerTrafficLight(
spatWarningData!!.warningType,
spatWarningData?.status,
@@ -438,22 +438,36 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/
fun onMogoObuMapMath(data: MapMatchData?) {
CallerLogger.d("${M_OBU}${TAG}", "MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView)
if(HmiBuildConfig.isShowObuLimitSpeedView) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath HmiBuildConfig.isShowObuLimitSpeedView = " + HmiBuildConfig.isShowObuLimitSpeedView
)
if (HmiBuildConfig.isShowObuLimitSpeedView) {
if (data != null) {
CallerLogger.d("${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit*0.02*3.6))} --- data.speedMaxLimit = ${data.speedMaxLimit}")
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager onMogoObuMapMath = ${data.status} --speedMaxLimit = ${
Math.round(
(data.speedMaxLimit * 0.02 * 3.6)
)
} --- data.speedMaxLimit = ${data.speedMaxLimit}"
)
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加 TODO
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),DataSourceType.OBU)
(data.speedMaxLimit * 0.02 * 3.6).roundToInt().toInt(),
DataSourceType.OBU
)
}
MogoObuConstants.STATUS.UPDATE -> { // 更新
}
MogoObuConstants.STATUS.DELETE -> { // 删除
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(-1 ,DataSourceType.OBU)
CallerLimitingVelocityListenerManager.invokeOnLimitingVelocityChange(
-1,
DataSourceType.OBU
)
}
}
}
@@ -496,7 +510,11 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
/**
* 处理红绿灯
*/
private fun handlerTrafficLight(appId: Int, status: Int, lights: List<ObuWarningEvent.SpatLight>) {
private fun handlerTrafficLight(
appId: Int,
status: Int,
lights: List<ObuWarningEvent.SpatLight>
) {
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager handlerTrafficLight --- status = $status ---lights.size = ${lights.size} ---lights = $lights ---appId = $appId"
@@ -514,7 +532,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗,当收不到信号的时候触发一次
CallerTrafficLightListenerManager.disableTrafficLight()
CallerHmiManager.disableWarningV2X(appId.toString())
isShowGreenWave = false
isShowRunRedLight = false
}
@@ -551,10 +568,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerHmiManager.disableWarningV2X(1667.toString())
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 ")
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,
@@ -569,22 +590,32 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
)
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, null, true, 5000L)
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次
if (!isShowGreenWave) {
isShowGreenWave = true
CallerHmiManager.disableWarningV2X(1666.toString())
CallerLogger.d(
"${M_OBU}${TAG}",
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}")
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
val adviceSpeed =
"${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}"
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
)
}"
val adviceSpeedTts =
"${Math.round(currentLight.suggestMinSpeed*3.6*0.02)} - ${Math.round(currentLight.suggestMaxSpeed*3.6*0.02)}"
"${Math.round(currentLight.suggestMinSpeed * 3.6 * 0.02)} - ${
Math.round(
currentLight.suggestMaxSpeed * 3.6 * 0.02
)
}"
ttsContent =
String.format(
@@ -596,7 +627,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType),
adviceSpeed
)
val maxSpeed = currentLight.suggestMaxSpeed*3.6
val maxSpeed = currentLight.suggestMaxSpeed * 3.6
if (maxSpeed > 0) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
@@ -614,11 +645,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(),
null,
true,
5000L
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
@@ -628,37 +655,46 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
when (currentLight.light) {
// 灯光不可用
0 -> {
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.BLACK, DataSourceType.TELEMATIC)
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.BLACK,
DataSourceType.TELEMATIC
)
}
// 红灯
2, 3 -> {
2, 3 -> { //todo 小鹏
if (!isRedLight) {
CallerHmiManager.disableWarningV2X(appId.toString())
isRedLight = true
}
isGreenLight = false
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.RED, DataSourceType.TELEMATIC)
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.RED,
DataSourceType.TELEMATIC
)
val red = currentLight.countDown / 10
CallerTrafficLightListenerManager.changeCountdownRed(red)
}
// 绿灯
4, 5, 6 -> {
4, 5, 6 -> { //todo 小鹏
if (!isGreenLight) {
CallerHmiManager.disableWarningV2X(appId.toString())
isGreenLight = true
}
isRedLight = false
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.GREEN, DataSourceType.TELEMATIC)
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.GREEN,
DataSourceType.TELEMATIC
)
val green = currentLight.countDown / 10
CallerTrafficLightListenerManager.changeCountdownGreen(green)
}
// 黄灯
7, 8 -> {
CallerHmiManager.disableWarningV2X(appId.toString())
CallerTrafficLightListenerManager.showTrafficLight(TrafficLightEnum.YELLOW, DataSourceType.TELEMATIC)
CallerTrafficLightListenerManager.showTrafficLight(
TrafficLightEnum.YELLOW,
DataSourceType.TELEMATIC
)
val yellow = currentLight.countDown / 10
CallerTrafficLightListenerManager.changeCountdownYellow(yellow)
}

View File

@@ -410,15 +410,12 @@ class MogoPrivateObuNewManager private constructor() {
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(appId + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
}
},
true,
5000L
}
)
// 更新数据
@@ -573,17 +570,14 @@ class MogoPrivateObuNewManager private constructor() {
v2xType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(v2xType + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(
WarningDirectionEnum.ALERT_WARNING_NON
CallerHmiManager.dismissWarning(
WarningDirectionEnum.ALERT_WARNING_ALL
)
}
},
true,
5000L
}
)
}
@@ -844,7 +838,6 @@ private fun handleSdkObu(
appId,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
(appId + direction.direction),//使用当前事件类型+方向记录tag当发生变化的时候关闭当前弹出新的
object : IMoGoWarningStatusListener {
override fun onShow() {
super.onShow()
@@ -855,14 +848,12 @@ private fun handleSdkObu(
override fun onDismiss() {
// 关闭警告红边
CallerHmiManager.showWarning(WarningDirectionEnum.ALERT_WARNING_NON)
CallerHmiManager.dismissWarning(WarningDirectionEnum.ALERT_WARNING_ALL)
if (changeVisualAngle) {
CallerVisualAngleManager.changeVisualAngle(Default())
}
}
},
true,
5000L
}
)
//显示警告红边
CallerHmiManager.showWarning(direction)
@@ -910,7 +901,6 @@ private fun handlerTrafficLight(appId: Int, status: Int, lights: List<SpatLight>
MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
CallerTrafficLightListenerManager.disableTrafficLight()
CallerHmiManager.disableWarningV2X(appId.toString())
isShowGreenWave = false
isShowRunRedLight = false
isYellowLight = false
@@ -956,7 +946,6 @@ private fun changeTrafficLightStatus(
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if (!isShowRunRedLight) {
isShowRunRedLight = true
CallerHmiManager.disableWarningV2X(1667.toString())
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"changeTrafficLightStatus 闯红灯 --------> "
@@ -981,11 +970,7 @@ private fun changeTrafficLightStatus(
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType,
null,
true,
5000L
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
@@ -993,7 +978,6 @@ private fun changeTrafficLightStatus(
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候
if (!isShowGreenWave) {
isShowGreenWave = true
CallerHmiManager.disableWarningV2X(1666.toString())
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
@@ -1038,11 +1022,7 @@ private fun changeTrafficLightStatus(
CallerHmiManager.warningV2X(
EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType,
alertContent,
ttsContent,// 只有第一次才tts防止更新的时候不断的提醒
appId.toString(),
null,
true,
5000L
ttsContent// 只有第一次才tts防止更新的时候不断的提醒
)
}
}
@@ -1056,8 +1036,7 @@ private fun changeTrafficLightStatus(
}
// 红灯
2, 3 -> {
if (!isRedLight) {
CallerHmiManager.disableWarningV2X(appId.toString())
if (!isRedLight) { //todo 小鹏
isRedLight = true
}
isGreenLight = false
@@ -1067,9 +1046,8 @@ private fun changeTrafficLightStatus(
}
// 绿灯
4, 5, 6 -> {
4, 5, 6 -> { //todo 小鹏
if (!isGreenLight) {
CallerHmiManager.disableWarningV2X(appId.toString())
isGreenLight = true
}
isRedLight = false
@@ -1085,7 +1063,6 @@ private fun changeTrafficLightStatus(
}
isRedLight = false
isGreenLight = false
CallerHmiManager.disableWarningV2X(appId.toString())
CallerTrafficLightListenerManager.invokeObuTrafficLightStatus(TrafficLightEnum.YELLOW)
val yellow = currentLight.countDown.toInt()
}