[2.13.2] 优化v2v的显示问题,其他问题优化

This commit is contained in:
lixiaopeng
2023-01-13 20:29:40 +08:00
parent c66faffe5e
commit 0106e7a34e
8 changed files with 92 additions and 58 deletions

View File

@@ -70,7 +70,6 @@ class V2XTrafficLightBroadcastReceiver : BroadcastReceiver() {
* 关闭交通灯
*/
private fun dispatchCloseWaring() {
Log.d("liyz", "receiver dispatchCloseWaring disableWarningTrafficLight ")
CallerHmiManager.disableWarningTrafficLight()
}
}

View File

@@ -510,7 +510,6 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuDcCombineListener
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗,当收不到信号的时候触发一次
Log.d("liyz", "obudc handlerTrafficLight disableWarningTrafficLight() ---> ")
CallerHmiManager.disableWarningTrafficLight()
CallerHmiManager.disableWarningV2X(appId.toString())
isShowGreenWave = false

View File

@@ -691,7 +691,6 @@ class MogoPrivateObuManager private constructor() {
// 删除
ObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
Log.e("liyz", "old obu delete disableWarningTrafficLight() ------>")
CallerHmiManager.disableWarningTrafficLight()
// CallerHmiManager.disableWarningV2X(appId.toString())
}

View File

