From 32e054da64826d8ec7aa33b5626c22cfbba2e40a Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 8 Dec 2022 14:23:56 +0800 Subject: [PATCH] =?UTF-8?q?[2.13.0=20=E4=BC=98=E5=8C=96=E7=BB=BF=E6=B3=A2?= =?UTF-8?q?=E9=80=9A=E8=A1=8C=E5=92=8C=E9=97=AF=E7=BA=A2=E7=81=AF=E9=A2=84?= =?UTF-8?q?=E8=AD=A6]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../obu/mogo/MogoPrivateObuNewManager.kt | 114 ++++++++++-------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt index 349c1798fe..730f9469b6 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuNewManager.kt @@ -818,12 +818,16 @@ class MogoPrivateObuNewManager private constructor() { // 移除顶部弹窗 CallerHmiManager.disableWarningTrafficLight() CallerHmiManager.disableWarningV2X(appId.toString()) + isShowGreenWave = false + isShowRunRedLight = false } } } private var isRedLight = false private var isGreenLight = false + private var isShowGreenWave = false + private var isShowRunRedLight = false /** * 修改红绿灯 @@ -846,60 +850,66 @@ class MogoPrivateObuNewManager private constructor() { 0x0 -> {//不可用 V2I_RLVW_VIOLATION_TYPE_UNAVAILABLE 无效 } - 0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT TODO 需要约束一个红灯周期只显示一次 -// CallerHmiManager.disableWarningV2X(0x2.toString()) -// CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ") -// ttsContent = EventTypeEnumTrafficLight.getWarningTts(appId.toString()) -// alertContent = EventTypeEnumTrafficLight.getWarningContent(appId.toString()) -// CallerHmiManager.warningV2X( -// appId.toString(), alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 -// appId.toString(), null, true, 5000L) + 0x1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 + if (!isShowRunRedLight) { + isShowRunRedLight = true + CallerHmiManager.disableWarningV2X(0x2.toString()) + CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}","changeTrafficLightStatus 闯红灯 --------> ") + ttsContent = EventTypeEnumTrafficLight.getWarningTts(appId.toString()) + alertContent = EventTypeEnumTrafficLight.getWarningContent(appId.toString()) + CallerHmiManager.warningV2X( + appId.toString(), alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + appId.toString(), null, true, 5000L) + } } - 0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION TODO 需要约束一个绿灯周期只显示一次 -// CallerHmiManager.disableWarningV2X(0x1.toString()) -// CallerLogger.d( -// "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", -// "speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" -// ) -// val adviceSpeed = -// "${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}" -// val adviceSpeedTts = -// "${currentLight.suggestMinSpeed}到${currentLight.suggestMaxSpeed}" -// ttsContent = -// String.format( -// EventTypeEnumTrafficLight.getWarningTts(appId.toString()), -// adviceSpeedTts -// ) -// alertContent = -// String.format( -// EventTypeEnumTrafficLight.getWarningContent(appId.toString()), -// adviceSpeed -// ) -// -// val maxSpeed = currentLight.suggestMaxSpeed -// if (maxSpeed > 0) { -// CallerMsgBoxManager.saveMsgBox( -// MsgBoxBean( -// MsgBoxType.OBU, -// V2XMsg( -// EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, -// alertContent, -// ttsContent -// ) -// ) -// ) -// -// CallerHmiManager.warningV2X( -// EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, -// alertContent, -// ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 -// appId.toString(), -// null, -// true, -// 5000L -// ) -// } + 0x2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 + if (!isShowGreenWave) { + isShowGreenWave = true + CallerHmiManager.disableWarningV2X(0x1.toString()) + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" + ) + val adviceSpeed = + "${currentLight.suggestMinSpeed} - ${currentLight.suggestMaxSpeed}" + val adviceSpeedTts = + "${currentLight.suggestMinSpeed}到${currentLight.suggestMaxSpeed}" + ttsContent = + String.format( + EventTypeEnumTrafficLight.getWarningTts(appId.toString()), + adviceSpeedTts + ) + alertContent = + String.format( + EventTypeEnumTrafficLight.getWarningContent(appId.toString()), + adviceSpeed + ) + + val maxSpeed = currentLight.suggestMaxSpeed + if (maxSpeed > 0) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.OBU, + V2XMsg( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContent, + ttsContent + ) + ) + ) + + CallerHmiManager.warningV2X( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + appId.toString(), + null, + true, + 5000L + ) + } + } } }