调试窗修改

1、隐藏工控机重启和升级按钮
2、增加工控机协议版本显示
3、增加、完善异常提示(演示模式下不提示)
4、修改GPS定位显示
This commit is contained in:
xuxinchao
2022-03-24 19:16:46 +08:00
parent 81cbfae507
commit 37be6cc1d7
6 changed files with 88 additions and 11 deletions

View File

@@ -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
}
}

View File

@@ -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)
}
}
}

View File

@@ -22,7 +22,7 @@
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_height="6dp"
android:background="#F0F0F0"
/>
@@ -321,7 +321,20 @@
/>
<TextView
android:id="@+id/tvAutopilotVersionInfo"
android:id="@+id/tvAutopilotProtocolVersionInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/DebugSettingText"
/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F0F0F0"
/>
<TextView
android:id="@+id/tvIpcProtocolVersionInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/DebugSettingText"
@@ -730,6 +743,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@id/btnSystemRestart"
android:text="升级系统"
android:visibility="gone"
/>
<Button
@@ -740,6 +754,7 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toRightOf="@id/btnSystemUpgrade"
android:text="重启系统"
android:visibility="gone"
/>

View File

@@ -30,6 +30,8 @@ object AppConfigInfo {
var plateNumber: String? = null
//工控机MAC地址
var iPCMacAddress: String? = null
//工控机协议版本
var protocolVersionNumber: Int = 0
/**
* debug 测试环境--2

View File

@@ -139,4 +139,9 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
* 域控制器是否连上了
*/
fun isConnected(): Boolean
/**
*获取协议版本
*/
fun getProtocolVersion(): Int
}

View File

@@ -156,4 +156,11 @@ object CallerAutoPilotManager {
fun getGlobalPath(){
providerApi?.getGlobalPath()
}
/**
*获取协议版本
*/
fun getProtocolVersion(): Int{
return providerApi?.getProtocolVersion() ?:0
}
}