[8.2.8][i18n] CloudControlManager中文抽取

This commit is contained in:
xinfengkun
2025-11-19 16:07:05 +08:00
parent 5689649a83
commit 038d2d6bb6
2 changed files with 185 additions and 74 deletions

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.api.devatools.INDECloudListener
import com.mogo.eagle.core.function.call.devatools.CallerNDECloudManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.zhjt.mogo.adas.common.cloud.AdviceEvwType
import com.zhjt.mogo.adas.common.cloud.AdviceType
import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceAvwInfo
@@ -21,6 +22,7 @@ import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceLaneSpdLmtInfo
import com.zhjt.mogo.adas.data.bean.cloud.info.AstFuncTlmInfo
import com.zhjt.mogo.adas.data.bean.cloud.pojo.AdvicePojo
import com.zhjt.mogo.adas.data.bean.cloud.pojo.AstFuncPojo
import com.zhjt.mogo_core_function_devatools.R
/**
* 云控基础平台信息管理
@@ -56,9 +58,16 @@ object CloudControlManager: INDECloudListener{
val speedMax = adviceGlosaInfo.spdExps[0].spdMax*3.6
val num = adviceGlosaInfo.spdExps[0].numIntersection
val desc = if(num ==0 || num == 255){
"建议车速${speedMin}km/h-${speedMax}km/h"
// "建议车速${speedMin}km/h-${speedMax}km/h"
"${StringUtils.getString(R.string.module_core_suggest_speed1)}${speedMin}km/h-${speedMax}km/h"
}else{
"建议车速${speedMin}km/h-${speedMax}km/h可绿灯通过前方${num}个路口"
// "建议车速${speedMin}km/h-${speedMax}km/h可绿灯通过前方${num}个路口"
"${StringUtils.getString(R.string.module_core_suggest_speed1)}${speedMin}km/h-${speedMax}km/h${
StringUtils.getString(
R.string.module_core_hint_green_wave_pass_intersection,
num
)
}"
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
@@ -101,7 +110,8 @@ object CloudControlManager: INDECloudListener{
MsgBoxType.CLOUD,
CloudControlMsg(EventTypeEnumNew.CLOUD_RED_LIGHT_WARN.poiType,
EventTypeEnumNew.CLOUD_RED_LIGHT_WARN.poiTypeStr,
"存在闯红灯风险"
// "存在闯红灯风险"
StringUtils.getString(R.string.module_core_warning_running_red_light_risk)
)
)
)
@@ -109,9 +119,11 @@ object CloudControlManager: INDECloudListener{
//行驶车道建议
6031,6032->{
if(it.adviceRsiLaneProposalInfo.tagLaneDataNum > 0){
var desc = "推荐车道:"
// var desc = "推荐车道:"
var desc = StringUtils.getString(R.string.module_core_hint_recommended_lane)
it.adviceRsiLaneProposalInfo.tagLaneData.forEach {lane->
desc += "${lane.tagLaneSeq}车道 "
// desc += "第${lane.tagLaneSeq}车道 "
desc += StringUtils.getString(R.string.module_core_lane_sequence_number, lane.tagLaneSeq)
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
@@ -128,7 +140,11 @@ object CloudControlManager: INDECloudListener{
6061->{
//eventLevel 2:拥堵; 3:重拥堵
if(it.adviceRsiTrafficJamInfo.eventLevel ==2 || it.adviceRsiTrafficJamInfo.eventLevel == 3){
val desc = "前方${it.adviceRsiTrafficJamInfo.queueLength}${it.adviceRsiTrafficJamInfo.roadIdNum}车道拥堵"
// val desc = "前方${it.adviceRsiTrafficJamInfo.queueLength}${it.adviceRsiTrafficJamInfo.roadIdNum}车道拥堵"
val desc = StringUtils.getString(
R.string.module_core_front_have_block,
it.adviceRsiTrafficJamInfo.queueLength,
it.adviceRsiTrafficJamInfo.roadIdNum)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -146,9 +162,16 @@ object CloudControlManager: INDECloudListener{
if(it.adviceRsiRoadDangerHintInfo.laneOfEventNum > 0){
var lane = ""
it.adviceRsiRoadDangerHintInfo.laneOfEvent.forEach {
lane += "${it}"
// lane += "第${it}"
lane += "${StringUtils.getString(R.string.module_core_di)}${it}"
}
val desc = "前方${it.eventRadius}米有${getAlterType(it.adviceRsiRoadDangerHintInfo.alterType)},影响${lane}车道通行"
// val desc = "前方${it.eventRadius}米有${getAlterType(it.adviceRsiRoadDangerHintInfo.alterType)},影响${lane}车道通行"
val desc = StringUtils.getString(
R.string.module_core_front_have_alter,
it.eventRadius,
getAlterType(it.adviceRsiRoadDangerHintInfo.alterType),
lane
)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -164,7 +187,11 @@ object CloudControlManager: INDECloudListener{
//超视距弱势交通参与者提醒
6051->{
if(it.adviceRsiOverSightDistanceInfo.valid == 1){
val desc = "前方${it.adviceRsiOverSightDistanceInfo.distance}米有${getWeakType(it.adviceRsiOverSightDistanceInfo.type)}"
// val desc = "前方${it.adviceRsiOverSightDistanceInfo.distance}米有${getWeakType(it.adviceRsiOverSightDistanceInfo.type)}"
val desc = StringUtils.getString(
R.string.module_core_front_have_rsi,
it.adviceRsiOverSightDistanceInfo.distance,
getWeakType(it.adviceRsiOverSightDistanceInfo.type))
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -180,9 +207,11 @@ object CloudControlManager: INDECloudListener{
6041->{
if(it.adviceRsiOtherCarBreakReadWarningInfo.valid == 1){
val desc = if(it.adviceRsiOtherCarBreakReadWarningInfo.d2StopLine == -1.0){
"路口内有他车闯红灯"
// "路口内有他车闯红灯"
StringUtils.getString(R.string.module_core_warning_other_vehicle_running_red_light_in_intersection)
}else{
"路口前有他车闯红灯"
// "路口前有他车闯红灯"
StringUtils.getString(R.string.module_core_warning_other_vehicle_running_red_light_before_intersection)
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
@@ -201,9 +230,11 @@ object CloudControlManager: INDECloudListener{
if(it.adviceRsiAbandonInfo.laneOfEventNum > 0){
var lane = ""
it.adviceRsiAbandonInfo.lanOfEvent.forEach {lan->
lane = "$lane${lan}车道"
// lane = "$lane${lan}车道"
lane = "$lane${lan}${StringUtils.getString(R.string.module_core_lane)}"
}
val desc = "前方${it.adviceRsiAbandonInfo.distance}${lane}存在障碍物,影响${lane}通行"
// val desc = "前方${it.adviceRsiAbandonInfo.distance}${lane}存在障碍物,影响${lane}通行"
val desc = StringUtils.getString(R.string.module_core_front_have_barrier, it.adviceRsiAbandonInfo.distance, lane, lane)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -219,7 +250,8 @@ object CloudControlManager: INDECloudListener{
//能见度预警
6071->{
if(it.adviceRsiVisibilityInfo.valid == 1){
val desc = "当前能见度为${it.adviceRsiVisibilityInfo.visibilityDis}"
// val desc = "当前能见度为${it.adviceRsiVisibilityInfo.visibilityDis}米"
val desc = StringUtils.getString(R.string.module_core_current_visibility_distance, it.adviceRsiVisibilityInfo.visibilityDis)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -246,9 +278,11 @@ object CloudControlManager: INDECloudListener{
//紧急车辆优先通行 TODO 没有具体车道
if(adviceEvwInfo.valid == 1){
val desc = if(adviceEvwInfo.alertRadius == 6553.5){
"前方有${getVehicleType(adviceEvwInfo.type.desc)}"
// "前方有${getVehicleType(adviceEvwInfo.type.desc)}"
StringUtils.getString(R.string.module_core_ahead_has, getVehicleType(adviceEvwInfo.type.desc))
}else{
"后方${adviceEvwInfo.alertRadius}米有${getVehicleType(adviceEvwInfo.type.desc)}"
// "后方${adviceEvwInfo.alertRadius}米有${getVehicleType(adviceEvwInfo.type.desc)}"
StringUtils.getString(R.string.module_core_behind_has, adviceEvwInfo.alertRadius, getVehicleType(adviceEvwInfo.type.desc))
}
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
@@ -273,7 +307,8 @@ object CloudControlManager: INDECloudListener{
) {
//动态限速信息
if(adviceLaneSpdLmtInfo.valid == 1){
val desc = "道路限速${adviceLaneSpdLmtInfo.speedLmt[0].speedLimit}km/h"
// val desc = "道路限速${adviceLaneSpdLmtInfo.speedLmt[0].speedLimit}km/h"
val desc = "${StringUtils.getString(R.string.module_core_road_speed_limit)}${adviceLaneSpdLmtInfo.speedLmt[0].speedLimit}km/h"
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -294,7 +329,8 @@ object CloudControlManager: INDECloudListener{
override fun onNdeCloudAdviceAvw(advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo) {
//异常车辆预警
if(adviceAvwInfo.valid == 1){
val desc = "前方${adviceAvwInfo.distance}${adviceAvwInfo.rsiLaneId}车道存在异常车辆"
// val desc = "前方${adviceAvwInfo.distance}${adviceAvwInfo.rsiLaneId}车道存在异常车辆"
val desc = StringUtils.getString(R.string.module_core_warning_abnormal_vehicle_ahead_lane, adviceAvwInfo.distance, adviceAvwInfo.rsiLaneId)
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.CLOUD,
@@ -322,7 +358,8 @@ object CloudControlManager: INDECloudListener{
AdviceEvwType.FIRE_TRUCK.desc
}
else->{
"应急车辆"
// "应急车辆"
StringUtils.getString(R.string.module_core_emergency_vehicle)
}
}
}
@@ -330,76 +367,100 @@ object CloudControlManager: INDECloudListener{
private fun getAlterType(alterType: Int): String{
return when(alterType){
5501->{
"行人提醒"
// "行人提醒"
StringUtils.getString(R.string.module_core_warning_pedestrian_ahead)
}
5502->{
"非机动车提醒"
// "非机动车提醒"
StringUtils.getString(R.string.module_core_warning_non_motor_vehicle_ahead)
}
5503->{
"紧急制动预警"
// "紧急制动预警"
StringUtils.getString(R.string.module_core_warning_emergency_braking)
}
5504->{
"倒车预警"
// "倒车预警"
StringUtils.getString(R.string.module_core_warning_reverse_alert)
}
5505->{
"逆行预警"
// "逆行预警"
StringUtils.getString(R.string.module_core_warning_opposite_direction_traffic)
}
5506->{
"异常低速预警"
// "异常低速预警"
StringUtils.getString(R.string.module_core_warning_abnormal_low_speed)
}
5507->{
"异常停车预警"
// "异常停车预警"
StringUtils.getString(R.string.module_core_warning_abnormal_parking)
}
5508->{
"超速预"
// "超速预警"
StringUtils.getString(R.string.module_core_warning_speed_exceed_limit)
}
5509->{
"交通拥堵预警"
// "交通拥堵预警"
StringUtils.getString(R.string.module_core_warning_traffic_congestion)
}
5510->{
"特殊车辆预警"
// "特殊车辆预警"
StringUtils.getString(R.string.module_core_warning_special_vehicle_approaching)
}
5511->{
"紧急车辆预警"
// "紧急车辆预警"
StringUtils.getString(R.string.module_core_warning_emergency_vehicle_approaching)
}
5512->{
"车辆状态异常预警"
// "车辆状态异常预警"
StringUtils.getString(R.string.module_core_warning_vehicle_status_abnormal)
}
5513->{
"连续并道预警"
// "连续并道预警"
StringUtils.getString(R.string.module_core_warning_continuous_lane_changing)
}
5514->{
"匝道退回主路预警"
// "匝道退回主路预警"
StringUtils.getString(R.string.module_core_warning_ramp_return_to_main_road)
}
5515->{
"交通管控预警"
// "交通管控预警"
StringUtils.getString(R.string.module_core_warning_traffic_control_implemented)
}
5516->{
"路面低摩阻预警"
// "路面低摩阻预警"
StringUtils.getString(R.string.module_core_warning_road_low_friction)
}
5517->{
"动态车道级限速预警"
// "动态车道级限速预警"
StringUtils.getString(R.string.module_core_warning_dynamic_lane_speed_limit)
}
5518->{
"障碍物提醒"
// "障碍物提醒"
StringUtils.getString(R.string.module_core_warning_obstacle_ahead)
}
5519->{
"红绿灯故障预警"
// "红绿灯故障预警"
StringUtils.getString(R.string.module_core_warning_traffic_light_fault)
}
5520->{
"弱势交通参与者预警"
// "弱势交通参与者预警"
StringUtils.getString(R.string.module_core_warning_vulnerable_road_user_ahead)
}
5521->{
"闯红灯"
// "闯红灯"
StringUtils.getString(R.string.module_core_warning_red_light_run_imminent)
}
5522->{
"机动车压实线变道"
// "机动车压实线变道"
StringUtils.getString(R.string.module_core_notice_solid_line_lane_change)
}
5523->{
"机动车不按导向标识行驶"
// "机动车不按导向标识行驶"
StringUtils.getString(R.string.module_core_notice_incorrect_guide_sign_driving)
}
else->{
"预警"
// "预警"
StringUtils.getString(R.string.module_core_warning)
}
}
}
@@ -410,13 +471,16 @@ object CloudControlManager: INDECloudListener{
private fun getWeakType(type: Int): String{
return when(type){
0->{
"未知"
// "未知"
StringUtils.getString(R.string.module_core_unknown)
}
1->{
"行人"
// "行人"
StringUtils.getString(R.string.module_core_pedestrian)
}
2->{
"非机动车"
// "非机动车"
StringUtils.getString(R.string.module_core_non_motor_vehicle)
}
else->{
""

View File

@@ -386,12 +386,12 @@
<string name="module_core_connected_passenger_sn">连接成功的乘客屏SN为</string>
<string name="module_core_passenger_plate">乘客屏车牌号:</string>
<string name="module_core_mac_address">Mac地址为</string>
<!-- <string name="module_core_authentication_not_enabled">未开启认证</string>-->
<!-- <string name="module_core_certificate_authentication_timeout">证书认证超时</string>-->
<!-- <string name="module_core_successful_verification_ipc_certificate">成功校验域控证书</string>-->
<!-- <string name="module_core_get_root_certificate_failed">获取ROOT证书异常</string>-->
<!-- <string name="module_core_get_ipc_certificate_failed">获取域控证书异常</string>-->
<!-- <string name="module_core_ipc_certificate_verification_failed">域控证书校验失败</string>-->
<!-- <string name="module_core_authentication_not_enabled">未开启认证</string>-->
<!-- <string name="module_core_certificate_authentication_timeout">证书认证超时</string>-->
<!-- <string name="module_core_successful_verification_ipc_certificate">成功校验域控证书</string>-->
<!-- <string name="module_core_get_root_certificate_failed">获取ROOT证书异常</string>-->
<!-- <string name="module_core_get_ipc_certificate_failed">获取域控证书异常</string>-->
<!-- <string name="module_core_ipc_certificate_verification_failed">域控证书校验失败</string>-->
<string name="module_core_msg_box_connection_error">连接异常</string>
<string name="module_core_msg_box_connection_error_desc">域控未连接或主动断开连接</string>
<string name="module_core_msg_box_ipc_connection_error">域控连接异常</string>
@@ -411,27 +411,74 @@
<string name="module_core_hint_red_light_about_to_turn_green">红灯即将变绿</string>
<string name="module_core_fault_stop_takeover">识别故障即将停车,请注意观察,小心接管</string>
<string name="module_core_takeover_restore_vehicle">请接管恢复车辆状态</string>
<string name="module_core_bag_record_success">bag录制成功</string>
<string name="module_core_bag_record_fail">bag录制失败</string>
<string name="module_core_normal">正常</string>
<string name="module_core_error">异常</string>
<string name="module_core_trace_route_calc">寻迹算路</string>
<string name="module_core_cloud_socket">云Socket连接</string>
<string name="module_core_time">时间:</string>
<!-- <string name="module_core_safety_officer">安全员</string>-->
<!-- <string name="module_core_qa_dev">QA、研发</string>-->
<!-- <string name="module_core_product">产品、运营、演示</string>-->
<string name="module_core_custom">自定义</string>
<string name="module_core_selected_bag_count_total">已选%d个包</string>
<string name="module_core_date">%s月%s日</string>
<string name="module_core_update_bag_upload">共计%d个包 (%sG) 已上传%d个包 (%sG) 剩余%d个包 (%sG)</string>
<string name="module_core_custom_a">自定义A</string>
<string name="module_core_reporting">上报中…</string>
<string name="module_core_report">上报</string>
<string name="module_core_artificial">人工</string>
<string name="module_core_gather">采集</string>
<string name="module_core_auto">自动</string>
<string name="module_core_recording_failed">录包失败</string>
<string name="module_core_reported">已上报</string>
<!-- <string name="module_core_bag_record_success">bag录制成功</string>-->
<!-- <string name="module_core_bag_record_fail">bag录制失败</string>-->
<!-- <string name="module_core_normal">正常</string>-->
<!-- <string name="module_core_error">异常</string>-->
<!-- <string name="module_core_trace_route_calc">寻迹算路</string>-->
<!-- <string name="module_core_cloud_socket">云Socket连接</string>-->
<!-- <string name="module_core_time">时间:</string>-->
<!-- <string name="module_core_safety_officer">安全员</string>-->
<!-- <string name="module_core_qa_dev">QA、研发</string>-->
<!-- <string name="module_core_product">产品、运营、演示</string>-->
<!-- <string name="module_core_custom">自定义</string>-->
<!-- <string name="module_core_selected_bag_count_total">已选%d个包共</string>-->
<!-- <string name="module_core_date">%s月%s日</string>-->
<!-- <string name="module_core_update_bag_upload">共计%d个包 (%sG) 已上传%d个包 (%sG) 剩余%d个包 (%sG)</string>-->
<!-- <string name="module_core_custom_a">自定义A</string>-->
<!-- <string name="module_core_reporting">上报中…</string>-->
<!-- <string name="module_core_report">上报</string>-->
<!-- <string name="module_core_artificial">人工</string>-->
<!-- <string name="module_core_gather">采集</string>-->
<!-- <string name="module_core_auto">自动</string>-->
<!-- <string name="module_core_recording_failed">录包失败</string>-->
<!-- <string name="module_core_reported">已上报</string>-->
<string name="module_core_suggest_speed1">建议车速</string>
<string name="module_core_hint_green_wave_pass_intersection">,可绿灯通过前方%d个路口</string>
<string name="module_core_warning_running_red_light_risk">存在闯红灯风险</string>
<string name="module_core_hint_recommended_lane">推荐车道:</string>
<string name="module_core_lane_sequence_number">第%d车道 </string>
<string name="module_core_front_have_block">前方%f米%s车道拥堵</string>
<string name="module_core_di"></string>
<string name="module_core_front_have_alter">前方%f米有%s影响%s车道通行</string>
<string name="module_core_front_have_rsi">前方%f米有%s</string>
<string name="module_core_warning_other_vehicle_running_red_light_in_intersection">路口内有他车闯红灯</string>
<string name="module_core_warning_other_vehicle_running_red_light_before_intersection">路口前有他车闯红灯</string>
<string name="module_core_lane">车道</string>
<string name="module_core_front_have_barrier">前方%f米%s存在障碍物影响%s通行</string>
<string name="module_core_current_visibility_distance">当前能见度为%f米</string>
<string name="module_core_ahead_has">前方有%s</string>
<string name="module_core_behind_has">后方%f米有%s</string>
<string name="module_core_road_speed_limit">道路限速</string>
<string name="module_core_warning_abnormal_vehicle_ahead_lane">前方%f米%d车道存在异常车辆</string>
<string name="module_core_emergency_vehicle">应急车辆</string>
<string name="module_core_warning_pedestrian_ahead">行人提醒</string>
<string name="module_core_warning_non_motor_vehicle_ahead">非机动车提醒</string>
<string name="module_core_warning_emergency_braking">紧急制动预警</string>
<string name="module_core_warning_reverse_alert">倒车预警</string>
<string name="module_core_warning_opposite_direction_traffic">逆行预警</string>
<string name="module_core_warning_abnormal_low_speed">异常低速预警</string>
<string name="module_core_warning_abnormal_parking">异常停车预警</string>
<string name="module_core_warning_speed_exceed_limit">超速预警</string>
<string name="module_core_warning_traffic_congestion">交通拥堵预警</string>
<string name="module_core_warning_special_vehicle_approaching">特殊车辆预警</string>
<string name="module_core_warning_emergency_vehicle_approaching">紧急车辆预警</string>
<string name="module_core_warning_vehicle_status_abnormal">车辆状态异常预警</string>
<string name="module_core_warning_continuous_lane_changing">连续并道预警</string>
<string name="module_core_warning_ramp_return_to_main_road">匝道退回主路预警</string>
<string name="module_core_warning_traffic_control_implemented">交通管控预警</string>
<string name="module_core_warning_road_low_friction">路面低摩阻预警</string>
<string name="module_core_warning_dynamic_lane_speed_limit">动态车道级限速预警</string>
<string name="module_core_warning_obstacle_ahead">障碍物提醒</string>
<string name="module_core_warning_traffic_light_fault">红绿灯故障预警</string>
<string name="module_core_warning_vulnerable_road_user_ahead">弱势交通参与者预警</string>
<string name="module_core_warning_red_light_run_imminent">闯红灯</string>
<string name="module_core_notice_solid_line_lane_change">机动车压实线变道</string>
<string name="module_core_notice_incorrect_guide_sign_driving">机动车不按导向标识行驶</string>
<string name="module_core_warning">预警</string>
<string name="module_core_unknown">未知</string>
<string name="module_core_pedestrian">行人</string>
<string name="module_core_non_motor_vehicle">非机动车</string>
</resources>