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 85fcf95f78..d273114fcb 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 @@ -4,7 +4,6 @@ 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.config.HmiBuildConfig.isShowObuLimitSpeedView import com.mogo.eagle.core.data.enums.* import com.mogo.eagle.core.data.msgbox.DataSourceType import com.mogo.eagle.core.data.msgbox.MsgBoxBean @@ -525,18 +524,24 @@ class MogoPrivateObuNewManager private constructor() { // 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu if (data != null && data.participant != null) { var v2xType = "" - if (data.participant.ptcType == 1) { //机动车 - v2xType = - EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType - } else if (data.participant.ptcType == 2) { //非机动车 - v2xType = - EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType - } else if (data.participant.ptcType == 3) { //行人 +// if (data.participant.ptcType == 1) { //机动车 +// v2xType = +// EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_MOTOR_VEHICLES.poiType +// } else if (data.participant.ptcType == 2) { //非机动车 +// v2xType = +// EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_NOT_MOTOR_VEHICLES.poiType +// } else if (data.participant.ptcType == 3) { //行人 +// v2xType = +// EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType +// } else { //未知 +// v2xType = EventTypeEnumNew.TYPE_ERROR.poiType +// } + + if (data.participant.ptcType == 3) { //行人 v2xType = EventTypeEnumNew.TYPE_USECASE_ID_VRUCW_PERSON.poiType - } else { //未知 - v2xType = EventTypeEnumNew.TYPE_ERROR.poiType } + val ttsContent = EventTypeEnumNew.getWarningTts(v2xType) val alertContent = EventTypeEnumNew.getWarningContent(v2xType) @@ -959,12 +964,14 @@ class MogoPrivateObuNewManager private constructor() { CallerHmiManager.disableWarningV2X(appId.toString()) isShowGreenWave = false isShowRunRedLight = false + isYellowLight = false } } } private var isRedLight = false private var isGreenLight = false + private var isYellowLight = false private var isShowGreenWave = false private var isShowRunRedLight = false @@ -1030,15 +1037,20 @@ class MogoPrivateObuNewManager private constructor() { if (!isShowGreenWave) { isShowGreenWave = true CallerHmiManager.disableWarningV2X(1666.toString()) - CallerLogger.d( - "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", - "new changeTrafficLightStatus speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed} --TYPE_USECASE_ID_IVP_GREEN ---alertContent = $alertContent ---ttsContent = $ttsContent" - ) - val adviceSpeed = - "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}" - val adviceSpeedTts = - "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}" + var minSpeedTemp = Math.round(currentLight.suggestMinSpeed*3.6) + var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed*3.6) + if (minSpeedTemp == maxSpeedTemp) { + minSpeedTemp -= 5 + } + + val adviceSpeed = "$minSpeedTemp - $maxSpeedTemp" + val adviceSpeedTts = "$minSpeedTemp 到 $maxSpeedTemp" + +// val adviceSpeed = +// "${Math.round(currentLight.suggestMinSpeed*3.6)} - ${Math.round(currentLight.suggestMaxSpeed*3.6)}" +// val adviceSpeedTts = +// "${Math.round(currentLight.suggestMinSpeed*3.6)} 到 ${Math.round(currentLight.suggestMaxSpeed*3.6)}" ttsContent = String.format( @@ -1093,10 +1105,20 @@ class MogoPrivateObuNewManager private constructor() { isRedLight = true } isGreenLight = false + isYellowLight = false // CallerHmiManager.showWarningTrafficLight(1, 3) CallerObuTrafficLightListenerManager.invokeObuTrafficLight(1) val red = currentLight.countDown.toInt() CallerHmiManager.changeCountdownRed(red) + Log.d("lixp", " ------- red --------- = $red ----isGreenLight = $isGreenLight") + if (red == 1) { + //延迟3秒 红 绿 黄 + UiThreadHandler.postDelayed({ + if (!isGreenLight) { //如果3s后,没有变绿灯,删除红绿灯显示 + CallerHmiManager.disableWarningTrafficLight() + } + }, 3000) + } } // 绿灯 @@ -1106,14 +1128,26 @@ class MogoPrivateObuNewManager private constructor() { isGreenLight = true } isRedLight = false + isYellowLight = false // CallerHmiManager.showWarningTrafficLight(3, 3) CallerObuTrafficLightListenerManager.invokeObuTrafficLight(3) val green = currentLight.countDown.toInt() CallerHmiManager.changeCountdownGreen(green) + if (green == 1) { + Log.d("lixp", " ------- green --------- = $green ----isYellowLight = $isYellowLight") + UiThreadHandler.postDelayed({ + if (!isYellowLight) { //如果3s后,没有变黄灯,删除红绿灯显示 + CallerHmiManager.disableWarningTrafficLight() + } + }, 3000) + } } // 黄灯 7, 8 -> { + if (!isYellowLight) { + isYellowLight = true + } CallerHmiManager.disableWarningV2X(appId.toString()) // CallerHmiManager.showWarningTrafficLight(2, 3) CallerObuTrafficLightListenerManager.invokeObuTrafficLight(2)