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 @@
/>
+
+
+
+
diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/AppConfigInfo.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/AppConfigInfo.kt
index abff289ee1..0347ce8be0 100644
--- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/AppConfigInfo.kt
+++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/app/AppConfigInfo.kt
@@ -30,6 +30,8 @@ object AppConfigInfo {
var plateNumber: String? = null
//工控机MAC地址
var iPCMacAddress: String? = null
+ //工控机协议版本
+ var protocolVersionNumber: Int = 0
/**
* debug 测试环境--2
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt
index 32c838fee7..2c597c2414 100644
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt
+++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotProvider.kt
@@ -139,4 +139,9 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
* 域控制器是否连上了
*/
fun isConnected(): Boolean
+
+ /**
+ *获取协议版本
+ */
+ fun getProtocolVersion(): Int
}
\ No newline at end of file
diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt
index 24a60a5a5b..bd87c41cc7 100644
--- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt
+++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotManager.kt
@@ -156,4 +156,11 @@ object CallerAutoPilotManager {
fun getGlobalPath(){
providerApi?.getGlobalPath()
}
+
+ /**
+ *获取协议版本
+ */
+ fun getProtocolVersion(): Int{
+ return providerApi?.getProtocolVersion() ?:0
+ }
}
\ No newline at end of file