From 37be6cc1d76f76bf9828ef3fb5d760540bc5d89c Mon Sep 17 00:00:00 2001 From: xuxinchao <13522809046@163.com> Date: Thu, 24 Mar 2022 19:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E7=AA=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、隐藏工控机重启和升级按钮 2、增加工控机协议版本显示 3、增加、完善异常提示(演示模式下不提示) 4、修改GPS定位显示 --- .../autopilot/MoGoAutopilotProvider.kt | 9 +++ .../hmi/ui/setting/DebugSettingView.kt | 57 ++++++++++++++++--- .../main/res/layout/view_debug_setting.xml | 19 ++++++- .../mogo/eagle/core/data/app/AppConfigInfo.kt | 2 + .../api/autopilot/IMoGoAutopilotProvider.kt | 5 ++ .../call/autopilot/CallerAutoPilotManager.kt | 7 +++ 6 files changed, 88 insertions(+), 11 deletions(-) diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt index a51271e89e..532a214d64 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/MoGoAutopilotProvider.kt @@ -368,4 +368,13 @@ class MoGoAutopilotProvider : override fun isConnected(): Boolean { return AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED } + + /** + * 获取协议版本 + */ + override fun getProtocolVersion(): Int { + return AdasManager.getInstance().protocolVersion + } + + } \ 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/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index 667edf6428..cd25df7a14 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -20,7 +20,6 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.scene.SceneModule -import com.mogo.eagle.core.data.deva.scene.SceneTAG import com.mogo.eagle.core.data.enums.TrafficTypeEnum import com.mogo.eagle.core.data.map.MogoLocation import com.mogo.eagle.core.data.obu.ObuStatusInfo @@ -110,6 +109,11 @@ class DebugSettingView @JvmOverloads constructor( private var downloadVersion: String?=null //工控机docker版本 private var upgradeStatus: Int=-1 //升级状态 + //ADAS连接状态 + private var adasConnectStatus: Boolean=false + //OBU连接状态 + private var obuConnectStatus: Boolean=false + private val mapUiController by lazy { CallerMapUIServiceManager.getMapUIController() } @@ -1069,7 +1073,8 @@ class DebugSettingView @JvmOverloads constructor( tvObuAppInfo.text = "OBU程序版本:${CallerObuListenerManager.getObuStatusInfo().appInfo}" tvObuHliInfo.text = "OBU协议版本:${CallerObuListenerManager.getObuStatusInfo().hliInfo}" tvObuSdkVersion.text = "OBU-SDK版本:${AppConfigInfo.obuSdkVersion}" - tvAutopilotVersionInfo.text = "Autopilot版本:${AppConfigInfo.adasSdkVersion}" + tvAutopilotProtocolVersionInfo.text = "Autopilot协议版本:${CallerAutoPilotManager.getProtocolVersion()}" + tvIpcProtocolVersionInfo.text = "工控机协议版本:${AppConfigInfo.protocolVersionNumber}" tvMoGoMapVersion.text = "HD-Map版本:${MogoMap.getInstance().mogoMap.mapVersion}" tvGitBranchInfo.text = "Git分支:${AppConfigInfo.workingBranchName}" tvGitHashInfo.text = "Git-Hash:${AppConfigInfo.workingBranchHash}" @@ -1170,7 +1175,7 @@ class DebugSettingView @JvmOverloads constructor( tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo) tvCarInfo.text = - "GPS时间:${mGnssInfo?.satelliteTime}\n" + + "GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" + "自车经纬度:\n${mGnssInfo?.longitude}\n${mGnssInfo?.latitude}\n" tvIdentifyInfo.text = @@ -1198,6 +1203,15 @@ class DebugSettingView @JvmOverloads constructor( AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus + + if(obuStatusInfo.obuStatus){ + obuConnectStatus = true + } + //OBU断开连接,提示异常 + if(obuConnectStatus && !obuStatusInfo.obuStatus){ + obuConnectStatus = false + toastMsg("OBU连接状态异常") + } } /** @@ -1205,14 +1219,21 @@ class DebugSettingView @JvmOverloads constructor( */ override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) { mAutoPilotStatusInfo = autoPilotStatusInfo - - AppConfigInfo.adasSdkVersion = autoPilotStatusInfo.version AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus if(AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())){ //查询工控机基础配置信息 CallerAutoPilotManager.getCarConfig() } + + if(autoPilotStatusInfo.connectStatus){ + adasConnectStatus = true + } + //ADAS断开连接,提示异常 + if(adasConnectStatus && !autoPilotStatusInfo.connectStatus){ + adasConnectStatus=false + toastMsg("Autopilot系统连接状态异常") + } } override fun onAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) { @@ -1247,8 +1268,9 @@ class DebugSettingView @JvmOverloads constructor( */ override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) { carConfigResp?.let { - AppConfigInfo.plateNumber = it.plateNumber - AppConfigInfo.iPCMacAddress = it.macAddress + AppConfigInfo.plateNumber = it.plateNumber//车牌号 + AppConfigInfo.iPCMacAddress = it.macAddress//工控机MAC地址 + AppConfigInfo.protocolVersionNumber = it.protocolVersion.number//工控机协议版本 } } @@ -1276,8 +1298,11 @@ class DebugSettingView @JvmOverloads constructor( } tvReportActions.text = actionStr + tvReportSec.text = "sec:${it.timestamp.sec}" + tvReportNSec.text = "nsec:${it.timestamp.nsec}" - if("error".equals(it.level)){ + + if("error" == it.level){ //字体为红色,吐司提示 tvReportSrc.setTextColor(Color.RED) tvReportLevel.setTextColor(Color.RED) @@ -1285,7 +1310,9 @@ class DebugSettingView @JvmOverloads constructor( tvReportCode.setTextColor(Color.RED) tvReportResult.setTextColor(Color.RED) tvReportActions.setTextColor(Color.RED) - ToastUtils.showShort(it.msg) + tvReportSec.setTextColor(Color.RED) + tvReportNSec.setTextColor(Color.RED) + toastMsg(it.msg) }else{ tvReportSrc.setTextColor(Color.BLACK) tvReportLevel.setTextColor(Color.BLACK) @@ -1293,6 +1320,8 @@ class DebugSettingView @JvmOverloads constructor( tvReportCode.setTextColor(Color.BLACK) tvReportResult.setTextColor(Color.BLACK) tvReportActions.setTextColor(Color.BLACK) + tvReportSec.setTextColor(Color.BLACK) + tvReportNSec.setTextColor(Color.BLACK) } } } @@ -1309,4 +1338,14 @@ class DebugSettingView @JvmOverloads constructor( tvObuDelay.text = "obu时延:" + delayTime.toString() } + /** + * 吐司提示 + */ + private fun toastMsg(msg: String){ + //当处于美化(演示)模式、msg为空时不弹吐司 + if(!FunctionBuildConfig.isDemoMode && msg.isNotEmpty()){ + ToastUtils.showLong(msg) + } + } + } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml index 10d9db207d..046ce5943a 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml +++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml @@ -22,7 +22,7 @@ @@ -321,7 +321,20 @@ /> + + + +