From 7b39c3dc1a712d1fa03eeb3aa84618c74ead8346 Mon Sep 17 00:00:00 2001 From: lixiaopeng Date: Thu, 14 Oct 2021 15:56:19 +0800 Subject: [PATCH] opt --- .../obu/mogo/MogoPrivateObuManager.kt | 16 ++--- .../mogo/module/common/enums/EventTypeEnum.kt | 60 +++++++++---------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt index 6fd8465c73..4782080b25 100644 --- a/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt +++ b/core/function-impl/mogo-core-function-obu-mogo/src/main/java/com/mogo/eagle/core/function/obu/mogo/MogoPrivateObuManager.kt @@ -198,9 +198,10 @@ class MogoPrivateObuManager private constructor() { val level = info.threat_info.threat_level val direction = getMessageDirection(if (info.ext_info != null) info.ext_info.pos_classification else -1) + Logger.d(MogoObuConst.TAG_MOGO_OBU, "onCvxRtiThreatIndInfo direction = $direction -- pos_classification = ${info.ext_info.pos_classification}") Logger.d( MogoObuConst.TAG_MOGO_OBU, - "onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- handleDirection = $direction --rtiType = ${info.ext_info.rti_type}" + "onCvxRtiThreatIndInfo appId = $appId --status = $status --level = $level -- handleDirection = $direction --rtiType = ${info.ext_info.rti_type} --direction = $direction -- pos_classification = ${info.ext_info.pos_classification} " ) when (appId) { // 道路危险情况预警 @@ -296,15 +297,15 @@ class MogoPrivateObuManager private constructor() { } // 前方拥堵提醒 EventTypeEnum.TYPE_USECASE_ID_TJW.poiType -> { - alertContent = EventTypeEnum.getWarningContent(appId) + ttsContent = EventTypeEnum.getWarningContent(appId) if (info.threat_info != null) { if (info.threat_info.distance.toInt() != 0) { - ttsContent = String.format( + alertContent = String.format( EventTypeEnum.getWarningTts(appId), info.threat_info.distance.toInt() ) } else { - ttsContent = "前方道路拥堵,请减速慢行" + alertContent = "前方拥堵,减速慢行" } } } @@ -315,8 +316,9 @@ class MogoPrivateObuManager private constructor() { ObuConstants.STATUS.ADD, ObuConstants.STATUS.UPDATE// 更新 -> { - //显示警告红边 + //显示警告红边 TODO 需要确定是什么值 CallerHmiManager.showWarning(direction) + //显示弹框,语音提示 CallerHmiManager.showWarningV2X( appId.toInt(), @@ -450,7 +452,7 @@ class MogoPrivateObuManager private constructor() { MogoObuConst.TAG_MOGO_OBU, "info.ext_info.speed_limit_max ------> ${info.ext_info.speed_limit_max}" ) - CallerHmiManager.showLimitingVelocity((Math.ceil(((info.ext_info.speed_limit_max * 60 * 60) / 1000) / 10) * 10).toInt()) + CallerHmiManager.showLimitingVelocity((Math.round(((info.ext_info.speed_limit_max * 60 * 60) / 1000) / 10) * 10).toInt()) } } // 删除 @@ -618,7 +620,7 @@ class MogoPrivateObuManager private constructor() { isGreenLight = false CallerHmiManager.showWarningTrafficLight(1) - val red = currentLight.count_down.toInt() + 1 + val red = currentLight.count_down.toInt() CallerHmiManager.changeCountdownRed(red) CallerHmiManager.changeCountdownGreen(0) CallerHmiManager.changeCountdownYellow(0) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt b/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt index 8fe7e747ca..fbbe5bdb39 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/enums/EventTypeEnum.kt @@ -180,22 +180,22 @@ enum class EventTypeEnum( ObuConstants.USE_CASE_ID.EVW.toString(), "紧急车辆提醒", poiTypeSrcVr=R.drawable.icon_warning_v2x_special_vehicle_access, - content="请避让特种车辆", - tts="后方特种车辆请避让" + content="注意特种车辆通行", + tts="请避让特种车辆" ), TYPE_USECASE_ID_VRUCW_PERSON( 0X2B0201.toString(), "弱势交通参与者碰撞预警", poiTypeSrcVr=R.drawable.icon_warning_v2x_pedestrian_crossing, - content="行人碰撞预警", - tts="行人碰撞预警" + content="注意行人", + tts="注意行人" ),//行人/摩托车碰撞预警 TYPE_USECASE_ID_VRUCW_MOTORBIKE( 0X2B0202.toString(), "弱势交通参与者碰撞预警", poiTypeSrcVr=R.drawable.icon_warning_v2x_motorcycle_collision, - content="摩托车碰撞预警", - tts="摩托车碰撞预警" + content="注意摩托车", + tts="注意摩托车" ),//摩托车碰撞预警 TYPE_USECASE_ID_SLW( ObuConstants.USE_CASE_ID.SLW.toString(), @@ -229,8 +229,8 @@ enum class EventTypeEnum( ObuConstants.USE_CASE_ID.TJW.toString(), "前方拥堵提醒", poiTypeSrcVr=R.drawable.icon_warning_v2x_congestion, - content="前方道路拥堵", - tts="前方%d米道路拥堵,请减速慢行" + content="前方%d米道路拥堵", + tts="前方拥堵,减速慢行" ), TYPE_USECASE_ID_IVP( ObuConstants.USE_CASE_ID.IVP.toString(), @@ -243,8 +243,8 @@ enum class EventTypeEnum( 0x2B091.toString(), "绿波通行", poiTypeSrcVr=R.drawable.icon_warning_v2x_traffic_lights_green, - content="绿波通行 %s km/h", - tts="前方路口建议车速 %s 公里每小时" + content="建议车速 %s KM/H", + tts="建议车速 %s KM/H" ), TYPE_USECASE_ID_COC( ObuConstants.USE_CASE_ID.COC.toString(), @@ -257,78 +257,78 @@ enum class EventTypeEnum( 0x2C01.toString(), "前方有轨电车提醒", poiTypeSrcVr=R.drawable.icon_warning_v2x_tramcar, - content="前方有轨电车提醒", - tts="前方有轨电车经过,请注意行驶安全" + content="注意前方有轨电车", + tts="注意前方有轨电车驶过" ), TYPE_USECASE_ID_ROAD_TURN_LEFT_SHARP( 0x2C02.toString(), "前方左转急弯", poiTypeSrcVr=R.drawable.icon_warning_v2x_turn_left_sharp, - content="前方左转急弯", - tts="前方路口左转急弯,请减速慢行", + content="注意前方左转急弯", + tts="前方路口左转急弯,减速慢行", ), TYPE_USECASE_ID_ROAD_TURN_RIGHT_SHARP( 0x2C03.toString(), "前方右转急弯", poiTypeSrcVr=R.drawable.icon_warning_v2x_turn_right_sharp, - content="前方右转急弯", - tts="前方路口右转急弯,请减速慢行" + content="注意前方右转急弯", + tts="前方路口右转急弯,减速慢行" ), TYPE_USECASE_ID_ROAD_PEDESTRIAN_CROSSING( 0x2C04.toString(), "人行横道", poiTypeSrcVr=R.drawable.icon_warning_v2x_pedestrian_crossing, - content="前方人行横道", - tts="前方人行横道" + content="注意前方人行横道", + tts="前方人行横道,减速慢行" ), TYPE_USECASE_ID_ROAD_PEDESTRIAN_SCHOOL( 0x2C05.toString(), "学校", poiTypeSrcVr=R.drawable.icon_warning_v2x_school, - content="前方学校,减速慢行", + content="注意前方学校", tts="前方学校,减速慢行" ), TYPE_USECASE_ID_ROAD_COLLISION_WARNING( 0x2C06.toString(), "事故易发路段", poiTypeSrcVr=R.drawable.icon_warning_v2x_collision_warning, - content="当前路段事故多发", - tts="当前路段事故多发,请谨慎行驶" + content="注意当前路段事故多发", + tts="当前路段事故多发,请小心驾驶" ), TYPE_USECASE_ID_ROAD_ROUNDABOUTPNG( 0x2C07.toString(), "环岛行驶", poiTypeSrcVr=R.drawable.icon_warning_v2x_roundaboutpng, - content="前方驶入环岛", - tts="前方驶入环岛,请谨慎行驶" + content="注意前方驶入环岛", + tts="即将驶入环岛,减速慢行" ), TYPE_USECASE_ID_ROAD_TEST_SECTION( 0x2C08.toString(), "驾校考试路段", poiTypeSrcVr=R.drawable.icon_warning_v2x_test_section, - content="前方考试路段", - tts="前方考试路段,减速慢行" + content="注意前方驾校考试路段", + tts="驾校考试路段,请小心驾驶" ), TYPE_USECASE_ID_ROAD_HUMP_BRIDGE( 0x2C09.toString(), "驼峰桥", poiTypeSrcVr=R.drawable.icon_warning_v2x_hump_bridge, - content="前方驼峰桥", - tts="即将驶入桥梁,请减速慢行" + content="注意前方驼峰桥", + tts="注意即将驶入驼峰桥,请小心驾驶" ), TYPE_USECASE_ID_ROAD_NO_PARKING( 0x2C10.toString(), "禁止停车", poiTypeSrcVr=R.drawable.icon_warning_v2x_no_parking, - content="当前路段禁止停车", + content="注意当前路段禁止停车", tts="当前路段,禁止停车" ), TYPE_USECASE_ID_ROAD_GIVE_WAY( 0x2C11.toString(), "减速慢行", poiTypeSrcVr=R.drawable.icon_warning_v2x_give_way, - content="有车出入,减速慢行", - tts="有车出入,减速慢行" + content="注意路况复杂,减速慢行", + tts="路况复杂,减速慢行" ), TYPE_ERROR( ObuConstants.USE_CASE_ID.ERROR.toString(),