Fix calculation

This commit is contained in:
Victor Shcherb 2020-07-10 20:03:31 +02:00
parent 2b23c7e8ca
commit 386c7dc3f4

View file

@ -140,9 +140,13 @@ public class RouteCalculationResult {
OsmandApplication ctx, boolean leftSide, RoutingContext rctx, List<LocationPoint> waypoints, ApplicationMode mode) { OsmandApplication ctx, boolean leftSide, RoutingContext rctx, List<LocationPoint> waypoints, ApplicationMode mode) {
if (rctx != null) { if (rctx != null) {
this.routingTime = rctx.routingTime; this.routingTime = rctx.routingTime;
this.visitedSegments = rctx.visitedSegments; this.visitedSegments = rctx.getVisitedSegments();
this.loadedTiles = rctx.loadedTiles; this.loadedTiles = rctx.getLoadedTiles();
this.calculateTime = (float) (((System.nanoTime() - rctx.timeToCalculate) / 1e6) / 1000f); if (rctx.calculationProgress != null) {
this.calculateTime = (float) (rctx.calculationProgress.timeToCalculate / 1.0e9);
} else {
this.calculateTime = 0;
}
} else { } else {
this.routingTime = 0; this.routingTime = 0;
this.visitedSegments = 0; this.visitedSegments = 0;