[dev_arch_opt_3.0]

[Change]
[
1、替换了V2X中的位置订阅回调
]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-01-16 20:22:25 +08:00
parent 55492abea1
commit db4d6a1771
4 changed files with 137 additions and 64 deletions

View File

@@ -1,16 +1,16 @@
package com.mogo.eagle.core.function.business.routeoverlay;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
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.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningTrajectoryListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningTrajectoryListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import org.jetbrains.annotations.NotNull;
@@ -26,7 +26,7 @@ import system_master.SystemStatusInfo;
public class MogoRouteOverlayManager implements
IMoGoPlanningTrajectoryListener,
IMoGoAutopilotStatusListener,
IMoGoMapLocationListener {
IMoGoChassisLocationGCJ02Listener {
private static volatile MogoRouteOverlayManager sInstance;
private static final String TAG = "Route";
@@ -35,13 +35,14 @@ public class MogoRouteOverlayManager implements
private final LinkedList<List<MessagePad.TrajectoryPoint>> queue = new LinkedList<>();
private MogoRouteOverlayManager() {}
private MogoRouteOverlayManager() {
}
public void init() {
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this, false);
CallerChassisLocationGCJ20ListenerManager.INSTANCE.addListener(TAG, this);
}
public static MogoRouteOverlayManager getInstance() {
@@ -64,10 +65,10 @@ public class MogoRouteOverlayManager implements
}
@Override
public void onLocationChanged(@org.jetbrains.annotations.Nullable MogoLocation location, int from, boolean isGps) {
// if (from != 1 || location == null) {
// return;
// }
public void onChassisLocationGCJ02(@Nullable MessagePad.GnssInfo gnssInfo) {
if (gnssInfo == null) {
return;
}
if (isArriveAtStation.get() && autopilotMode.get() != 1) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
@@ -81,7 +82,7 @@ public class MogoRouteOverlayManager implements
if (!queue.isEmpty()) {
List<MessagePad.TrajectoryPoint> items = queue.pollLast();
if (items != null && !items.isEmpty()) {
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, location.getBearing());
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, gnssInfo.getHeading());
}
}
}
@@ -122,5 +123,6 @@ public class MogoRouteOverlayManager implements
}
@Override
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {}
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
}
}