From fa19fd065353fa4d6b4d7f98732159e2b93d51e8 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Fri, 31 Mar 2023 12:18:43 +0800 Subject: [PATCH] =?UTF-8?q?[2.15.0]=20=E6=B7=BB=E5=8A=A0=E7=BB=BF=E6=B3=A2?= =?UTF-8?q?=E5=92=8C=E9=97=AF=E7=BA=A2=E7=81=AF=E7=9A=84=E5=BC=80=E5=85=B3?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datacenter/obu/MogoObuDcCombineManager.kt | 148 ++++++++++------- .../obu/MogoPrivateObuNewManager.kt | 154 +++++++++++------- .../function/hmi/ui/setting/SOPSettingView.kt | 16 ++ .../src/main/res/layout/view_sop_setting.xml | 30 +++- .../eagle/core/data/config/HmiBuildConfig.kt | 11 +- 5 files changed, 240 insertions(+), 119 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt index f9495bb505..fa0d050eac 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoObuDcCombineManager.kt @@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningMapListene import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningRsiListener import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningRsmListener import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuWarningSpatListener +import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager import com.mogo.eagle.core.function.call.hmi.CallerHmiManager import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager import com.mogo.eagle.core.function.call.obu.* @@ -38,7 +39,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener private var mContext: Context? = null private val TAG = "MogoObuDcCombineManager" - + private var mLimitSpeed: Int = 0 fun init(context: Context) { mContext = context @@ -238,14 +239,23 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener //限速预警, ADD处理一次 MogoObuConstants.RSI_SCENE_TYPE.SLW.toString() -> { appId = EventTypeEnumNew.TYPE_USECASE_ID_ROAD_SPEED_LIMIT.poiType - alertContent = EventTypeEnumNew.getWarningContent(appId) - ttsContent = EventTypeEnumNew.getWarningTts(appId) + if (mLimitSpeed > 0) { + alertContent = String.format( + EventTypeEnumNew.getWarningContent(appId), + mLimitSpeed + ) + ttsContent = String.format( + EventTypeEnumNew.getWarningTts(appId), + mLimitSpeed + ) + } } } CallerLogger.d( "${M_OBU}${TAG}", - "MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}") + "MogoObuDcCombineManager ttsContent = $ttsContent --alertContent = $alertContent --appId = $appId ---direction = ${direction.direction} --distance = ${rsiWarningData.warningMsgList[0].distance} ---eventRadius = ${rsiWarningData.warningMsgList[0].eventRadius} --speedMaxLimit = ${rsiWarningData.warningMsgList[0].speedMaxLimit}" + ) when (status) { // 添加 MogoObuConstants.STATUS.ADD -> { @@ -342,7 +352,9 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener when (rsmWarningData.warningMsg.warningDataList[0].status) { MogoObuConstants.STATUS.ADD -> { // 添加 //更新模型的颜色 - TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData(rsmWarningData) + TrafficDataConvertUtilsNew.cvxPtcThreatIndInfo2TrafficData( + rsmWarningData + ) ?.let { CallerMapUIServiceManager.getMarkerService() ?.updateITrafficThreatLevelInfo(it) @@ -401,6 +413,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ) when (data.status) { MogoObuConstants.STATUS.ADD -> { // 添加 + mLimitSpeed = (data.speedMaxLimit * 3.6).roundToInt() CallerLimitingVelocityListenerManager.invokeUnion( (data.speedMaxLimit * 3.6).roundToInt(), DataSourceType.OBU @@ -490,6 +503,8 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener ) { var ttsContent = "" var alertContent = "" + var ttsContentNew = "" + var alertContentNew = "" //这里需要根据真实数据确定 index 取值方式 val currentLight = lights[0] CallerLogger.e( @@ -503,61 +518,74 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener } 1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 - if (!isShowRunRedLight) { - isShowRunRedLight = true - 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 " - ) - if (alertContent.isEmpty() || ttsContent.isEmpty()) { - return + if (HmiBuildConfig.isShowRunRedLightView) { + if (!isShowRunRedLight) { + isShowRunRedLight = true + 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 " + ) + if (alertContent.isEmpty() || ttsContent.isEmpty()) { + return + } + saveObuToDcData( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent + ) + showWarning( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent, + WarningDirectionEnum.ALERT_WARNING_NON + ) } - saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent) - showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 - if (!isShowGreenWave) { - isShowGreenWave = true - CallerLogger.d( - "${M_OBU}${TAG}", - "MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" - ) - 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( - EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeedTts + if (HmiBuildConfig.isShowGreenWaveView) { + if (!isShowGreenWave) { + isShowGreenWave = true + CallerLogger.d( + "${M_OBU}${TAG}", + "MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}" ) - alertContent = - String.format( - EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType), - adviceSpeed - ) - val maxSpeed = currentLight.suggestMaxSpeed * 3.6 - if (maxSpeed > 0) { - if (alertContent.isEmpty() || ttsContent.isEmpty()) { - return + var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6) + var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6) + if (minSpeedTemp == maxSpeedTemp) { + minSpeedTemp -= 5 + } + + val maxSpeed = currentLight.suggestMaxSpeed + if (maxSpeed > 0) { + var currentSpeed = + CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed.toDouble() + if (currentSpeed > 0) { + ttsContentNew = + if ((currentSpeed * 3.6).roundToInt() in (minSpeedTemp + 1) until maxSpeedTemp) { + "蘑菇路侧提醒您,推荐保持当前车速通过路口" + } else { + "蘑菇路侧提醒您,推荐保持车速$minSpeedTemp - $maxSpeedTemp KM/H通过路口" + } + alertContentNew = "推荐车速$minSpeedTemp - $maxSpeedTemp KM/H" + } + saveObuToDcData( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContentNew, + ttsContentNew + ) + showWarning( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContentNew, + ttsContentNew, + WarningDirectionEnum.ALERT_WARNING_NON + ) } - saveObuToDcData(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent) - showWarning(EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, alertContent, ttsContent, WarningDirectionEnum.ALERT_WARNING_NON) } } } @@ -606,13 +634,23 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener * 保存obu通过工控机传输的数据到消息盒子 */ private fun saveObuToDcData(type: String, content: String, tts: String) { - CallerObuSaveMessageListenerManager.invokeObuSaveMessage(type, content, tts, DataSourceType.TELEMATIC) + CallerObuSaveMessageListenerManager.invokeObuSaveMessage( + type, + content, + tts, + DataSourceType.TELEMATIC + ) } /** * 消息盒子对应消息的语音播报 */ - private fun showWarning(type: String, content: String, tts: String, direction: WarningDirectionEnum) { + private fun showWarning( + type: String, + content: String, + tts: String, + direction: WarningDirectionEnum + ) { CallerHmiManager.warningV2X(type, content, tts, null, direction, isFromObu = true) } diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt index a67c87c24b..fe420fe949 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/obu/MogoPrivateObuNewManager.kt @@ -101,11 +101,12 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { override fun onUpgradeStatus(status: ObuSoftwareUpgradeStatus?, t: Throwable?) { CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onUpgradeStatus status = $status ") //上传完成就相当于成功了,立即升级,比上电升级,只是多了一个重启 - if (status == ObuSoftwareUpgradeStatus.UPLOAD_FINISH|| status == ObuSoftwareUpgradeStatus.EXEC_UPGRADE_PROGRAM_FINISH - || status == ObuSoftwareUpgradeStatus.CONNECTION_FAILED|| status == ObuSoftwareUpgradeStatus.AUTHENTICATION_FAILED - || status == ObuSoftwareUpgradeStatus.CHANNEL_ABNORMITY|| status == ObuSoftwareUpgradeStatus.UPGRADE_PACKAGE_ERROR + if (status == ObuSoftwareUpgradeStatus.UPLOAD_FINISH || status == ObuSoftwareUpgradeStatus.EXEC_UPGRADE_PROGRAM_FINISH + || status == ObuSoftwareUpgradeStatus.CONNECTION_FAILED || status == ObuSoftwareUpgradeStatus.AUTHENTICATION_FAILED + || status == ObuSoftwareUpgradeStatus.CHANNEL_ABNORMITY || status == ObuSoftwareUpgradeStatus.UPGRADE_PACKAGE_ERROR || status == ObuSoftwareUpgradeStatus.UPGRADE_PACKAGE_CHECK_FAILED || status == ObuSoftwareUpgradeStatus.PACKAGE_UPLOAD_FAILED - || status == ObuSoftwareUpgradeStatus.EXEC_UPGRADE_PROGRAM_FAILED || status == ObuSoftwareUpgradeStatus.UNKNOWN) { + || status == ObuSoftwareUpgradeStatus.EXEC_UPGRADE_PROGRAM_FAILED || status == ObuSoftwareUpgradeStatus.UNKNOWN + ) { deleteObuFile() } @@ -119,7 +120,10 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * 当前的obu版本 */ override fun onCurrentVersion(version: MogoObuSystemBConfigData) { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "onCurrentVersion version = ${version.version}") + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", + "onCurrentVersion version = ${version.version}" + ) if (!version.version.isNullOrEmpty()) { CallerDevaToolsManager.queryObuUpgrade(version.version) } @@ -128,11 +132,14 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { /** * 删除obu相关的文件夹 */ - fun deleteObuFile(){ + fun deleteObuFile() { UiThreadHandler.post { var isDeleteSuccess = FileUtils.delete(Config.downLoadObuPath) var isDeleteUnzipSuccess = FileUtils.delete(Config.downLoadUnzipObuPath) - CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", "deleteObuFile isDeleteSuccess = $isDeleteSuccess ----isDeleteUnzipSuccess = $isDeleteUnzipSuccess") + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", + "deleteObuFile isDeleteSuccess = $isDeleteSuccess ----isDeleteUnzipSuccess = $isDeleteUnzipSuccess" + ) } } @@ -153,8 +160,12 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { * @return 是否调用成功 */ fun uploadObuPack(filePathArray: Array) { - CallerLogger.d("$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", " uploadObuPack filePathArray = $filePathArray") - ObuManager.getInstance().uploadUpgradePackage(MogoObuConst.OBU_DEFAULT_IP, filePathArray,true,this) + CallerLogger.d( + "$M_OBU${MogoObuConst.TAG_UPGRADE_OBU}", + " uploadObuPack filePathArray = $filePathArray" + ) + ObuManager.getInstance() + .uploadUpgradePackage(MogoObuConst.OBU_DEFAULT_IP, filePathArray, true, this) } /** @@ -232,7 +243,8 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { } MogoObuConstants.CALL_FUNCTION.TOPIC_REGIST, MogoObuConstants.CALL_FUNCTION.TOPIC_CANCEL -> { - val str = if (result.function === MogoObuConstants.CALL_FUNCTION.TOPIC_REGIST) "注册" else "取消注册" + val str = + if (result.function === MogoObuConstants.CALL_FUNCTION.TOPIC_REGIST) "注册" else "取消注册" val callRegisterResult = result as MogoObuCallRegisterResult if (callRegisterResult.results != null && !callRegisterResult.results.isEmpty()) { val size = callRegisterResult.results.size @@ -290,10 +302,14 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { data.vehBasicsMsg?.let { TrafficDataConvertUtilsNew.cvxRvInfoIndInfo2TrafficData(it) ?.let { data -> - CallerMapUIServiceManager.getMarkerService()?.updateITrafficLocationInfo(data) + CallerMapUIServiceManager.getMarkerService() + ?.updateITrafficLocationInfo(data) } }.also { - CallerLogger.e("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全") + CallerLogger.e( + "$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", + "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全" + ) } CallerLogger.d("$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}", data.toString()) @@ -504,8 +520,14 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { // alertContent = EventTypeEnumNew.getWarningContent(appId) // ttsContent = EventTypeEnumNew.getWarningTts(appId) if (mLimitSpeed > 0) { - alertContent = String.format(EventTypeEnumNew.getWarningContent(appId), mLimitSpeed) - ttsContent = String.format(EventTypeEnumNew.getWarningTts(appId), mLimitSpeed) + alertContent = String.format( + EventTypeEnumNew.getWarningContent(appId), + mLimitSpeed + ) + ttsContent = String.format( + EventTypeEnumNew.getWarningTts(appId), + mLimitSpeed + ) } } } @@ -891,7 +913,9 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { if (level == 2 || level == 3) { //不显示弹框,其它保留 saveObuData(v2xType, alertContent, ttsContent) - CallerHmiManager.warningV2X(v2xType, alertContent, ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 + CallerHmiManager.warningV2X(v2xType, + alertContent, + ttsContent,// 只有第一次才tts,防止更新的时候不断的提醒 object : IMoGoWarningStatusListener { override fun onShow() { super.onShow() @@ -905,7 +929,10 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { CallerVisualAngleManager.changeAngle(Default()) } } - }, direction, isFromObu = true) + }, + direction, + isFromObu = true + ) } //更新周边车辆进行预警颜色变换,车辆实时移动和变色 ,UUID不需要匹配了 @@ -988,34 +1015,37 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { } 1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次 - if (!isShowRunRedLight) { - isShowRunRedLight = true - ttsContent = - EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) - alertContent = - EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) - saveObuData( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent - ) - showWarning( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, - alertContent, - ttsContent, - WarningDirectionEnum.ALERT_WARNING_NON - ) + if (HmiBuildConfig.isShowRunRedLightView) { + if (!isShowRunRedLight) { + isShowRunRedLight = true + ttsContent = + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + alertContent = + EventTypeEnumNew.getWarningContent(EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType) + saveObuData( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent + ) + showWarning( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_RED.poiType, + alertContent, + ttsContent, + WarningDirectionEnum.ALERT_WARNING_NON + ) + } } } 2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次 100m的时候 - if (!isShowGreenWave) { - isShowGreenWave = true - var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6) - var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6) - if (minSpeedTemp == maxSpeedTemp) { - minSpeedTemp -= 5 - } + if (HmiBuildConfig.isShowGreenWaveView) { + if (!isShowGreenWave) { + isShowGreenWave = true + 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" @@ -1030,29 +1060,31 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener { // adviceSpeed // ) - val maxSpeed = currentLight.suggestMaxSpeed - if (maxSpeed > 0) { - var currentSpeed = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed.toDouble() - if (currentSpeed > 0) { - ttsContentNew = if ((currentSpeed * 3.6).roundToInt() in (minSpeedTemp + 1) until maxSpeedTemp) { - "推荐保持当前车速通过路口" - } else { - "推荐保持车速$minSpeedTemp - $maxSpeedTemp KM/H通过路口" + val maxSpeed = currentLight.suggestMaxSpeed + if (maxSpeed > 0) { + var currentSpeed = + CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed.toDouble() + if (currentSpeed > 0) { + ttsContentNew = + if ((currentSpeed * 3.6).roundToInt() in (minSpeedTemp + 1) until maxSpeedTemp) { + "蘑菇路侧提醒您,推荐保持当前车速通过路口" + } else { + "蘑菇路侧提醒您,推荐保持车速$minSpeedTemp - $maxSpeedTemp KM/H通过路口" + } + alertContentNew = "推荐车速$minSpeedTemp - $maxSpeedTemp KM/H" } - alertContentNew = "推荐车速$minSpeedTemp - $maxSpeedTemp KM/H" + saveObuData( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContentNew, + ttsContentNew + ) + showWarning( + EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, + alertContentNew, + ttsContentNew, + WarningDirectionEnum.ALERT_WARNING_NON + ) } - - saveObuData( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContentNew, - ttsContentNew - ) - showWarning( - EventTypeEnumNew.TYPE_USECASE_ID_IVP_GREEN.poiType, - alertContentNew, - ttsContentNew, - WarningDirectionEnum.ALERT_WARNING_NON - ) } } } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt index 7f60362072..a181ddf9ed 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/SOPSettingView.kt @@ -103,6 +103,22 @@ internal class SOPSettingView @JvmOverloads constructor( HmiBuildConfig.isShowObuV2iView = isChecked } + /** + * obu 闯红灯预警,默认关闭 + */ + tbRunRedLightSop.isChecked = HmiBuildConfig.isShowRunRedLightView + tbRunRedLightSop.setOnCheckedChangeListener { _, isChecked -> + HmiBuildConfig.isShowRunRedLightView = isChecked + } + + /** + * obu 绿波通行,默认关闭 + */ + tbGreenWaveSop.isChecked = HmiBuildConfig.isShowGreenWaveView + tbGreenWaveSop.setOnCheckedChangeListener { _, isChecked -> + HmiBuildConfig.isShowGreenWaveView = isChecked + } + //红绿灯标识 tbTrafficLight.isChecked = HmiBuildConfig.isShowTrafficLightView tbTrafficLight.setOnCheckedChangeListener { _, isChecked -> diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml index 3ccfc31835..79e9b2dd26 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_sop_setting.xml @@ -191,6 +191,34 @@ app:layout_constraintRight_toLeftOf="@id/verticalGuideLine" /> + + + + diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt index 877e7cc4df..ff3d5738af 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/config/HmiBuildConfig.kt @@ -71,11 +71,18 @@ object HmiBuildConfig { var isShowObuV2iView = true /** - * 是否展示obu通过工控机展示的v2i + * 是否展示绿波通行 */ @JvmField @Volatile - var isShowObuToDcV2iView = true + var isShowGreenWaveView = false + + /** + * 是否展示闯红灯预警 + */ + @JvmField + @Volatile + var isShowRunRedLightView = false } \ No newline at end of file