This commit is contained in:
zhongchao
2022-03-11 20:04:11 +08:00
parent c804f5162d
commit 5886f4feb7
81 changed files with 1689 additions and 1095 deletions

View File

@@ -13,7 +13,6 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.commons.mvp.MvpFragment
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.data.autopilot.AdUpgradeStateHelper
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult
import com.mogo.eagle.core.data.camera.CameraEntity
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths
@@ -46,6 +45,7 @@ import com.mogo.eagle.core.utilcode.util.Utils
import com.mogo.module.common.enums.EventTypeEnum
import kotlinx.android.synthetic.main.fragment_hmi.*
import kotlinx.coroutines.*
import record_cache.RecordPanelOuterClass
import java.util.*
/**
@@ -129,13 +129,13 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
}
@OptIn(ExperimentalCoroutinesApi::class)
override fun onAutopilotRecordResult(record: AutoPilotRecordResult?) {
override fun onAutopilotRecordResult(record: RecordPanelOuterClass.RecordPanel) {
record ?: return
if (HmiBuildConfig.isShowBadCaseView && record.type == 1 && record.stat == 100) {
CallerDevaToolsManager.onReceiveBadCaseRecord(record)
}
if (record.type == 2 && (record.stat == 101 || record.stat == 100)) {
CallerMapDataCollectorManager.finish(record.id, record.stat, "", record.fileName ?: "", record.note ?: "")
CallerMapDataCollectorManager.finish(record.id, record.stat, "", record.filename ?: "", record.note ?: "")
}
}

View File

@@ -18,10 +18,7 @@ import com.mogo.eagle.core.data.enums.TrafficTypeEnum
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
@@ -53,6 +50,7 @@ import com.mogo.map.uicontroller.VisualAngleMode.MODE_LONG_SIGHT
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.mogo.module.common.MogoApisHandler
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import mogo.telematics.pad.MessagePad
import java.util.*
/**
@@ -62,13 +60,13 @@ import java.util.*
* 展示 本机、网络、工控机、OBU等状态信息支持设置IP等参数进行调试
*/
class DebugSettingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener {
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener, IMoGoAutopilotCarConfigListener {
private val TAG = "DebugSettingView"
@@ -76,7 +74,7 @@ class DebugSettingView @JvmOverloads constructor(
private var logViewAttach = false
private var mAutoPilotStatusInfo: AutopilotStatusInfo? = null
private var mAutoPilotCarStateInfo: AutopilotCarStateInfo? = null
private var mGnssInfo: MessagePad.GnssInfo? = null
// 感知识别「已知类型」数据个数
private var mIdentifyDataSize = 0
@@ -127,6 +125,8 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
// 添加 工控机基础信息回调 监听
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
if (logInfoView != null) {
logInfoView!!.onEnterForeground()
}
@@ -251,14 +251,14 @@ class DebugSettingView @JvmOverloads constructor(
tvObuInfo.text = CallerObuListenerManager.getObuStatusInfoJsonString()
tvAutopilotInfo.text =
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfoJsonString()
// 绘制应用基本信息
drawAppInfo()
// 初始化OBU IP信息
val ipAddress =
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
SharedPrefsMgr.getInstance(context).getString(MoGoConfig.OBU_IP, "192.168.1.199")
etObuIP.setText(ipAddress)
etObuIP.text?.let { etObuIP.setSelection(it.length) }
@@ -274,8 +274,8 @@ class DebugSettingView @JvmOverloads constructor(
// 初始化工控机 IP信息
val autoPilotIpAddress =
SharedPrefsMgr.getInstance(context)
.getString(MoGoConfig.AUTOPILOT_IP, FunctionBuildConfig.adasConnectIP)
SharedPrefsMgr.getInstance(context)
.getString(MoGoConfig.AUTOPILOT_IP, FunctionBuildConfig.adasConnectIP)
etAutopilotIP.setText(autoPilotIpAddress)
etAutopilotIP.text?.let { etAutopilotIP.setSelection(it.length) }
@@ -296,18 +296,18 @@ class DebugSettingView @JvmOverloads constructor(
// 初始化 GSP数据源 数据
rgGpsProvider.check(
when (FunctionBuildConfig.gpsProvider) {
0 -> {
R.id.rbGpsProviderAndroid
}
1 -> {
R.id.rbGpsProviderRTK
}
2 -> {
R.id.rbGpsProviderOBU
}
else -> R.id.rbGpsProviderAndroid
when (FunctionBuildConfig.gpsProvider) {
0 -> {
R.id.rbGpsProviderAndroid
}
1 -> {
R.id.rbGpsProviderRTK
}
2 -> {
R.id.rbGpsProviderOBU
}
else -> R.id.rbGpsProviderAndroid
}
)
rgGpsProvider.setOnCheckedChangeListener { group, checkedId ->
when (checkedId) {
@@ -380,10 +380,8 @@ class DebugSettingView @JvmOverloads constructor(
tbADASLog.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotManager.setIsWriteLog(true)
} else {
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotManager.setIsWriteLog(false)
}
}
tbControlView.setOnCheckedChangeListener { _, isChecked ->
@@ -395,11 +393,11 @@ class DebugSettingView @JvmOverloads constructor(
}
tbLogCatch.isChecked =
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.CATCH_LOG, false)
SharedPrefsMgr.getInstance(context).getBoolean(MoGoConfig.CATCH_LOG, false)
tbLogCatch.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
var logTimeStr = etLogCatch.text?.toString()
if(logTimeStr.isNullOrEmpty()){
if (logTimeStr.isNullOrEmpty()) {
logTimeStr = "10"
}
val logCatchTime = logTimeStr.toInt()
@@ -414,20 +412,20 @@ class DebugSettingView @JvmOverloads constructor(
}
}
CallerDevaToolsListenerManager.registerDevaToolsLogCatchListener(TAG,
object : IMoGoDevaToolsListener {
override fun onLogCatchClose() {
super.onLogCatchClose()
tbLogCatch.isChecked = false
}
object : IMoGoDevaToolsListener {
override fun onLogCatchClose() {
super.onLogCatchClose()
tbLogCatch.isChecked = false
}
override fun onLogCatch(lineLog: String) {
logInfoView?.let {
if (logViewAttach) {
it.onLogCatch(lineLog)
}
override fun onLogCatch(lineLog: String) {
logInfoView?.let {
if (logViewAttach) {
it.onLogCatch(lineLog)
}
}
})
}
})
tbLogDebugView.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) {
logInfoView = LogInfoView()
@@ -486,7 +484,8 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.uniqueDeviceId = DeviceIdUtils.getDeviceId(AbsMogoApplication.getApp())
}
if (AppConfigInfo.widevineIDMd5.isNullOrEmpty()) {
AppConfigInfo.widevineIDMd5 = DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
AppConfigInfo.widevineIDMd5 =
DeviceIdUtils.getWidevineIDWithMd5(AbsMogoApplication.getApp())
}
AppConfigInfo.mogoSN = MoGoAiCloudClient.getInstance().aiCloudClientConfig.sn
AppConfigInfo.mogoToken = MoGoAiCloudClient.getInstance().aiCloudClientConfig.token
@@ -495,7 +494,7 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.isConnectNet = NetworkUtils.isConnected(context)
AppConfigInfo.isConnectSocket = DebugConfig.isDownloadSnapshot()
when (FunctionBuildConfig.appIdentityMode) {
when (FunctionBuildConfig.appIdentityMode) {
0x00 -> {// 司机端
AppConfigInfo.isDriver = true
AppConfigInfo.isConnectedNetty = CallerTelematicManager.getServerStarted()
@@ -513,16 +512,16 @@ class DebugSettingView @JvmOverloads constructor(
tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
tvCarInfo.text =
"GPS时间${mAutoPilotCarStateInfo?.values?.satelliteTime}\n" +
"自车经纬度:\n${mAutoPilotCarStateInfo?.values?.lon}\n${mAutoPilotCarStateInfo?.values?.lat}\n"
"GPS时间${mGnssInfo?.satelliteTime}\n" +
"自车经纬度:\n${mGnssInfo?.longitude}\n${mGnssInfo?.latitude}\n"
tvIdentifyInfo.text =
"「有效类型」感知数据个数:${mIdentifyDataSize}\n" +
"「未知类型」感知数据个数:${mUnknownIdentifyDataSize}\n"
"「有效类型」感知数据个数:${mIdentifyDataSize}\n" +
"「未知类型」感知数据个数:${mUnknownIdentifyDataSize}\n"
tvTrajectoryInfoSize.text =
"引导线点个数:${mTrajectoryInfoSize}"
"引导线点个数:${mTrajectoryInfoSize}"
tvRouteInfoSize.text =
"全局路径规划点个数:${mRouteInfoSize}"
"全局路径规划点个数:${mRouteInfoSize}"
// 用完之后重制为0防止节点回掉突然没数据导致页面显示还是之前的数据情况
mIdentifyDataSize = 0
@@ -551,34 +550,17 @@ class DebugSettingView @JvmOverloads constructor(
AppConfigInfo.isConnectAutopilot = autoPilotStatusInfo.connectStatus
}
override fun onAutopilotArriveAtStation(autopilotWayArrive: AutopilotStationInfo?) {
override fun onAutopilotCarStateData(gnssInfo: MessagePad.GnssInfo?) {
mGnssInfo = gnssInfo
}
override fun onAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
//Logger.d(TAG, "autoPilotCarStateInfo:$autoPilotCarStateInfo")
mAutoPilotCarStateInfo = autoPilotCarStateInfo
}
override fun onAutopilotSNRequest() {
}
override fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
}
override fun onLocationChanged(location: MogoLocation?) {
//Logger.d(TAG, "location:$location")
}
override fun onAutopilotIdentifyDataUpdate(trafficData: ArrayList<TrafficData>?) {
override fun onAutopilotIdentifyDataUpdate(trafficData: ArrayList<MessagePad.TrackedObject>?) {
// 重制数据
mIdentifyDataSize = 0
mUnknownIdentifyDataSize = 0
// 遍历计数
trafficData?.forEach {
if (it.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI) {
if (it.type == TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI.type) {
mUnknownIdentifyDataSize++
} else {
mIdentifyDataSize++
@@ -586,19 +568,22 @@ class DebugSettingView @JvmOverloads constructor(
}
}
override fun onAutopilotWarnMessage(autopilotWarnMessage: AutopilotWarnMessage?) {
}
override fun onAutopilotRecordResult(record: AutoPilotRecordResult?) {
}
override fun onAutopilotTrajectory(trajectoryInfos: ArrayList<ADASTrajectoryInfo>) {
mTrajectoryInfoSize = trajectoryInfos.size
}
override fun onAutopilotRotting(routeList: AutopilotRouteInfo?) {
mRouteInfoSize = routeList?.models?.size ?: 0
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
mRouteInfoSize = globalPathResp?.wayPointsList?.size ?: 0
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
//todo pb : 工控机基础信息回调 详见 message CarConfigResp proto
}
override fun onLocationChanged(location: MogoLocation?) {
}
}

View File

@@ -6,7 +6,6 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.FrameLayout
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
@@ -140,9 +139,22 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
* @param downloadVersion 下载版本
* @param upgradeStatus 升级状态
*/
fun showAdUpgradeStatus(upgradeMode: Int,downloadStatus : Int,currentProgress : Int,totalProgress : Int
,downloadVersion : String,upgradeStatus : Int){
systemVersionView?.showAdUpgradeStatus(upgradeMode,downloadStatus,currentProgress, totalProgress, downloadVersion, upgradeStatus)
fun showAdUpgradeStatus(
upgradeMode: Int,
downloadStatus: Int,
currentProgress: Int,
totalProgress: Int,
downloadVersion: String,
upgradeStatus: Int
) {
systemVersionView?.showAdUpgradeStatus(
upgradeMode,
downloadStatus,
currentProgress,
totalProgress,
downloadVersion,
upgradeStatus
)
checkSystemView?.setAdUpgradeStatus(downloadStatus, upgradeStatus)
}
@@ -160,10 +172,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
connectStatus = autoPilotStatusInfo.connectStatus
}
override fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
}
interface ClickListener {
fun go2CheckPage()
fun onClose(v: View)

View File

@@ -128,9 +128,4 @@ class AutoPilotStatusView @JvmOverloads constructor(
setAutoPilotStatus(autoPilotStatusInfo.state)
}
override fun onAutopilotGuardian(guardianInfo: AutopilotGuardianStatusInfo?) {
}
}