2.12.0 fix ADCU 全局路径数据和自动驾驶状态不一致导致的 小地图轨迹被清除

This commit is contained in:
lianglihui
2022-11-08 16:41:11 +08:00
parent 633212a9fe
commit 620d1f8c3c

View File

@@ -15,7 +15,10 @@ import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -38,6 +41,7 @@ public class SmallMapFragment extends BaseFragment
IMoGoAutopilotStatusListener {
private final String TAG = "SmallMapFragment";
protected SmallMapDirectionView mSmallMapDirectionView;
private int autoPilotStatus = 0;
@Override
public void onAttach(Context context) {
@@ -139,8 +143,11 @@ public class SmallMapFragment extends BaseFragment
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
if (autoPilotStatusInfo.getPilotmode() != 1) {
autoPilotStatus = autoPilotStatusInfo.getPilotmode();
if (autoPilotStatus != 1) {
clearPolyline();
}else if (autoPilotStatus == 1){
CallerAutoPilotManager.INSTANCE.getGlobalPath();
}
}
@@ -172,7 +179,7 @@ public class SmallMapFragment extends BaseFragment
for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) {
latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
}
if (latLngList.size() > 0) {
if (latLngList.size() > 0 && autoPilotStatus ==1) {
drawablePolyline(latLngList);
} else {
clearPolyline();