[dev_arch_opt_3.0]

[Change]
[
1、完成工控机数据和高德GPS地图数据的数据中心,以及工控机数据超时后的自动切换为高德地图GPS数据
定位监听已重构,CallerChassisLocationGCJ20ListenerManager---高的坐标系,CallerChassisLocationWGS84ListenerManager--高精坐标系,之前代码已修改,大家后续项目中根据需要进行订阅,如需控制频率可在订阅时
// 设置数据回调频率,单位HZ,1HZ的周期是1秒;50HZ的周期是1/50=0.02秒;10HZ的周期是1/10=0.1秒。
CallerChassisLocationWGS84ListenerManager.setListenerHz(Companion.functionName, 20)
CallerChassisLocationGCJ20ListenerManagersetListenerHz(Companion.functionName, 20)
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-02-02 19:24:38 +08:00
parent 0a4b0be72a
commit 111940123f
107 changed files with 963 additions and 724 deletions

View File

@@ -10,11 +10,12 @@ import android.widget.RadioButton
import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -27,7 +28,6 @@ import com.zhjt.mogo_core_function_devatools.R
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.util.*
@@ -119,7 +119,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
// 添加 ADAS车辆状态&定位 监听
CallerChassisLocationWGS84ListenerManager.addListener(this.hashCode().toString(), this)
//开始录制AI数据采集Bag包
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
99,
Random(SystemClock.elapsedRealtime()).nextInt(),
20,
@@ -353,7 +353,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}

View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
import com.mogo.eagle.core.data.badcase.TopicEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
@@ -206,7 +206,7 @@ internal class BadCaseConfigView @JvmOverloads constructor(
super.onAttachedToWindow()
CallerAutopilotRecordListenerManager.addListener(TAG, this)
//获取数据采集录制模式配置列表
CallerAutoPilotManager.getBadCaseConfig(0, 0, listOf())
CallerAutoPilotControlManager.getBadCaseConfig(0, 0, listOf())
recordTypesList.add(RecordTypeEntity(0,"自定义", arrayListOf()))
}

View File

@@ -11,7 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordCaseEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.zhjt.mogo_core_function_devatools.R;
@@ -77,7 +77,7 @@ public class CaseListDialog extends Dialog implements IMoGoAutopilotRecordListen
super.onAttachedToWindow();
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
//获取数据采集录制模式配置列表
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(0, 0,new ArrayList<>());
}
@Override

View File

