Remove calculate route between points

This commit is contained in:
Vitaliy 2020-08-17 21:50:30 +03:00
parent ccefa2c4e1
commit a6c4456ca4
5 changed files with 4 additions and 27 deletions

View file

@ -503,15 +503,8 @@ public class MapActivityActions implements DialogProvider {
mapActivity.getRoutingHelper().setGpxParams(null);
settings.FOLLOW_THE_GPX_ROUTE.set(null);
} else {
GPXRouteParamsBuilder params = new GPXRouteParamsBuilder(result, mapActivity.getMyApplication()
.getSettings());
if (result.hasRtePt() && !result.hasTrkPt()) {
settings.GPX_CALCULATE_RTEPT.set(true);
} else {
settings.GPX_CALCULATE_RTEPT.set(false);
}
GPXRouteParamsBuilder params = new GPXRouteParamsBuilder(result, settings);
params.setCalculateOsmAndRouteParts(settings.GPX_ROUTE_CALC_OSMAND_PARTS.get());
params.setUseIntermediatePointsRTE(settings.GPX_CALCULATE_RTEPT.get());
params.setCalculateOsmAndRoute(settings.GPX_ROUTE_CALC.get());
List<Location> ps = params.getPoints(settings.getContext());
mapActivity.getRoutingHelper().setGpxParams(params);

View file

@ -131,9 +131,6 @@ public class FailSafeFuntions {
if (settings.GPX_ROUTE_CALC_OSMAND_PARTS.get()) {
gpxRoute.setCalculateOsmAndRouteParts(true);
}
if (settings.GPX_CALCULATE_RTEPT.get()) {
gpxRoute.setUseIntermediatePointsRTE(true);
}
if(settings.GPX_ROUTE_CALC.get()) {
gpxRoute.setCalculateOsmAndRoute(true);
}

View file

@ -265,9 +265,6 @@ public class RoutingOptionsHelper {
settings.GPX_ROUTE_CALC_OSMAND_PARTS.set(selected);
} else if (gpxParam.id == R.string.gpx_option_from_start_point) {
rp.setPassWholeRoute(selected);
} else if (gpxParam.id == R.string.use_points_as_intermediates) {
settings.GPX_CALCULATE_RTEPT.set(selected);
rp.setUseIntermediatePointsRTE(selected);
} else if (gpxParam.id == R.string.calculate_osmand_route_gpx) {
settings.GPX_ROUTE_CALC.set(selected);
rp.setCalculateOsmAndRoute(selected);
@ -467,11 +464,6 @@ public class RoutingOptionsHelper {
GPXRouteParamsBuilder rparams = routingHelper.getCurrentGPXRoute();
boolean osmandRouter = am.getRouteService() == RouteService.OSMAND;
if (rparams != null && osmandRouter) {
GPXUtilities.GPXFile fl = rparams.getFile();
if (fl.hasRtePt()) {
list.add(new OtherLocalRoutingParameter(R.string.use_points_as_intermediates,
app.getString(R.string.use_points_as_intermediates), rparams.isUseIntermediatePointsRTE()));
}
if (!routingHelper.isCurrentGPXRouteV2()) {
list.add(new OtherLocalRoutingParameter(R.string.gpx_option_reverse_route,
app.getString(R.string.gpx_option_reverse_route), rparams.isReverse()));

View file

@ -165,7 +165,6 @@ public class RouteProvider {
private boolean leftSide;
private boolean passWholeRoute;
private boolean calculateOsmAndRouteParts;
private boolean useIntermediatePointsRTE;
public GPXRouteParamsBuilder(GPXFile file, OsmandSettings settings) {
leftSide = settings.DRIVING_REGION.get().leftHandDriving;
@ -184,12 +183,8 @@ public class RouteProvider {
this.calculateOsmAndRouteParts = calculateOsmAndRouteParts;
}
public void setUseIntermediatePointsRTE(boolean useIntermediatePointsRTE) {
this.useIntermediatePointsRTE = useIntermediatePointsRTE;
}
public boolean isUseIntermediatePointsRTE() {
return useIntermediatePointsRTE;
return file.hasRtePt() && !file.hasTrkPt();
}
public boolean isCalculateOsmAndRoute() {
@ -277,7 +272,7 @@ public class RouteProvider {
boolean reverse = builder.reverse;
passWholeRoute = builder.passWholeRoute;
calculateOsmAndRouteParts = builder.calculateOsmAndRouteParts;
useIntermediatePointsRTE = builder.useIntermediatePointsRTE;
useIntermediatePointsRTE = builder.isUseIntermediatePointsRTE();
builder.calculateOsmAndRoute = false; // Disabled temporary builder.calculateOsmAndRoute;
if (!file.isPointsEmpty()) {
wpt = new ArrayList<LocationPoint>(file.getPoints().size());

View file

@ -2182,7 +2182,7 @@ public class OsmandSettings {
}.makeProfile().cache();
public final OsmandPreference<Boolean> GPX_ROUTE_CALC_OSMAND_PARTS = new BooleanPreference("gpx_routing_calculate_osmand_route", true).makeGlobal().cache();
public final OsmandPreference<Boolean> GPX_CALCULATE_RTEPT = new BooleanPreference("gpx_routing_calculate_rtept", true).makeGlobal().cache();
// public final OsmandPreference<Boolean> GPX_CALCULATE_RTEPT = new BooleanPreference("gpx_routing_calculate_rtept", true).makeGlobal().cache();
public final OsmandPreference<Boolean> GPX_ROUTE_CALC = new BooleanPreference("calc_gpx_route", false).makeGlobal().cache();
public final OsmandPreference<Boolean> AVOID_TOLL_ROADS = new BooleanPreference("avoid_toll_roads", false).makeProfile().cache();