[dev_arch_opt_3.0][fix]修正因位置回调重构造成的v2x事件不显示问题

This commit is contained in:
renwj
2023-01-30 19:11:06 +08:00
parent 0b84b3855e
commit 2baf4aa785
9 changed files with 66 additions and 219 deletions

View File

@@ -10,23 +10,24 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.zhidaoauto.map.operational.open.GatherApi
import com.zhidaoauto.map.operational.open.GatherParams
import com.zhidaoauto.map.operational.open.abs.OnTaskListener
import mogo.telematics.pad.MessagePad.GnssInfo
import record_cache.RecordPanelOuterClass
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicReference
@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER)
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback,
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
IMoGoAutopilotRecordListener {
companion object {
@@ -52,7 +53,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
override fun init(context: Context?) {
CallerMapLocationListenerManager.addListener(TAG, this, false)
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
CallerAutopilotRecordListenerManager.addListener(TAG, this)
executor.set(context?.let {
@@ -74,7 +75,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
override fun onDestroy() {
CallerLogger.d("$M_MAP$TAG", "--------- onDestroy --------")
CallerMapLocationListenerManager.removeListener(TAG, false)
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
CallerAutopilotRecordListenerManager.removeListener(TAG)
executor.get()?.setOnTaskListener(null)
listeners.clear()
@@ -170,18 +171,17 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
}
}
override fun onLocationChanged(location: MogoLocation?, from: Int, isGps: Boolean) {
location ?: return
override fun onChassisLocationGCJ02(gnssInfo: GnssInfo?) {
val location = CallerMapLocationListenerManager.getCurrentLocation() ?: return
executor.get()?.updateLocation(
location.longitude,
location.latitude,
location.longitude,
location.latitude,
location.altitude,
location.bearing,
location.speed,
isGps)
false)
}
private fun isInValidStatus(): Boolean {
if (map.isEmpty()) {
return true