fic bug of appconfiginfo

This commit is contained in:
zhongchao
2022-09-15 19:58:27 +08:00
parent 60354ae73e
commit e17a31a0a2
5 changed files with 57 additions and 71 deletions

View File

@@ -570,7 +570,6 @@ class MoGoAutopilotProvider :
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
// 乘客屏才监听
AppConfigInfo.plateNumber = carConfigResp.plateNumber
CallerBindingcarManager.getBindingcarProvider()
.getBindingcarInfo(carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为${carConfigResp.macAddress}")

View File

@@ -207,6 +207,8 @@ class MoGoAdasListenerImpl : OnAdasListener {
autopilotStatusInfo.dockVersion = it.dockVersion
AppConfigInfo.dockerVersion = it.dockVersion
}
AppConfigInfo.isConnectAutopilot = autopilotStatusInfo.connectStatus
AppConfigInfo.connectStatusDescribe = autopilotStatusInfo.connectStatusDescribe
invokeAutoPilotStatus()
}
}
@@ -307,6 +309,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
carConfigResp: MessagePad.CarConfigResp?
) {
if (HdMapBuildConfig.isMapLoaded && carConfigResp != null) {
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
AppConfigInfo.protocolVersionNumber = carConfigResp.protocolVersionValue//工控机协议版本
invokeAutopilotCarConfigData(carConfigResp)
}
}

View File

@@ -20,9 +20,13 @@ import androidx.core.view.*
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.commons.AbsMogoApplication
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.mvp.BaseFragment
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.*
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
import com.mogo.eagle.core.data.camera.CameraEntity
@@ -49,6 +53,7 @@ import com.mogo.eagle.core.function.api.hmi.view.IViewNotification
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWaringProvider
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
@@ -57,6 +62,7 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.WaringConst
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
@@ -84,11 +90,9 @@ import com.mogo.eagle.core.utilcode.reminder.*
import com.mogo.eagle.core.utilcode.reminder.api.*
import com.mogo.eagle.core.utilcode.reminder.api.IReminder.IStateChangeListener
import com.mogo.eagle.core.utilcode.reminder.api.impl.*
import com.mogo.eagle.core.utilcode.util.SoundUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.TimeUtils
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.eagle.core.utilcode.util.TimeUtils.millis2String
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.map.MogoMap
import com.mogo.module.common.enums.*
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.service_biz.BizConfig
@@ -202,7 +206,50 @@ import java.util.*
true
}
// init appConfigInfo
AppConfigInfo.appName = AppUtils.getAppName()
if (AppConfigInfo.appVersionCode == 0) {
AppConfigInfo.appVersionCode = AppUtils.getAppVersionCode()
}
if (AppConfigInfo.appVersionName.isNullOrEmpty()) {
AppConfigInfo.appVersionName = AppUtils.getAppVersionName()
}
if (AppConfigInfo.appPackageName.isNullOrEmpty()) {
AppConfigInfo.appPackageName = AppUtils.getAppPackageName()
}
if (AppConfigInfo.uniqueDeviceId.isNullOrEmpty()) {
AppConfigInfo.uniqueDeviceId = DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp())
}
if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
AppConfigInfo.widevineIDMd5 =
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
}
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
}
AppConfigInfo.netMode = DebugConfig.getNetMode()
if (MogoMap.getInstance().mogoMap != null) {
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
}
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
when {
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
AppConfigInfo.isDriver = true
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
}
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> {
AppConfigInfo.isDriver = false
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
AppConfigInfo.serverSn = CallerTelematicManager.getServerToken()
}
else -> {
}
}
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
}
@OptIn(ExperimentalCoroutinesApi::class)

View File

@@ -97,7 +97,7 @@ class DebugSettingView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener,
IMoGoAutopilotPlanningListener,
IMoGoAutopilotVehicleStateListener, IMoGoDevaToolsFuncConfigListener {
private val TAG = "DebugSettingView"
@@ -189,8 +189,6 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
// 添加 工控机基础信息回调 监听
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
//添加 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
@@ -223,8 +221,6 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
// 移除 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.removeListener(TAG)
// 移除 工控机基础信息回调 监听
CallerAutopilotCarConfigListenerManager.removeListener(TAG)
// 移除 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.removeListener(TAG)
@@ -1598,50 +1594,6 @@ class DebugSettingView @JvmOverloads constructor(
*/
@SuppressLint("SetTextI18n")
private fun drawAppInfo() {
AppConfigInfo.appName = AppUtils.getAppName()
if (AppConfigInfo.appVersionCode == 0) {
AppConfigInfo.appVersionCode = AppUtils.getAppVersionCode()
}
if (AppConfigInfo.appVersionName.isNullOrEmpty()) {
AppConfigInfo.appVersionName = AppUtils.getAppVersionName()
}
if (AppConfigInfo.appPackageName.isNullOrEmpty()) {
AppConfigInfo.appPackageName = AppUtils.getAppPackageName()
}
if (AppConfigInfo.uniqueDeviceId.isNullOrEmpty()) {
AppConfigInfo.uniqueDeviceId = DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp())
}
if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
AppConfigInfo.widevineIDMd5 =
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
}
if (MoGoAiCloudClient.getInstance().aiCloudClientConfig != null) {
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
}
AppConfigInfo.netMode = DebugConfig.getNetMode()
if (MogoMap.getInstance().mogoMap != null) {
AppConfigInfo.mapSdkVersion = MogoMap.getInstance().mogoMap.mapVersion
}
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
when {
AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode) -> {// 司机端
AppConfigInfo.isDriver = true
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
}
AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) -> {
AppConfigInfo.isDriver = false
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getClientConnStatus()
AppConfigInfo.serverSn = CallerTelematicManager.getServerToken()
}
else -> {
}
}
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
/**
* 设备绑定关系
*/
@@ -1837,8 +1789,6 @@ class DebugSettingView @JvmOverloads constructor(
*/
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
mAutoPilotStatusInfo = autoPilotStatusInfo
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
AppConfigInfo.connectStatusDescribe = autoPilotStatusInfo.connectStatusDescribe
setAutopilotConnectStatus()
}
@@ -1968,18 +1918,6 @@ class DebugSettingView @JvmOverloads constructor(
mRouteInfoSize = globalPathResp?.wayPointsList?.size ?: 0
}
/**
* 工控机基础信息回调
*/
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
carConfigResp.let {
AppConfigInfo.plateNumber = it.plateNumber//车牌号
AppConfigInfo.iPCMacAddress = it.macAddress//工控机MAC地址
AppConfigInfo.protocolVersionNumber = it.protocolVersionValue//工控机协议版本
}
}
/**
* 工控机异常回调
*/

View File

@@ -229,9 +229,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
speedLimit = carConfigResp.speedLimit
tvAcceleration.text = "加速度 ${carConfigResp.maxAcceleration} m/s²"
etInputSpeed.setText((carConfigResp.speedLimit * 3.6).toInt().toString())
AppConfigInfo.plateNumber = carConfigResp.plateNumber//车牌号
AppConfigInfo.iPCMacAddress = carConfigResp.macAddress//工控机MAC地址
AppConfigInfo.protocolVersionNumber = carConfigResp.protocolVersionValue//工控机协议版本
}
}
}