Merge remote-tracking branch 'origin/dev_arch_opt_3.0' into dev_arch_opt_3.0

# Conflicts:
#	core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.kt
This commit is contained in:
donghongyu
2023-02-02 19:25:40 +08:00
4 changed files with 18 additions and 21 deletions

View File

@@ -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<MapView?, MapPresenter?>(),
}
// 添加换肤监听
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<MapView?, MapPresenter?>(),
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<MapView?, MapPresenter?>(),
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<MapView?, MapPresenter?>(),
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

View File

@@ -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<MessagePad.Location>) {
fun handlePlanningData(locationList: List<MessagePad.Location>?) {
if (locationList.isNullOrEmpty()) return
val list: List<MessagePad.Location> = locationList
// 转成高德坐标系并存储
updateRoutePoints(list, mContext!!)

View File

@@ -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<MessagePad.Location> locationList) {
if (locationList == null || locationList.size() == 0) return;
List list = locationList;
// 转成高德坐标系并存储
MarkerDrawerManager.INSTANCE.updateRoutePoints(list, mContext);

View File

@@ -11,12 +11,19 @@ import mogo.telematics.pad.MessagePad
*/
object CallerPlanningRottingListenerManager : CallerBase<IMoGoPlanningRottingListener>() {
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