@@ -195,6 +195,20 @@ class MogoPrivateObuNewManager private constructor() {
level = data.warningMsg.warningData[0].warningLevel
appId = data.warningMsg.warningData[0].warningType.toString()
status = data.warningMsg.warningData[0].status
//15秒内同一个事件只出现一次
if (rvMap.containsKey(appId)) {
var oldTime = rvMap[appId]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 15) {
return
}
rvMap.remove(appId)
rvMap[appId] = System.currentTimeMillis()
} else {
rvMap[appId] = System.currentTimeMillis()
}
//拼凑数据
if (appId != null) {
handleSdkObu(appId, direction, status, level, data)
@@ -230,6 +244,7 @@ class MogoPrivateObuNewManager private constructor() {
}
}
val rvMap = mutableMapOf<String, Long>()
val rsiMap = mutableMapOf<String, Long>()
val rsmMap = mutableMapOf<String, Long>()
@@ -409,17 +424,14 @@ class MogoPrivateObuNewManager private constructor() {
if (rsiMap.containsKey(appId)) {
var oldTime = rsiMap[appId]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
Log.d("lixp", "----1-- timeDiff = $timeDiff --appId = $appId")
if (timeDiff < 15) {
return
}
rsiMap.remove(appId)
rsiMap[appId] = System.currentTimeMillis()
Log.d("lixp", "---- timeDiff-----------2-----------")
} else {
rsiMap[appId] = System.currentTimeMillis()
}
Log.d("lixp", "---- timeDiff-----------3-----------")
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
@@ -531,17 +543,14 @@ class MogoPrivateObuNewManager private constructor() {
if (rsmMap.containsKey(v2xType)) {
var oldTime = rsmMap[v2xType]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
Log.e("lixp", "onMogoObuRsmWarning ------ timeDiff---1----- = $timeDiff --v2xType = $v2xType")
if (timeDiff < 15) {
return
}
rsmMap.remove(v2xType)
rsmMap[v2xType] = System.currentTimeMillis()
Log.e("lixp", "onMogoObuRsmWarning ---- timeDiff---------2---------")
} else {
rsmMap[v2xType] = System.currentTimeMillis()
}
Log.e("lixp", "onMogoObuRsmWarning ---- timeDiff----------3---------")
//物体数据绘制 TODO 这里与dc通过工控机有区别
when (data.status) {
@@ -643,7 +652,6 @@ class MogoPrivateObuNewManager private constructor() {
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuMapMath = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}"
)
Log.d("liyz", "obu onMogoObuMapMath status = ${data.status} --speedMaxLimit = ${Math.round((data.speedMaxLimit * 3.6))}")
when (data.status) {
MogoObuConstants.STATUS.ADD -> { // 添加
UiThreadHandler.post {
@@ -721,51 +729,32 @@ class MogoPrivateObuNewManager private constructor() {
info: MogoObuRvWarningData
) {
// 这里排除需要特殊定制的语音及文案外,其余的都可以使用 EventTypeEnumNew 提供的
var alertContent: String
var ttsContent: String
var alertContent: String = ""
var ttsContent: String = ""
var changeVisualAngle = false
when (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 ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
} else if (
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
}
//交叉路口碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.FCW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_FCW.poiType)
}
//车辆失控预警
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)
//交叉路口碰撞预警
MogoObuConstants.V2X_WARNING_TYPE.ICW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_ICW.poiType)
}
//异常车辆提醒
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)
//左转辅助预警
MogoObuConstants.V2X_WARNING_TYPE.LTA.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LTA.poiType)
}
//盲区预警
EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType -> {
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = EventTypeEnumNew.getWarningContent(appId)
MogoObuConstants.V2X_WARNING_TYPE.BSW.toString() -> {
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_BSW.poiType)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
@@ -784,10 +773,65 @@ class MogoPrivateObuNewManager private constructor() {
alertContent = String.format(alertContent, "")
}
}
// 变道预警,注意左后车辆/注意右后车辆
MogoObuConstants.V2X_WARNING_TYPE.LCW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_LCW.poiType)
if (
direction == WarningDirectionEnum.ALERT_WARNING_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_LEFT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_LEFT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
} else if (
direction == WarningDirectionEnum.ALERT_WARNING_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_TOP_RIGHT ||
direction == WarningDirectionEnum.ALERT_WARNING_BOTTOM_RIGHT
) {
ttsContent = String.format(ttsContent, "")
alertContent = String.format(alertContent, "")
}
}
//逆向超车预警
MogoObuConstants.V2X_WARNING_TYPE.DNPW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_DNPW.poiType)
}
//紧急制动预警
MogoObuConstants.V2X_WARNING_TYPE.EBW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EBW.poiType)
}
//异常车辆提醒
MogoObuConstants.V2X_WARNING_TYPE.AVW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_AVW.poiType)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//车辆失控预警
MogoObuConstants.V2X_WARNING_TYPE.CLW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_CLW.poiType)
alertContent = String.format(alertContent, direction.desc)
ttsContent = String.format(ttsContent, direction.desc)
}
//车辆失控预警
MogoObuConstants.V2X_WARNING_TYPE.EVW.toString() -> {
alertContent = EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
ttsContent = EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_EVW.poiType)
}
// 这里处理固定的提示信息,包括了<紧急车辆提醒>
else -> {
ttsContent = EventTypeEnumNew.getWarningTts(appId)
alertContent = EventTypeEnumNew.getWarningContent(appId)
else -> { //TODO
// ttsContent = EventTypeEnumNew.getWarningTts(appId.toString())
// alertContent = EventTypeEnumNew.getWarningContent(appId.toString())
}
}
@@ -882,7 +926,6 @@ class MogoPrivateObuNewManager private constructor() {
// 删除
MogoObuConstants.STATUS.DELETE -> {
// 移除顶部弹窗
Log.d("liyz","handlerTrafficLight new obu disableWarningTrafficLight() --->")
CallerHmiManager.disableWarningTrafficLight()
CallerHmiManager.disableWarningV2X(appId.toString())
isShowGreenWave = false
@@ -1011,9 +1054,8 @@ class MogoPrivateObuNewManager private constructor() {
when (currentLight.light) {
// 灯光不可用
0 -> {
// CallerHmiManager.showWarningTrafficLight(0, 3) //TODO
// CallerHmiManager.showWarningTrafficLight(0, 3)
CallerObuTrafficLightListenerManager.invokeObuTrafficLight(0)
Log.e("liyz", "currentLight.light = ${currentLight.light} ----0-----")
}
// 红灯
2, 3 -> {

View File

@@ -59,6 +59,6 @@ public class V2XConst {
/**
* V2X预警日志tag
*/
public static final String LOG_NAME_WARN = "liyz";
public static final String LOG_NAME_WARN = "MoGoPersonWarnPolyline";
}

View File

@@ -61,7 +61,6 @@ class TrafficLightHMIManager {
fun hideTrafficLight() {
initView = false
Log.d("liyz", "TrafficLightHMIManager hideTrafficLight disableWarningTrafficLight ")
CallerHmiManager.disableWarningTrafficLight()
}
}