From fcbb538919fc738b52cd2d313a2b0a51424564d0 Mon Sep 17 00:00:00 2001 From: xuxinchao Date: Wed, 11 Jun 2025 10:59:25 +0800 Subject: [PATCH] =?UTF-8?q?[8.1.0]=E4=BA=91=E6=8E=A7=E5=9F=BA=E7=A1=80?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=B6=88=E6=81=AF=E6=8E=A5=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autopilot/adapter/MoGoAdasListenerImpl.kt | 7 + .../eagle/core/function/msgbox/DataManager.kt | 13 +- .../DevaToolsProvider.kt | 2 + .../cloudcontrol/CloudControlManager.kt | 427 ++++++++++++++++++ .../hmi/bone/tab/adapter/MsgBoxTabAdapter.kt | 28 ++ .../adapter/DriverMsgBoxBubbleAdapter.kt | 27 ++ .../msgbox/adapter/DriverMsgBoxListAdapter.kt | 27 ++ .../ui/msgbox/adapter/MsgBoxToastAdapter.kt | 26 ++ .../main/res/layout/item_msg_box_cloud.xml | 64 +++ .../main/res/layout/item_msg_bubble_cloud.xml | 64 +++ .../main/res/layout/item_msg_toast_cloud.xml | 43 ++ .../src/main/res/layout/item_tab_cloud.xml | 54 +++ .../eagle/core/data/enums/EventTypeEnumNew.kt | 104 ++++- .../eagle/core/data/msgbox/CloudControlMsg.kt | 23 + .../mogo/eagle/core/data/msgbox/MsgBoxType.kt | 2 +- .../api/devatools/INDECloudListener.kt | 68 +++ .../call/devatools/CallerNDECloudManager.kt | 100 ++++ .../mogo/adas/common/cloud/AdviceType.java | 12 + .../bean/cloud/info/AdviceComRsiInfo.java | 5 + 19 files changed, 1093 insertions(+), 3 deletions(-) create mode 100644 core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/cloudcontrol/CloudControlManager.kt create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_cloud.xml create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_cloud.xml create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_cloud.xml create mode 100644 core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_cloud.xml create mode 100644 core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/CloudControlMsg.kt create mode 100644 core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/INDECloudListener.kt create mode 100644 core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerNDECloudManager.kt diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt index 1d5de869b0..a1dc92b336 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -88,6 +88,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager import com.mogo.eagle.core.function.call.devatools.CallerCaptureImgManager import com.mogo.eagle.core.function.call.devatools.CallerDiskCopyManager +import com.mogo.eagle.core.function.call.devatools.CallerNDECloudManager import com.mogo.eagle.core.function.call.devatools.CallerV2XManager import com.mogo.eagle.core.function.call.devatools.CallerOTAManager import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager @@ -1508,6 +1509,7 @@ class MoGoAdasListenerImpl : OnAdasListener { astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo ) { + CallerNDECloudManager.onNdeCloudAstFuncTlm(astFuncPojo,astFuncTlmInfo) } /** @@ -1522,6 +1524,7 @@ class MoGoAdasListenerImpl : OnAdasListener { advicePojo: AdvicePojo, adviceGlosaInfo: AdviceGlosaInfo ) { + CallerNDECloudManager.onNdeCloudAdviceGlosa(advicePojo,adviceGlosaInfo) } /** @@ -1545,6 +1548,7 @@ class MoGoAdasListenerImpl : OnAdasListener { advicePojo: AdvicePojo, adviceComRsiInfo: AdviceComRsiInfo ) { + CallerNDECloudManager.onNdeCloudAdviceComRsi(advicePojo,adviceComRsiInfo) } /** @@ -1559,6 +1563,7 @@ class MoGoAdasListenerImpl : OnAdasListener { advicePojo: AdvicePojo, adviceEvwInfo: AdviceEvwInfo ) { + CallerNDECloudManager.onNdeCloudAdviceEvw(advicePojo,adviceEvwInfo) } /** @@ -1573,6 +1578,7 @@ class MoGoAdasListenerImpl : OnAdasListener { advicePojo: AdvicePojo, adviceLaneSpdLmtInfo: AdviceLaneSpdLmtInfo ) { + CallerNDECloudManager.onNdeCloudAdviceLaneSpdLmt(advicePojo,adviceLaneSpdLmtInfo) } /** @@ -1587,6 +1593,7 @@ class MoGoAdasListenerImpl : OnAdasListener { advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo ) { + CallerNDECloudManager.onNdeCloudAdviceAvw(advicePojo,adviceAvwInfo) } /** diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt index cf92928ab4..16c19b6505 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/msgbox/DataManager.kt @@ -167,7 +167,7 @@ object DataManager { CallerMsgBoxListenerManager.invokeListener(MsgCategory.SYS_INFO, msg) } - MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION,MsgBoxType.OTA, MsgBoxType.NDE -> { + MsgBoxType.OBU, MsgBoxType.NOTICE, MsgBoxType.OPERATION,MsgBoxType.OTA, MsgBoxType.NDE,MsgBoxType.CLOUD -> { synchronized(this) { notifyList.add(msg) } @@ -381,6 +381,17 @@ object DataManager { } } } + MsgBoxType.CLOUD.ordinal -> { + return@map MsgBoxBean( + MsgBoxType.CLOUD, + GsonUtils.fromJson(json,CloudControlMsg::class.java) + ).apply { + this.timestamp = msgInfo.timeStamp + withContext(Dispatchers.Main) { + cacheNotifyList.add(this@apply) + } + } + } else -> { return@map null diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt index ad36c8db3d..705e8662ea 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/DevaToolsProvider.kt @@ -61,6 +61,7 @@ import com.zhjt.mogo_core_function_devatools.coldstart.ColdStartManager import com.zhjt.mogo_core_function_devatools.driver.video.DriveSeatVideoProviderImpl import com.mogo.eagle.core.function.api.driver.video.IDriveSeatVideoProvider import com.mogo.eagle.core.function.call.hmi.CallerHmiManager +import com.zhjt.mogo_core_function_devatools.cloudcontrol.CloudControlManager import com.zhjt.mogo_core_function_devatools.diskcopy.DiskCopyManager import com.zhjt.mogo_core_function_devatools.env.EnvChangeManager import com.zhjt.mogo_core_function_devatools.exam.ExamControlManager @@ -208,6 +209,7 @@ class DevaToolsProvider : IDevaToolsProvider, IAppStateListener { ColdStartManager.init(mContext!!) OTAUpgradeManager.init(mContext!!) DiskCopyManager.init(mContext!!) + CloudControlManager.init(mContext!!) if (DebugConfig.isDebug()) { SdtManager.init(mContext!!, true, DetectResultImpl()) } diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/cloudcontrol/CloudControlManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/cloudcontrol/CloudControlManager.kt new file mode 100644 index 0000000000..08bf8a366d --- /dev/null +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/cloudcontrol/CloudControlManager.kt @@ -0,0 +1,427 @@ +package com.zhjt.mogo_core_function_devatools.cloudcontrol + +import android.content.Context +import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.enums.EventTypeEnumNew +import com.mogo.eagle.core.data.msgbox.CloudControlMsg +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType +import com.mogo.eagle.core.data.msgbox.V2XMsg +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.zhjt.mogo.adas.common.cloud.AdviceEvwType +import com.zhjt.mogo.adas.common.cloud.AdviceType +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceAvwInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceComRsiInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceEvwInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceGlosaInfo +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 + +/** + * 云控基础平台信息管理 + */ +object CloudControlManager: INDECloudListener{ + + const val TAG = "CloudControlManager" + + fun init(context: Context){ + if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)){ + CallerNDECloudManager.addListener(TAG,this) + } + } + + /** + * NDE下发 信号灯信息 + * @param astFuncPojo 云端辅助功能信息 + * @param astFuncTlmInfo 云端下发信号灯信息 + */ + override fun onNdeCloudAstFuncTlm(astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo) { + + } + + /** + * NDE下发 信号灯路口车速引导功能指令 + * @param advicePojo 实时决策建议 + * @param adviceGlosaInfo 信号灯路口车速引导功能指令 + */ + override fun onNdeCloudAdviceGlosa(advicePojo: AdvicePojo, adviceGlosaInfo: AdviceGlosaInfo) { + //绿波车速引导 + if(adviceGlosaInfo.spdExpNum > 0){ + val speedMin = adviceGlosaInfo.spdExps[0].spdMin*3.6 + 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" + }else{ + "建议车速${speedMin}km/h-${speedMax}km/h,可绿灯通过前方${num}个路口" + } + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_GREEN_WAVE_SPEED.poiType, + EventTypeEnumNew.CLOUD_GREEN_WAVE_SPEED.poiTypeStr, + desc + ) + ) + ) + } + + } + + /** + * NDE下发 通用 RSI 预警指令 + * 包含: + * 闯红灯预警 + * 行驶车道建议 + * 交通拥堵提醒 + * 道路危险状况提示 + * 超视距弱势交通参与者提醒 + * 路口其他车辆闯红灯预警 + * 障碍物(路面遗撒)预警 + * 能见度预警 + * @param advicePojo 实时决策建议 + * @param adviceComRsiInfo 通用RSI预警指令 + */ + override fun onNdeCloudAdviceComRsi( + advicePojo: AdvicePojo, + adviceComRsiInfo: AdviceComRsiInfo + ) { + if(adviceComRsiInfo.rsisNum > 0){ + adviceComRsiInfo.rsis.forEach { + when(it.eventType){ + //闯红灯预警 + 6011->{ + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_RED_LIGHT_WARN.poiType, + EventTypeEnumNew.CLOUD_RED_LIGHT_WARN.poiTypeStr, + "存在闯红灯风险" + ) + ) + ) + } + //行驶车道建议 + 6031,6032->{ + if(it.adviceRsiLaneProposalInfo.tagLaneDataNum > 0){ + var desc = "推荐车道:" + it.adviceRsiLaneProposalInfo.tagLaneData.forEach {lane-> + desc += "第${lane.tagLaneSeq}车道 " + } + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_SUGGEST_DRIVE_LANE.poiType, + EventTypeEnumNew.CLOUD_SUGGEST_DRIVE_LANE.poiTypeStr, + "" + ) + ) + ) + } + } + //交通拥堵提醒 + 6061->{ + //eventLevel 2:拥堵; 3:重拥堵 + if(it.adviceRsiTrafficJamInfo.eventLevel ==2 || it.adviceRsiTrafficJamInfo.eventLevel == 3){ + val desc = "前方${it.adviceRsiTrafficJamInfo.queueLength}米${it.adviceRsiTrafficJamInfo.roadIdNum}车道拥堵" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_TRAFFIC_REMIND.poiType, + EventTypeEnumNew.CLOUD_TRAFFIC_REMIND.poiTypeStr, + desc + ) + ) + ) + } + } + //道路危险状况提示 + 6021,6022->{ + if(it.adviceRsiRoadDangerHintInfo.valid == 1){ + if(it.adviceRsiRoadDangerHintInfo.laneOfEventNum > 0){ + var lane = "" + it.adviceRsiRoadDangerHintInfo.laneOfEvent.forEach { + lane += "第${it}" + } + val desc = "前方${it.eventRadius}米有${getAlterType(it.adviceRsiRoadDangerHintInfo.alterType)},影响${lane}车道通行" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_DANGEROUS_ROAD_WARN.poiType, + EventTypeEnumNew.CLOUD_DANGEROUS_ROAD_WARN.poiTypeStr, + desc + ) + ) + ) + } + } + } + //超视距弱势交通参与者提醒 + 6051->{ + if(it.adviceRsiOverSightDistanceInfo.valid == 1){ + val desc = "前方${it.adviceRsiOverSightDistanceInfo.distance}米有${getWeakType(it.adviceRsiOverSightDistanceInfo.type)}" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_BEYOND_VISUAL_RANGE.poiType, + EventTypeEnumNew.CLOUD_BEYOND_VISUAL_RANGE.poiTypeStr, + desc + ) + ) + ) + } + } + //路口其他车辆闯红灯预警 + 6041->{ + if(it.adviceRsiOtherCarBreakReadWarningInfo.valid == 1){ + val desc = if(it.adviceRsiOtherCarBreakReadWarningInfo.d2StopLine == -1.0){ + "路口内有他车闯红灯" + }else{ + "路口前有他车闯红灯" + } + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN.poiType, + EventTypeEnumNew.CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN.poiTypeStr, + desc + ) + ) + ) + } + } + //障碍物(路面遗撒)预警 + 6081->{ + if(it.adviceRsiAbandonInfo.valid == 1){ + if(it.adviceRsiAbandonInfo.laneOfEventNum > 0){ + var lane = "" + it.adviceRsiAbandonInfo.lanOfEvent.forEach {lan-> + lane = "$lane${lan}车道" + } + val desc = "前方${it.adviceRsiAbandonInfo.distance}米${lane}存在障碍物,影响${lane}通行" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_OBSTACLE_WARN.poiType, + EventTypeEnumNew.CLOUD_OBSTACLE_WARN.poiTypeStr, + desc + ) + ) + ) + } + } + } + //能见度预警 + 6071->{ + if(it.adviceRsiVisibilityInfo.valid == 1){ + val desc = "当前能见度为${it.adviceRsiVisibilityInfo.visibilityDis}米" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_VISIBILITY_WARN.poiType, + EventTypeEnumNew.CLOUD_VISIBILITY_WARN.poiTypeStr, + desc + ) + ) + ) + } + } + + } + } + } + } + + /** + * NDE下发 紧急车辆预警指令 + * @param advicePojo 实时决策建议 + * @param adviceEvwInfo 紧急车辆预警指令 + */ + override fun onNdeCloudAdviceEvw(advicePojo: AdvicePojo, adviceEvwInfo: AdviceEvwInfo) { + //紧急车辆优先通行 TODO 没有具体车道 + if(adviceEvwInfo.valid == 1){ + val desc = if(adviceEvwInfo.alertRadius == 6553.5){ + "前方有${getVehicleType(adviceEvwInfo.type.desc)}" + }else{ + "后方${adviceEvwInfo.alertRadius}米有${getVehicleType(adviceEvwInfo.type.desc)}" + } + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_PRIORITY_VEHICLE.poiType, + EventTypeEnumNew.CLOUD_PRIORITY_VEHICLE.poiTypeStr, + desc + ) + ) + ) + } + } + + /** + * NDE下发 动态车道级限速指令 + * @param advicePojo 实时决策建议 + * @param adviceLaneSpdLmtInfo 动态车道级限速指令 + */ + override fun onNdeCloudAdviceLaneSpdLmt( + advicePojo: AdvicePojo, + adviceLaneSpdLmtInfo: AdviceLaneSpdLmtInfo + ) { + //动态限速信息 + if(adviceLaneSpdLmtInfo.valid == 1){ + val desc = "道路限速${adviceLaneSpdLmtInfo.speedLmt[0].speedLimit}km/h" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_LIMIT_SPEED.poiType, + EventTypeEnumNew.CLOUD_LIMIT_SPEED.poiTypeStr, + desc + ) + ) + ) + } + } + + /** + * NDE下发 异常车辆预警指令 + * @param advicePojo 实时决策建议 + * @param adviceAvwInfo 异常车辆预警指令 + */ + override fun onNdeCloudAdviceAvw(advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo) { + //异常车辆预警 + if(adviceAvwInfo.valid == 1){ + val desc = "前方${adviceAvwInfo.distance}米${adviceAvwInfo.rsiLaneId}车道存在异常车辆" + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.CLOUD, + CloudControlMsg(EventTypeEnumNew.CLOUD_ABNORMAL_VEHICLE_WARN.poiType, + EventTypeEnumNew.CLOUD_ABNORMAL_VEHICLE_WARN.poiTypeStr, + desc + ) + ) + ) + } + } + + /** + * 获取车辆类型 + */ + private fun getVehicleType(type: String): String{ + return when(type){ + AdviceEvwType.AMBULANCE.desc->{ + AdviceEvwType.AMBULANCE.desc + } + AdviceEvwType.POLICE_CAR.desc->{ + AdviceEvwType.POLICE_CAR.desc + } + AdviceEvwType.FIRE_TRUCK.desc->{ + AdviceEvwType.FIRE_TRUCK.desc + } + else->{ + "应急车辆" + } + } + } + + private fun getAlterType(alterType: Int): String{ + return when(alterType){ + 5501->{ + "行人提醒" + } + 5502->{ + "非机动车提醒" + } + 5503->{ + "紧急制动预警" + } + 5504->{ + "倒车预警" + } + 5505->{ + "逆行预警" + } + 5506->{ + "异常低速预警" + } + 5507->{ + "异常停车预警" + } + 5508->{ + "超速预" + } + 5509->{ + "交通拥堵预警" + } + 5510->{ + "特殊车辆预警" + } + 5511->{ + "紧急车辆预警" + } + 5512->{ + "车辆状态异常预警" + } + 5513->{ + "连续并道预警" + } + 5514->{ + "匝道退回主路预警" + } + 5515->{ + "交通管控预警" + } + 5516->{ + "路面低摩阻预警" + } + 5517->{ + "动态车道级限速预警" + } + 5518->{ + "障碍物提醒" + } + 5519->{ + "红绿灯故障预警" + } + 5520->{ + "弱势交通参与者预警" + } + 5521->{ + "闯红灯" + } + 5522->{ + "机动车压实线变道" + } + 5523->{ + "机动车不按导向标识行驶" + } + else->{ + "预警" + } + } + } + + /** + * 获取弱势交通参与者类型 + */ + private fun getWeakType(type: Int): String{ + return when(type){ + 0->{ + "未知" + } + 1->{ + "行人" + } + 2->{ + "非机动车" + } + else->{ + "" + } + } + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt index 8fcfcba871..abf2243c24 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/bone/tab/adapter/MsgBoxTabAdapter.kt @@ -48,6 +48,7 @@ class MsgBoxTabAdapter(private val activity: Activity) : private val fsm = 21 //fsm消息 private val nde = 22 //NDE消息车龙 private val ota = 23 //OTA升级消息 + private val cloud = 24 //云控基础平台 private val none = -1 @@ -157,6 +158,12 @@ class MsgBoxTabAdapter(private val activity: Activity) : .inflate(R.layout.item_tab_ota,parent,false) return MsgBoxOTA(view) } + //云控基础平台 + cloud -> { + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_tab_cloud,parent,false) + return MsgBoxCloud(view) + } //V2X消息 else -> { val view = LayoutInflater.from(parent.context) @@ -579,6 +586,17 @@ class MsgBoxTabAdapter(private val activity: Activity) : } } } + //云控基础平台 + is MsgBoxCloud->{ + data?.let { + val cloudMsg = it[position].bean as CloudControlMsg + holder.ivCloudImage.setImageDrawable(ResourcesCompat.getDrawable + (activity.resources,EventTypeEnumNew.getUpdateIconRes(cloudMsg.msgType),null)) + holder.tvCloudTitle.text = cloudMsg.title + holder.tvCloudContent.text = cloudMsg.des + holder.tvCloudTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + } + } } } @@ -625,6 +643,8 @@ class MsgBoxTabAdapter(private val activity: Activity) : nde } else if(data!![position].type == MsgBoxType.OTA){ ota + } else if(data!![position].type == MsgBoxType.CLOUD){ + cloud } else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){ v2x } else { @@ -748,4 +768,12 @@ class MsgBoxTabAdapter(private val activity: Activity) : var tvOTAContent: TextView = itemView.findViewById(R.id.tvOTAContent) } + //云控基础平台 + class MsgBoxCloud(itemView: View) : RecyclerView.ViewHolder(itemView){ + var ivCloudImage: ImageView = itemView.findViewById(R.id.ivCloudImage) + var tvCloudTitle: TextView = itemView.findViewById(R.id.tvCloudTitle) + var tvCloudTime: TextView = itemView.findViewById(R.id.tvCloudTime) + var tvCloudContent: TextView = itemView.findViewById(R.id.tvCloudContent) + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt index 2d48f7134e..429e586f26 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxBubbleAdapter.kt @@ -50,6 +50,7 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A private val none: Int = 10 private val nde: Int = 11 private val ota: Int = 12 + private val cloud: Int = 13 //云控基础平台 private var changeViewListener: ChangeViewListener?=null @@ -118,6 +119,11 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_ota,parent,false) return BubbleOTAHolder(view) } + //云控基础平台 + cloud -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_cloud,parent,false) + return BubbleCloudHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_bubble_v2x,parent,false) return BubbleV2XHolder(view) @@ -360,6 +366,17 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A } } } + //云控基础平台消息 + is BubbleCloudHolder -> { + data?.let { + val cloudMsg = it[position].msgBoxBean.bean as CloudControlMsg + holder.ivCloudImage.setImageDrawable(ResourcesCompat.getDrawable + (activity.resources,EventTypeEnumNew.getUpdateIconRes(cloudMsg.msgType),null)) + holder.tvCloudTitle.text = cloudMsg.title + holder.tvCloudContent.text = cloudMsg.des + holder.tvCloudTime.text = TimeUtils.millis2String(it[position].msgBoxBean.timestamp,getHourMinFormat()) + } + } } val msgBoxBean: MsgBoxCountDownBean = data!![position] @@ -419,6 +436,8 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A nde }else if(data!![position].msgBoxBean.type == MsgBoxType.OTA){ ota + }else if(data!![position].msgBoxBean.type == MsgBoxType.CLOUD){ + cloud } else { v2x @@ -526,6 +545,14 @@ class DriverMsgBoxBubbleAdapter(private val activity: Activity) : RecyclerView.A var tvOTAContent: TextView = itemView.findViewById(R.id.tvOTAContent) } + //云控基础平台消息 + class BubbleCloudHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivCloudImage: ImageView = itemView.findViewById(R.id.ivCloudImage) + var tvCloudTitle: TextView = itemView.findViewById(R.id.tvCloudTitle) + var tvCloudTime: TextView = itemView.findViewById(R.id.tvCloudTime) + var tvCloudContent: TextView = itemView.findViewById(R.id.tvCloudContent) + } + fun setChangeListener(listener: ChangeViewListener){ changeViewListener = listener } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt index a70677b04d..c0547a37d3 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/DriverMsgBoxListAdapter.kt @@ -51,6 +51,7 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : private val fsm = 21 //fsm消息 private val nde = 22 //NDE消息 private val ota = 23 //OTA升级消息 + private val cloud = 24 //云控基础平台 private val none = -1 @@ -148,6 +149,12 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : .inflate(R.layout.item_msg_box_ota,parent,false) return MsgBoxOta(view) } + //云控基础平台 + cloud->{ + val view = LayoutInflater.from(parent.context) + .inflate(R.layout.item_msg_box_cloud,parent,false) + return MsgBoxCloud(view) + } else -> { val view = LayoutInflater.from(parent.context) .inflate(R.layout.item_msg_box_v2x, parent, false) @@ -745,6 +752,17 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : } } } + //云控基础平台消息 + is MsgBoxCloud -> { + data?.let { + val cloudMsg = it[position].bean as CloudControlMsg + holder.ivCloudImage.setImageDrawable(ResourcesCompat.getDrawable + (activity.resources,EventTypeEnumNew.getUpdateIconRes(cloudMsg.msgType),null)) + holder.tvCloudTitle.text = cloudMsg.title + holder.tvCloudContent.text = cloudMsg.des + holder.tvCloudTime.text = TimeUtils.millis2String(it[position].timestamp,getHourMinFormat()) + } + } } } @@ -791,6 +809,8 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : nde } else if(data!![position].type == MsgBoxType.OTA){ ota + } else if(data!![position].type == MsgBoxType.CLOUD){ + cloud } else if(data!![position].type == MsgBoxType.V2X || data!![position].type == MsgBoxType.OBU){ v2x } else { @@ -930,4 +950,11 @@ class DriverMsgBoxListAdapter(private val activity: Activity) : var ivOTAImage: ImageView = itemView.findViewById(R.id.ivOTAImage) } + //云控基础平台 + class MsgBoxCloud(itemView: View) : RecyclerView.ViewHolder(itemView){ + var ivCloudImage: ImageView = itemView.findViewById(R.id.ivCloudImage) + var tvCloudTitle: TextView = itemView.findViewById(R.id.tvCloudTitle) + var tvCloudTime: TextView = itemView.findViewById(R.id.tvCloudTime) + var tvCloudContent: TextView = itemView.findViewById(R.id.tvCloudContent) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt index f56e3a49af..8962580cfc 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/msgbox/adapter/MsgBoxToastAdapter.kt @@ -17,6 +17,7 @@ import com.mogo.eagle.core.data.deva.report.ReportEntity import com.mogo.eagle.core.data.enums.DataSourceType import com.mogo.eagle.core.data.enums.EventTypeEnumNew import com.mogo.eagle.core.data.msgbox.AutopilotMsg +import com.mogo.eagle.core.data.msgbox.CloudControlMsg import com.mogo.eagle.core.data.msgbox.FMInfoMsg import com.mogo.eagle.core.data.msgbox.FSMMsg import com.mogo.eagle.core.data.msgbox.MsgBoxCountDownBean @@ -52,6 +53,7 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< private val report: Int = 3 private val nde: Int = 4 private val ota: Int = 5 + private val cloud: Int = 6 fun setData(data: ArrayList){ @@ -80,6 +82,11 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_toast_ota,parent,false) BubbleOTAHolder(view) } + //云控基础平台 + cloud -> { + val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_toast_cloud,parent,false) + BubbleCloudHolder(view) + } else -> { val view = LayoutInflater.from(parent.context).inflate(R.layout.item_msg_toast_v2x,parent,false) BubbleV2XHolder(view) @@ -176,6 +183,16 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< } } } + //云控基础平台消息 + is BubbleCloudHolder->{ + data?.let { + val cloudMsg = it[position].msgBoxBean.bean as CloudControlMsg + holder.ivCloudImage.setImageDrawable(ResourcesCompat.getDrawable + (activity.resources,EventTypeEnumNew.getUpdateIconRes(cloudMsg.msgType),null)) + holder.tvCloudTitle.text = cloudMsg.title + holder.tvCloudContent.text = cloudMsg.des + } + } //V2X消息 is BubbleV2XHolder -> { data?.let { @@ -356,6 +373,9 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< MsgBoxType.OTA ->{ ota } + MsgBoxType.CLOUD ->{ + cloud + } else -> { v2x } @@ -408,4 +428,10 @@ class MsgBoxToastAdapter(private val activity: Activity) : RecyclerView.Adapter< var ivOTAImage: ImageView = itemView.findViewById(R.id.ivOTAImage) } + //云控基础平台 + class BubbleCloudHolder(itemView: View): RecyclerView.ViewHolder(itemView){ + var ivCloudImage: ImageView = itemView.findViewById(R.id.ivCloudImage) + var tvCloudTitle: TextView = itemView.findViewById(R.id.tvCloudTitle) + var tvCloudContent: TextView = itemView.findViewById(R.id.tvCloudContent) + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_cloud.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_cloud.xml new file mode 100644 index 0000000000..231ab7b804 --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_box_cloud.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_cloud.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_cloud.xml new file mode 100644 index 0000000000..1d26015b8d --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_bubble_cloud.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_cloud.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_cloud.xml new file mode 100644 index 0000000000..0a6905494e --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_msg_toast_cloud.xml @@ -0,0 +1,43 @@ + + + + + + + + + + \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_cloud.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_cloud.xml new file mode 100644 index 0000000000..92aa1d786c --- /dev/null +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/item_tab_cloud.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index 2f99019fa9..80fd2b8f35 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -632,7 +632,37 @@ enum class EventTypeEnumNew( TYPE_OPTIMAL_ROUTE_RECOMMEND("2000", "路线推荐", "", R.drawable.icon_warning_v2x_optimal_route, "为您推荐最优路线", "已为您选择最优路线"), //蘑方指令下发时,工控机与pad断连提示 - TYPE_IPC_DISCONNECT_FOR_MO_FANG("20025", "连接异常", "", R.drawable.icon_warning_take_over, "工控机连接异常,无法执行魔方命令", ""); + TYPE_IPC_DISCONNECT_FOR_MO_FANG("20025", "连接异常", "", R.drawable.icon_warning_take_over, "工控机连接异常,无法执行魔方命令", ""), + + //-----------云控基础平台 start------------- + + //绿波车速引导 + CLOUD_GREEN_WAVE_SPEED("81002","绿波车速引导","",R.drawable.icon_warning_v2x_traffic_lights_green,"",""), + //闯红灯预警 + CLOUD_RED_LIGHT_WARN("81003","闯红灯预警","",R.drawable.icon_warning_v2x_traffic_lights_red,"",""), + //行驶车道建议 + CLOUD_SUGGEST_DRIVE_LANE("81004","行驶车道建议","",R.drawable.icon_default,"",""), + //交通拥堵提醒 + CLOUD_TRAFFIC_REMIND("81005","交通拥堵提醒","",R.drawable.v2x_icon_yongdu_vr,"",""), + //紧急车辆优先通行 + CLOUD_PRIORITY_VEHICLE("81006","紧急车辆优先通行","",R.drawable.icon_warning_v2x_special_vehicle_access,"",""), + //道路危险状况提示 + CLOUD_DANGEROUS_ROAD_WARN("81007","道路危险状况","",R.drawable.icon_warning_v2x_car_breakdown,"",""), + //动态限速信息 + CLOUD_LIMIT_SPEED("81008","动态限速信息","",R.drawable.icon_warning_v2x_over_speed,"",""), + //超视距弱势交通参与者提醒 + CLOUD_BEYOND_VISUAL_RANGE("81009","弱势交通参与者提醒","",R.drawable.icon_default,"",""), + //路口其他车辆闯红灯预警 + CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN("81010","路口他车闯红灯","",R.drawable.icon_warning_v2x_traffic_lights_red,"",""), + //障碍物(路面遗撒)预警 + CLOUD_OBSTACLE_WARN("81011","障碍物预警","",R.drawable.icon_warning_v2x_abnormal_vehicle,"",""), + //能见度预警 + CLOUD_VISIBILITY_WARN("81012","能见度预警","",R.drawable.icon_warning_take_over,"",""), + //异常车辆预警 + CLOUD_ABNORMAL_VEHICLE_WARN("81013","异常车辆预警","",R.drawable.icon_v2x_other_retrograde_vehicle_driver,"",""); + + //-----------云控基础平台 end--------------- + companion object { @JvmStatic @@ -1178,6 +1208,54 @@ enum class EventTypeEnumNew( TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType -> { TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiTypeStr } + //绿波车速引导 + CLOUD_GREEN_WAVE_SPEED.poiType ->{ + CLOUD_GREEN_WAVE_SPEED.poiTypeStr + } + //闯红灯预警 + CLOUD_RED_LIGHT_WARN.poiType->{ + CLOUD_RED_LIGHT_WARN.poiTypeStr + } + //行驶车道建议 + CLOUD_SUGGEST_DRIVE_LANE.poiType->{ + CLOUD_SUGGEST_DRIVE_LANE.poiTypeStr + } + //交通拥堵提醒 + CLOUD_TRAFFIC_REMIND.poiType->{ + CLOUD_TRAFFIC_REMIND.poiTypeStr + } + //紧急车辆优先通行 + CLOUD_PRIORITY_VEHICLE.poiType->{ + CLOUD_PRIORITY_VEHICLE.poiTypeStr + } + //道路危险状况提示 + CLOUD_DANGEROUS_ROAD_WARN.poiType->{ + CLOUD_DANGEROUS_ROAD_WARN.poiTypeStr + } + //动态限速信息 + CLOUD_LIMIT_SPEED.poiType->{ + CLOUD_LIMIT_SPEED.poiTypeStr + } + //超视距弱势交通参与者提醒 + CLOUD_BEYOND_VISUAL_RANGE.poiType->{ + CLOUD_BEYOND_VISUAL_RANGE.poiTypeStr + } + //路口其他车辆闯红灯预警 + CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN.poiType->{ + CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN.poiTypeStr + } + //障碍物(路面遗撒)预警 + CLOUD_OBSTACLE_WARN.poiType->{ + CLOUD_OBSTACLE_WARN.poiTypeStr + } + //能见度预警 + CLOUD_VISIBILITY_WARN.poiType->{ + CLOUD_VISIBILITY_WARN.poiTypeStr + } + //异常车辆预警 + CLOUD_ABNORMAL_VEHICLE_WARN.poiType->{ + CLOUD_ABNORMAL_VEHICLE_WARN.poiTypeStr + } else ->{ "事件通知" } @@ -1388,6 +1466,30 @@ enum class EventTypeEnumNew( TYPE_USECASE_ID_EVW.poiType -> TYPE_USECASE_ID_EVW.poiTypeSrcVr TYPE_USECASE_ID_LTA.poiType -> TYPE_USECASE_ID_LTA.poiTypeSrcVr TYPE_IPC_DISCONNECT_FOR_MO_FANG.poiType -> TYPE_IPC_DISCONNECT_FOR_MO_FANG.poiTypeSrcVr + //绿波车速引导 + CLOUD_GREEN_WAVE_SPEED.poiType -> CLOUD_GREEN_WAVE_SPEED.poiTypeSrcVr + //闯红灯预警 + CLOUD_RED_LIGHT_WARN.poiType -> CLOUD_RED_LIGHT_WARN.poiTypeSrcVr + //行驶车道建议 + CLOUD_SUGGEST_DRIVE_LANE.poiType -> CLOUD_SUGGEST_DRIVE_LANE.poiTypeSrcVr + //交通拥堵提醒 + CLOUD_TRAFFIC_REMIND.poiType -> CLOUD_TRAFFIC_REMIND.poiTypeSrcVr + //紧急车辆优先通行 + CLOUD_PRIORITY_VEHICLE.poiType -> CLOUD_PRIORITY_VEHICLE.poiTypeSrcVr + //道路危险状况提示 + CLOUD_DANGEROUS_ROAD_WARN.poiType -> CLOUD_DANGEROUS_ROAD_WARN.poiTypeSrcVr + //动态限速信息 + CLOUD_LIMIT_SPEED.poiType -> CLOUD_LIMIT_SPEED.poiTypeSrcVr + //超视距弱势交通参与者提醒 + CLOUD_BEYOND_VISUAL_RANGE.poiType -> CLOUD_BEYOND_VISUAL_RANGE.poiTypeSrcVr + //路口其他车辆闯红灯预警 + CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN.poiType -> CLOUD_OTHER_VEHICLE_RED_LIGHT_WARN.poiTypeSrcVr + //障碍物(路面遗撒)预警 + CLOUD_OBSTACLE_WARN.poiType -> CLOUD_OBSTACLE_WARN.poiTypeSrcVr + //能见度预警 + CLOUD_VISIBILITY_WARN.poiType -> CLOUD_VISIBILITY_WARN.poiTypeSrcVr + //异常车辆预警 + CLOUD_ABNORMAL_VEHICLE_WARN.poiType -> CLOUD_ABNORMAL_VEHICLE_WARN.poiTypeSrcVr else -> { R.drawable.icon_default } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/CloudControlMsg.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/CloudControlMsg.kt new file mode 100644 index 0000000000..49b61afaab --- /dev/null +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/CloudControlMsg.kt @@ -0,0 +1,23 @@ +package com.mogo.eagle.core.data.msgbox + +import android.util.Log +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import java.io.Serializable + +/** + * 云控基础平台消息实体类 + * @param title OTA升级结果标题 + * @param des OTA升级结果内容 + */ +data class CloudControlMsg(var msgType: String ?= "", var title: String? = "", var des: String? = ""): + Serializable { + + private var timeStamp: Long = 0 + + init { + timeStamp = System.currentTimeMillis() + if (des.isNullOrEmpty()) { + CallerLogger.e("MsgBox", Log.getStackTraceString(Throwable())) + } + } +} \ No newline at end of file diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxType.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxType.kt index 7889ba4625..4bb3b849fd 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxType.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/msgbox/MsgBoxType.kt @@ -2,5 +2,5 @@ package com.mogo.eagle.core.data.msgbox enum class MsgBoxType { // 按功能划分为几大类:运营、通知、V2X模块、OBU模块、工控机Report、录制、交通、FM、语音、SSM、工控机相关等 - OPERATION, NOTICE, V2X, OBU, REPORT, RECORD, TRAFFIC, FMINFO, VOICE, SSMINFO, AUTOPILOT, FSM, NDE,OTA + OPERATION, NOTICE, V2X, OBU, REPORT, RECORD, TRAFFIC, FMINFO, VOICE, SSMINFO, AUTOPILOT, FSM, NDE,OTA,CLOUD } \ No newline at end of file diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/INDECloudListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/INDECloudListener.kt new file mode 100644 index 0000000000..effbc78232 --- /dev/null +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/devatools/INDECloudListener.kt @@ -0,0 +1,68 @@ +package com.mogo.eagle.core.function.api.devatools + +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceAvwInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceComRsiInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceEvwInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceGlosaInfo +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 + +/** + * 云控基础平台接口 + */ +interface INDECloudListener { + + /** + * NDE下发 信号灯信息 + * @param astFuncPojo 云端辅助功能信息 + * @param astFuncTlmInfo 云端下发信号灯信息 + */ + fun onNdeCloudAstFuncTlm(astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo) + + /** + * NDE下发 信号灯路口车速引导功能指令 + * @param advicePojo 实时决策建议 + * @param adviceGlosaInfo 信号灯路口车速引导功能指令 + */ + fun onNdeCloudAdviceGlosa(advicePojo: AdvicePojo, adviceGlosaInfo: AdviceGlosaInfo) + + /** + * NDE下发 通用 RSI 预警指令 + * 包含: + * 闯红灯预警 + * 行驶车道建议 + * 交通拥堵提醒 + * 道路危险状况提示 + * 超视距弱势交通参与者提醒 + * 路口其他车辆闯红灯预警 + * 障碍物(路面遗撒)预警 + * 能见度预警 + * @param advicePojo 实时决策建议 + * @param adviceComRsiInfo 通用RSI预警指令 + */ + fun onNdeCloudAdviceComRsi(advicePojo: AdvicePojo, adviceComRsiInfo: AdviceComRsiInfo) + + /** + * NDE下发 紧急车辆预警指令 + * @param advicePojo 实时决策建议 + * @param adviceEvwInfo 紧急车辆预警指令 + */ + fun onNdeCloudAdviceEvw(advicePojo: AdvicePojo, adviceEvwInfo: AdviceEvwInfo) + + /** + * NDE下发 动态车道级限速指令 + * @param advicePojo 实时决策建议 + * @param adviceLaneSpdLmtInfo 动态车道级限速指令 + */ + fun onNdeCloudAdviceLaneSpdLmt(advicePojo: AdvicePojo, adviceLaneSpdLmtInfo: AdviceLaneSpdLmtInfo) + + /** + * NDE下发 异常车辆预警指令 + * @param advicePojo 实时决策建议 + * @param adviceAvwInfo 异常车辆预警指令 + */ + fun onNdeCloudAdviceAvw(advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo) + +} \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerNDECloudManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerNDECloudManager.kt new file mode 100644 index 0000000000..16431e886a --- /dev/null +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/devatools/CallerNDECloudManager.kt @@ -0,0 +1,100 @@ +package com.mogo.eagle.core.function.call.devatools + +import com.mogo.eagle.core.function.api.devatools.INDECloudListener +import com.mogo.eagle.core.function.call.base.CallerBase +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceAvwInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceComRsiInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceEvwInfo +import com.zhjt.mogo.adas.data.bean.cloud.info.AdviceGlosaInfo +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 + +/** + * 云控基础平台 + */ +object CallerNDECloudManager: CallerBase() { + + /** + * NDE下发 信号灯信息 + * @param astFuncPojo 云端辅助功能信息 + * @param astFuncTlmInfo 云端下发信号灯信息 + */ + fun onNdeCloudAstFuncTlm(astFuncPojo: AstFuncPojo, astFuncTlmInfo: AstFuncTlmInfo){ + M_LISTENERS.forEach{ + val listener = it.value + listener.onNdeCloudAstFuncTlm(astFuncPojo,astFuncTlmInfo) + } + } + + /** + * NDE下发 信号灯路口车速引导功能指令 + * @param advicePojo 实时决策建议 + * @param adviceGlosaInfo 信号灯路口车速引导功能指令 + */ + fun onNdeCloudAdviceGlosa(advicePojo: AdvicePojo, adviceGlosaInfo: AdviceGlosaInfo) { + M_LISTENERS.forEach{ + val listener = it.value + listener.onNdeCloudAdviceGlosa(advicePojo,adviceGlosaInfo) + } + } + + /** + * NDE下发 通用 RSI 预警指令 + * 包含: + * 闯红灯预警 + * 行驶车道建议 + * 交通拥堵提醒 + * 道路危险状况提示 + * 超视距弱势交通参与者提醒 + * 路口其他车辆闯红灯预警 + * 障碍物(路面遗撒)预警 + * 能见度预警 + * @param advicePojo 实时决策建议 + * @param adviceComRsiInfo 通用RSI预警指令 + */ + fun onNdeCloudAdviceComRsi(advicePojo: AdvicePojo, adviceComRsiInfo: AdviceComRsiInfo) { + M_LISTENERS.forEach{ + val listener = it.value + listener.onNdeCloudAdviceComRsi(advicePojo,adviceComRsiInfo) + } + } + + /** + * NDE下发 紧急车辆预警指令 + * @param advicePojo 实时决策建议 + * @param adviceEvwInfo 紧急车辆预警指令 + */ + fun onNdeCloudAdviceEvw(advicePojo: AdvicePojo, adviceEvwInfo: AdviceEvwInfo) { + M_LISTENERS.forEach{ + val listener = it.value + listener.onNdeCloudAdviceEvw(advicePojo,adviceEvwInfo) + } + } + + /** + * NDE下发 动态车道级限速指令 + * @param advicePojo 实时决策建议 + * @param adviceLaneSpdLmtInfo 动态车道级限速指令 + */ + fun onNdeCloudAdviceLaneSpdLmt(advicePojo: AdvicePojo, adviceLaneSpdLmtInfo: AdviceLaneSpdLmtInfo) { + M_LISTENERS.forEach{ + val listener = it.value + listener.onNdeCloudAdviceLaneSpdLmt(advicePojo,adviceLaneSpdLmtInfo) + } + } + + /** + * NDE下发 异常车辆预警指令 + * @param advicePojo 实时决策建议 + * @param adviceAvwInfo 异常车辆预警指令 + */ + fun onNdeCloudAdviceAvw(advicePojo: AdvicePojo, adviceAvwInfo: AdviceAvwInfo) { + M_LISTENERS.forEach{ + val listener = it.value + listener.onNdeCloudAdviceAvw(advicePojo,adviceAvwInfo) + } + } + +} \ No newline at end of file diff --git a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/cloud/AdviceType.java b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/cloud/AdviceType.java index 36d46df069..775e468d3a 100644 --- a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/cloud/AdviceType.java +++ b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/common/cloud/AdviceType.java @@ -8,22 +8,34 @@ import androidx.annotation.NonNull; */ public enum AdviceType { ERROR(-1, "异常"), + //2、绿波通行 adviceType=1 CLOUD2VEH_ADVICE_GLOSA(1, "信号灯路口车速引导功能指令"), VEH2CLOUD_ADVICE_GLOSA_RES(2, "信号灯路口车速引导功能指令返回"), CLOUD2VEH_ADVICE_NTLAR(3, "无信号灯路口右转功能指令"), VEH2CLOUD_ADVICE_NTLAR_RES(4, "无信号灯路口右转功能指令返回"), + //8、动态限速信息 CLOUD2VEH_ADVICE_LANESPDLMT(5, "动态车道级限速指令"), VEH2CLOUD_ADVICE_LANESPDLMT_RES(6, "动态车道级限速指令返回"), CLOUD2VEH_ADVICE_RAMP_INTENT_CHANGE(7, "匝道汇回预警指令"), VEH2CLOUD_ADVICE_RAMP_INTENT_CHANGE_RES(8, "匝道汇回预警指令返回"), CLOUD2VEH_ADVICE_FCW(9, "前向碰撞预警指令"), VEH2CLOUD_ADVICE_FCW_RES(10, "前向碰撞预警返回"), + //异常车辆预警 CLOUD2VEH_ADVICE_AVW(11, "异常车辆预警指令"), VEH2CLOUD_ADVICE_AVW_RES(12, "异常车辆预警返回"), + //6、紧急车辆优先通行 adviceType=13 CLOUD2VEH_ADVICE_EVW(13, "紧急车辆预警指令"), VEH2CLOUD_ADVICE_EVW_RES(14, "紧急车辆预警返回"), CLOUD2VEH_ADVICE_RAMP_ASSIST(15, "匝道辅助指令"), VEH2CLOUD_ADVICE_RAMP_ASSIST_RES(16, "匝道辅助返回"), + //3、闯红灯预警 adviceType=17 sub_eventType=6011 + //4、行驶车道建议 adviceType=17 sub_eventType=6031/6032 + //5、交通拥堵提醒 adviceType=17 sub_eventType=6061 + //7、道路危险状况提示 adviceType=17 sub_eventType=6021/6022 + //9、超视距弱势交通参与者提醒 adviceType=17 sub_eventType=6051 + //10、路口其他车辆闯红灯预警 adviceType=17 sub_eventType=6041 + //11、障碍物(路面遗撒)预警 adviceType=17 sub_eventType=6081 + //12、能见度预警 adviceType=17 sub_eventType=6071 CLOUD2VEH_ADVICE_COM_RSI(17, "通用RSI预警指令"), VEH2CLOUD_ADVICE_COM_RSI_RES(18, "通用RSI预警返回"), CLOUD2VEH_ADVICE_GUIDANCE(19, "路线规划指令"), diff --git a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/cloud/info/AdviceComRsiInfo.java b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/cloud/info/AdviceComRsiInfo.java index 070527c6cc..d349db6859 100644 --- a/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/cloud/info/AdviceComRsiInfo.java +++ b/libraries/mogo-adas-data/src/main/java/com/zhjt/mogo/adas/data/bean/cloud/info/AdviceComRsiInfo.java @@ -189,10 +189,15 @@ public final class AdviceComRsiInfo { * 使用 */ public final AdviceRsiLaneProposalInfo adviceRsiLaneProposalInfo; + //实时决策建议 rsi 路口其他车辆闯红灯预警功能-扩展字段补充 public final AdviceRsiOtherCarBreakReadWarningInfo adviceRsiOtherCarBreakReadWarningInfo; + //实时决策建议 rsi 交通拥堵提醒功能-扩展字段补充 public final AdviceRsiTrafficJamInfo adviceRsiTrafficJamInfo; + //实时决策建议 rsi 超视距弱势交通参与者预警功能-扩展字段补充 public final AdviceRsiOverSightDistanceInfo adviceRsiOverSightDistanceInfo; + //实时决策建议 rsi 能见度预警功能-扩展字段补充 public final AdviceRsiVisibilityInfo adviceRsiVisibilityInfo; + //实时决策建议 rsi 路面遗撒预警功能-扩展字段补充 public final AdviceRsiAbandonInfo adviceRsiAbandonInfo; public Rsi(String uuid, long timestamp, Position eventPosition, AdviceEventType adviceEventType, int eventType, int eventSource, double eventRadius, int referenceLinksNum, ReferenceLink[] referenceLinks, int priority, Position alertPath, double pathRadius, int status, int userDefinedDataLength, String userDefinedData, AdviceRsiLightWarningInfo adviceRsiLightWarningInfo, AdviceRsiRoadDangerHintInfo adviceRsiRoadDangerHintInfo, AdviceRsiLaneProposalInfo adviceRsiLaneProposalInfo, AdviceRsiOtherCarBreakReadWarningInfo adviceRsiOtherCarBreakReadWarningInfo, AdviceRsiTrafficJamInfo adviceRsiTrafficJamInfo, AdviceRsiOverSightDistanceInfo adviceRsiOverSightDistanceInfo, AdviceRsiVisibilityInfo adviceRsiVisibilityInfo, AdviceRsiAbandonInfo adviceRsiAbandonInfo) {