@@ -17,7 +17,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.mogo.eagle.core.data.badcase.RecordTypeEntity;
import com.mogo.eagle.core.data.badcase.TopicEntity;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
@@ -69,7 +69,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
init();
initEvent();
//获取所有Topic
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
if (recordType != null) {
tvCaseName.setText(recordType.getDesc());
if (recordType.getTopicsList().size() > 0) {
@@ -160,7 +160,7 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
});
tvSave.setOnClickListener(v -> {
if (recordType != null) {
Boolean success = CallerAutoPilotManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList);
Boolean success = CallerAutoPilotControlManager.INSTANCE.getBadCaseConfig(2, recordType.getId(), addTopicList);
if (Boolean.TRUE.equals(success)) {
ToastUtils.showShort("Topic设置成功");
if (recordType.getId() == 0) {

View File

@@ -14,11 +14,12 @@ import android.widget.TextView
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.badcase.RecordCaseEntity
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
@@ -35,7 +36,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.io.File
import java.util.*
@@ -347,7 +347,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
if (recordCaseEntity != null) {
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
recordCaseEntity.caseId,
Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration,
@@ -355,7 +355,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
recordCaseEntity.topicList
)
} else {
CallerAutoPilotManager.recordPackage(
CallerAutoPilotControlManager.recordPackage(
BadCaseConfig.type, Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration
)
@@ -394,7 +394,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}

View File

@@ -15,6 +15,7 @@ import android.widget.TextView
import com.google.android.flexbox.FlexboxLayout
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.RecordBagMsg
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
@@ -34,7 +35,6 @@ import com.zhjt.mogo_core_function_devatools.badcase.record.RecordManager
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import me.jessyan.autosize.utils.AutoSizeUtils
import mogo.telematics.pad.MessagePad
import org.greenrobot.eventbus.EventBus
import java.io.File
@@ -380,9 +380,9 @@ class PassiveBadCaseWindow constructor(activity: Activity) : View.OnTouchListene
fun closeWindow()
}
override fun onChassisLocationWGS84(gnssInfo: MessagePad.GnssInfo) {
latitude = gnssInfo?.latitude
longitude = gnssInfo?.longitude
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
latitude = gnssInfo.latitude
longitude = gnssInfo.longitude
}
}

View File

@@ -15,7 +15,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.BIZ_FULL_LOG
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig.Companion.FOUNDATION
import com.mogo.eagle.core.function.api.map.deva.IMoGoMapDevaProvider
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapDevaListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -220,7 +220,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
Logger.init(LogLevel.DEBUG)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = true
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = true
CallerAutoPilotManager.setEnableLog(true)
CallerAutoPilotControlManager.setEnableLog(true)
}
/**
@@ -230,7 +230,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
Logger.init(if (DebugConfig.isDebug()) LogLevel.DEBUG else LogLevel.OFF)
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowDebugLog = false
MoGoAiCloudClient.getInstance().aiCloudClientConfig.isShowNetDebugLog = false
CallerAutoPilotManager.setEnableLog(false)
CallerAutoPilotControlManager.setEnableLog(false)
}
override fun onError(errorCount: Int) {

View File

@@ -41,7 +41,7 @@ internal class CanImpl(ctx: Context) :
private val state: AtomicInteger by lazy { AtomicInteger(Int.MIN_VALUE) }
override fun onCreate() {
send(CanStatus(CallerAutoPilotManager.isConnected()))
send(CanStatus(CallerAutoPilotControlManager.isConnected()))
CallerChassisAccStateListenerManager.addListener(TAG, this)
CallerChassisBrakeStateListenerManager.addListener(TAG, this)
@@ -60,7 +60,7 @@ internal class CanImpl(ctx: Context) :
private fun isCanEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
return CallerAutoPilotManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
return CallerAutoPilotControlManager.isConnected() && code != "EHW_CAN" && (state.get() == Int.MIN_VALUE || state.get() == 0)
}

View File

@@ -28,7 +28,7 @@ internal class IpcImpl(ctx: Context): IFlow<IpcStatus>(ctx), IMoGoAutopilotStatu
}
private fun checkAndSend() {
send(IpcStatus(CallerAutoPilotManager.isConnected()))
send(IpcStatus(CallerAutoPilotControlManager.isConnected()))
}
override fun onDestroy() {

View File

@@ -2,9 +2,10 @@ package com.zhjt.mogo_core_function_devatools.status.flow.rtk
import android.content.Context
import android.util.Log
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -15,7 +16,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import mogo.telematics.pad.MessagePad.GnssInfo
import system_master.SystemStatusInfo.HealthInfo
import system_master.SystemStatusInfo.StatusInfo
import java.util.concurrent.atomic.AtomicBoolean
@@ -42,7 +42,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
CallerLogger.d("$M_DEVA$TAG", "-- onCreate --")
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
if (CallerAutoPilotManager.isConnected()) {
if (CallerAutoPilotControlManager.isConnected()) {
check()
}
}
@@ -53,7 +53,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
}
check?.takeIf { it.isActive }?.cancel()
launch(Dispatchers.Unconfined) {
CallerAutoPilotManager.sendStatusQueryReq()
CallerAutoPilotControlManager.sendStatusQueryReq()
delay(5000)
isOldVersion.set(true)
}.also {
@@ -74,18 +74,18 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotManager.isConnected()) {
if (!CallerAutoPilotControlManager.isConnected()) {
CallerLogger.d("$M_DEVA$TAG", "工控机断开了....")
healthInfo.set(null)
send(RTKStatus("", -1))
}
if (CallerAutoPilotManager.isConnected() && check == null && !isOldVersion.get()) {
if (CallerAutoPilotControlManager.isConnected() && check == null && !isOldVersion.get()) {
check()
}
}
override fun onChassisLocationWGS84(gnssInfo: GnssInfo) {
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
if (isOldVersion.get()) {
if (isRTKEnabled()) {
send(RTKStatus("RTK", 0))
@@ -103,7 +103,7 @@ internal class RTKImpl(ctx: Context): IFlow<RTKStatus>(ctx), IMoGoAutopilotStatu
private fun isRTKEnabled(): Boolean {
val code = CallerAutoPilotStatusListenerManager.getAutoPilotReportMessageCode()
val gnssInfo = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
return CallerAutoPilotManager.isConnected() && (
return CallerAutoPilotControlManager.isConnected() && (
code != "EHW_RTK" &&
code != "EHW_GNSS" &&
code != "ESYS_RTK_STATUS_FAULT" &&

View File

@@ -40,7 +40,7 @@ internal class TracingImpl(ctx: Context): IFlow<TracingStatus>(ctx), IMoGoAutopi
override fun onAutopilotIpcConnectStatusChanged(status: Int, reason: String?) {
super.onAutopilotIpcConnectStatusChanged(status, reason)
if (!CallerAutoPilotManager.isConnected()) {
if (!CallerAutoPilotControlManager.isConnected()) {
old = UNKNOWN
send(TracingStatus(UNKNOWN))
}

View File

@@ -19,7 +19,7 @@ internal class StatusModel : ViewModel() {
const val TAG = "StatusModel"
val DEFAULTS = Pair(null, ArrayList<Status>().also {
it += IpcStatus(CallerAutoPilotManager.isConnected())
it += IpcStatus(CallerAutoPilotControlManager.isConnected())
it += CanStatus(false)
it += TracingStatus(UNKNOWN)
it += RTKStatus("", -1)

View File

@@ -7,7 +7,7 @@ import com.mogo.commons.module.status.MogoStatusManager
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -51,7 +51,7 @@ object SyncConfig {
else -> {
}
}
AppConfigInfo.teleTimeStamp = CallerAutoPilotManager.getTeleTimeStamp()
AppConfigInfo.teleTimeStamp = CallerAutoPilotControlManager.getTeleTimeStamp()
logOutConfig(AppConfigInfo)
}