diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt index 799648d27e..b1b6ae996b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt @@ -30,11 +30,12 @@ import com.mogo.eagle.core.function.overview.InfStructureManager import com.mogo.eagle.core.function.overview.InfStructureManager.savePlanningData import com.mogo.eagle.core.function.overview.obtainViewModel import com.mogo.eagle.core.function.overview.vm.OverViewModel +import com.mogo.eagle.core.function.datacenter.location.IMoGoLocationListener +import com.mogo.eagle.core.function.datacenter.location.MoGoLocationManager import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr -import com.mogo.eagle.core.utilcode.util.UiThreadHandler import com.mogo.eagle.core.utilcode.util.Utils import com.mogo.map.IMogoMap import com.mogo.map.MogoMapView @@ -113,7 +114,6 @@ class MapFragment : MvpFragment(), } // 添加换肤监听 CallerSkinModeListenerManager.addListener(Companion.functionName, this) - CallerPlanningRottingListenerManager.addListener(Companion.functionName, this) CallerChassisLocationWGS84ListenerManager.addListener(Companion.functionName, this) CallerChassisLamplightListenerManager.addListener(Companion.functionName, this) } @@ -200,15 +200,6 @@ class MapFragment : MvpFragment(), MogoRouteOverlayManager.getInstance().init() MapPointCloudSubscriber.instance SpeedLimitDataManager.getInstance().start() - - // TODO GD地图业务需要与高精地图业务拆开 --- 扶风 - queryInfStructure() - } - - private fun queryInfStructure() { - val viewModel = this.obtainViewModel(OverViewModel::class.java) - viewModel.infStructuresMap.observe(this.viewLifecycleOwner) { t -> InfStructureManager.saveData(t) } - viewModel.fetchInfStructures() } override fun getUIController(): IMogoMapUIController { @@ -217,7 +208,6 @@ class MapFragment : MvpFragment(), override fun onDestroyView() { CallerSkinModeListenerManager.removeListener(Companion.functionName) - CallerPlanningRottingListenerManager.removeListener(Companion.functionName) CallerChassisLocationWGS84ListenerManager.removeListener(Companion.functionName) CallerChassisLamplightListenerManager.removeListener(Companion.functionName) @@ -334,11 +324,6 @@ class MapFragment : MvpFragment(), override val functionName: String get() = functionName - // TODO 全览模式需要自己监听 --- 扶风 - override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { - UiThreadHandler.post { savePlanningData(globalPathResp!!.wayPointsList) } - } - private var turnLightTimes = 0 private var isOnTurnLight = false private var turnLight = 0 diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt index 008288d122..ac8567895b 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/overview/view/OverMapView.kt @@ -270,12 +270,14 @@ class OverMapView @JvmOverloads constructor( * 室内某个bag包自动驾驶启动8s后返回 */ override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { - Log.d(TAG, "onAutopilotRotting") - handlePlanningData(globalPathResp!!.wayPointsList) + globalPathResp?.let { + handlePlanningData(it.wayPointsList) + } } } - fun handlePlanningData(locationList: List) { + fun handlePlanningData(locationList: List?) { + if (locationList.isNullOrEmpty()) return val list: List = locationList // 转成高德坐标系并存储 updateRoutePoints(list, mContext!!) diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java index 528ebcd696..033d1d3828 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/AMapCustomView.java @@ -225,11 +225,14 @@ public class AMapCustomView @Override public void onAutopilotRotting(@org.jetbrains.annotations.Nullable MessagePad.GlobalPathResp globalPathResp) { Log.d(TAG, "onAutopilotRotting"); - handlePlanningData(globalPathResp.getWayPointsList()); + if (globalPathResp != null) { + handlePlanningData(globalPathResp.getWayPointsList()); + } } }; public void handlePlanningData(List locationList) { + if (locationList == null || locationList.size() == 0) return; List list = locationList; // 转成高德坐标系并存储 MarkerDrawerManager.INSTANCE.updateRoutePoints(list, mContext); diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt index b3c1d7d43f..157e6c5825 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerPlanningRottingListenerManager.kt @@ -11,12 +11,19 @@ import mogo.telematics.pad.MessagePad */ object CallerPlanningRottingListenerManager : CallerBase() { + private var globalPathResp: MessagePad.GlobalPathResp? = null + + override fun doSomeAfterAddListener(tag: String, listener: IMoGoPlanningRottingListener) { + listener.onAutopilotRotting(globalPathResp) + } + /** * 路径规划 回调 * @param globalPathResp 自动驾驶网约车回调数据 */ @Synchronized fun invokeAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) { + this.globalPathResp = globalPathResp M_LISTENERS.forEach { val tag = it.key val listener = it.value