From 8d530ccaca72813d5ff8a59014bc766ef9980e63 Mon Sep 17 00:00:00 2001 From: chenfufeng Date: Thu, 7 Mar 2024 16:22:40 +0800 Subject: [PATCH] =?UTF-8?q?[6.3.0][Opt]=E6=96=B0=E5=A2=9E=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E6=B6=88=E6=81=AF=E5=AD=98=E5=85=A5=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E7=9B=92=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MoGoAdasMsgConnectStatusListenerImpl.kt | 46 +++++++++++++++++++ .../CallerAutoPilotStatusListenerManager.kt | 9 ---- 2 files changed, 46 insertions(+), 9 deletions(-) diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt index e897c2e87a..7d5ddf1729 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasMsgConnectStatusListenerImpl.kt @@ -8,6 +8,9 @@ import com.mogo.commons.debug.DebugConfig.getNetMode import com.mogo.commons.storage.SharedPrefsMgr import com.mogo.eagle.core.data.app.AppConfigInfo import com.mogo.eagle.core.data.config.FunctionBuildConfig +import com.mogo.eagle.core.data.msgbox.AutopilotMsg +import com.mogo.eagle.core.data.msgbox.MsgBoxBean +import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager @@ -15,6 +18,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager import com.mogo.eagle.core.function.call.autopilot.CallerParallelDrivingActionsListenerManager import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager +import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_D_C @@ -198,6 +202,48 @@ class MoGoAdasMsgConnectStatusListenerImpl : CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().connectStatusDescribe = reason CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus() CallerAutoPilotStatusListenerManager.invokeAutoPilotIPCStatusChanged(status, reason) + saveIntoMsgBox(status, reason) + } + + private fun saveIntoMsgBox( + status: AdasConstants.IpcConnectionStatus, + reason: String? + ) { + var title = "" + var content = "" + when (status) { + AdasConstants.IpcConnectionStatus.DISCONNECTED -> { + title = "连接异常" + content = "域控未连接或主动断开连接" + } + + AdasConstants.IpcConnectionStatus.CONNECT_EXCEPTION -> { + title = "连接异常" + content = "域控连接异常:$reason" + } + + AdasConstants.IpcConnectionStatus.NOT_FOUND_ADDRESS -> { + title = "连接异常" + content = "找不到可用的域控地址" + } + AdasConstants.IpcConnectionStatus.HEARTBEAT_TIMEOUT -> { + title = "连接异常" + content = "域控心跳超时" + } + AdasConstants.IpcConnectionStatus.SERVER_DISCONNECTED -> { + title = "连接异常" + content = "域控主动断开连接" + } + else -> {} + } + if (title.isNotEmpty() && content.isNotEmpty()) { + CallerMsgBoxManager.saveMsgBox( + MsgBoxBean( + MsgBoxType.AUTOPILOT, + AutopilotMsg(0, title, content, System.currentTimeMillis()) + ) + ) + } } override fun onCompatibility(versionCompatibility: VersionCompatibility?) { diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt index a3197239f6..fb74c36f47 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotStatusListenerManager.kt @@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.call.autopilot import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo -import com.mogo.eagle.core.data.msgbox.AutopilotMsg import com.mogo.eagle.core.data.msgbox.MsgBoxBean import com.mogo.eagle.core.data.msgbox.MsgBoxType import com.mogo.eagle.core.data.msgbox.SSMMsg @@ -217,14 +216,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase { - CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.AUTOPILOT, AutopilotMsg(0, "连接异常", "域控未连接或主动断开连接", System.currentTimeMillis()))) - } - AdasConstants.IpcConnectionStatus.CONNECT_EXCEPTION -> { - CallerMsgBoxManager.saveMsgBox(MsgBoxBean(MsgBoxType.AUTOPILOT, AutopilotMsg(0, "连接异常", "域控连接异常:$reason", System.currentTimeMillis()))) - } - } } /**