add log
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.service.routeoverlay;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
|
||||
@@ -17,7 +18,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils;
|
||||
import com.mogo.module.common.utils.DrivingDirectionUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -45,7 +46,7 @@ public class MogoRouteOverlayManager implements
|
||||
public void init() {
|
||||
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,this);
|
||||
CallerMapLocationListenerManager.INSTANCE.addListener(TAG, this);
|
||||
// intiDrawer();
|
||||
}
|
||||
|
||||
@@ -60,7 +61,7 @@ public class MogoRouteOverlayManager implements
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
private void intiDrawer(){
|
||||
private void intiDrawer() {
|
||||
RouteOverlayDrawer.getInstance(mContext).initdraw();
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ public class MogoRouteOverlayManager implements
|
||||
|
||||
mTrajectoryList = mogoLatLngs;
|
||||
builder.append("}");
|
||||
//Log.d(TAG,builder.toString());
|
||||
Log.d(TAG, builder.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,13 +111,13 @@ public class MogoRouteOverlayManager implements
|
||||
latLngList.add(new MogoLatLng(routeModel.getLat(), routeModel.getLon()));
|
||||
}
|
||||
int listSize = latLngList.size();
|
||||
mEnding = latLngList.get(listSize-1);
|
||||
mEnding = latLngList.get(listSize - 1);
|
||||
// RouteOverlayDrawer.getInstance(mContext).addEndingMarker(latLngList.get(listSize - 1).lat,latLngList.get(listSize - 1).lon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData ){
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData) {
|
||||
return;
|
||||
}
|
||||
this.STATUS_AUTOPILOT = autoPilotStatusInfo.getControl_pilotmode();
|
||||
@@ -128,7 +129,7 @@ public class MogoRouteOverlayManager implements
|
||||
// }else {
|
||||
//
|
||||
// }我
|
||||
if ( STATUS_AUTOPILOT != 1){
|
||||
if (STATUS_AUTOPILOT != 1) {
|
||||
RouteOverlayDrawer.getInstance(mContext).clearEndingMarker();
|
||||
RouteOverlayDrawer.getInstance(mContext).clearMogoRouteOverlay();
|
||||
}
|
||||
@@ -137,7 +138,7 @@ public class MogoRouteOverlayManager implements
|
||||
@Override
|
||||
public void onAutopilotArriveAtStation(@Nullable AutopilotStationInfo autopilotWayArrive) {
|
||||
|
||||
if(autopilotWayArrive == null){
|
||||
if (autopilotWayArrive == null) {
|
||||
return;
|
||||
}
|
||||
Logger.d(TAG, "onArriveAt data : " + autopilotWayArrive.toString());
|
||||
@@ -156,18 +157,26 @@ public class MogoRouteOverlayManager implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@Nullable MogoLocation location) {
|
||||
public void onLocationChanged(@Nullable MogoLocation location) { //todo 拖尾
|
||||
mLocation = location;
|
||||
if (mTrajectoryList.isEmpty()){
|
||||
if (mTrajectoryList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
ArrayList list = new ArrayList();
|
||||
for (MogoLatLng latLng:mTrajectoryList) {
|
||||
if(!isPointOnCarFront(mLocation,latLng)){
|
||||
ArrayList list = new ArrayList();
|
||||
for (MogoLatLng latLng : mTrajectoryList) {
|
||||
if (!isPointOnCarFront(mLocation, latLng)) {
|
||||
list.add(latLng);
|
||||
}
|
||||
}
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1){
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
MogoLatLng latLng = (MogoLatLng) list.get(i);
|
||||
builder.append(latLng.getLon()).append(",");
|
||||
builder.append(latLng.getLat()).append(",");
|
||||
}
|
||||
Log.d(TAG, "onLocationChanged : " + GsonUtils.toJson(builder.toString()));
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1) {
|
||||
RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(list);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user