Test new dbg format
This commit is contained in:
parent
d62494a8c4
commit
f7278f731f
5 changed files with 14 additions and 4 deletions
|
@ -92,7 +92,7 @@ public class RoutingContext {
|
|||
long timeToLoad = 0;
|
||||
long timeToLoadHeaders = 0;
|
||||
long timeToFindInitialSegments = 0;
|
||||
long timeToCalculate = 0;
|
||||
public long timeToCalculate = 0;
|
||||
|
||||
int distinctLoadedTiles = 0;
|
||||
int maxLoadedTiles = 0;
|
||||
|
|
|
@ -2911,7 +2911,7 @@
|
|||
<string name="error_calculating_route">Could not calculate route</string>
|
||||
<string name="error_calculating_route_occured">Could not calculate route</string>
|
||||
<string name="empty_route_calculated">Calculated route is empty</string>
|
||||
<string name="new_route_calculated_dist_dbg">Route calculated (internal): distance %s, router time %s (%d tiles, %d segments)</string>
|
||||
<string name="new_route_calculated_dist_dbg">Route calculated (internal): distance %s, router time %s (%.1f sec, %d tiles, %d roads)</string>
|
||||
<string name="arrived_at_destination">You have arrived at your destination</string>
|
||||
<string name="invalid_locations">Invalid coordinates</string>
|
||||
<string name="go_back_to_osmand">Go back to OsmAnd map</string>
|
||||
|
|
|
@ -42,6 +42,7 @@ public class RouteCalculationResult {
|
|||
private final float routingTime;
|
||||
private final int visitedSegments;
|
||||
private final int loadedTiles;
|
||||
private final float calculateTime;
|
||||
|
||||
protected int cacheCurrentTextDirectionInfo = -1;
|
||||
protected List<RouteDirectionInfo> cacheAgreggatedDirections;
|
||||
|
@ -61,6 +62,7 @@ public class RouteCalculationResult {
|
|||
this.routingTime = 0;
|
||||
this.loadedTiles = 0;
|
||||
this.visitedSegments = 0;
|
||||
this.calculateTime = 0;
|
||||
this.intermediatePoints = new int[0];
|
||||
this.locations = new ArrayList<Location>();
|
||||
this.segments = new ArrayList<RouteSegmentResult>();
|
||||
|
@ -72,6 +74,7 @@ public class RouteCalculationResult {
|
|||
public RouteCalculationResult(List<Location> list, List<RouteDirectionInfo> directions, RouteCalculationParams params, List<LocationPoint> waypoints, boolean addMissingTurns) {
|
||||
this.routingTime = 0;
|
||||
this.loadedTiles = 0;
|
||||
this.calculateTime = 0;
|
||||
this.visitedSegments = 0;
|
||||
this.errorMessage = null;
|
||||
this.intermediatePoints = new int[params.intermediates == null ? 0 : params.intermediates.size()];
|
||||
|
@ -106,6 +109,7 @@ public class RouteCalculationResult {
|
|||
this.routingTime = rctx.routingTime;
|
||||
this.visitedSegments = rctx.visitedSegments;
|
||||
this.loadedTiles = rctx.loadedTiles;
|
||||
this.calculateTime = (float) (((System.nanoTime() - rctx.timeToCalculate) / 1e6) / 1000f);
|
||||
if(waypoints != null) {
|
||||
this.locationPoints.addAll(waypoints);
|
||||
}
|
||||
|
@ -822,6 +826,10 @@ public class RouteCalculationResult {
|
|||
return visitedSegments;
|
||||
}
|
||||
|
||||
public float getCalculateTime() {
|
||||
return calculateTime;
|
||||
}
|
||||
|
||||
public int getLoadedTiles() {
|
||||
return loadedTiles;
|
||||
}
|
||||
|
|
|
@ -734,7 +734,9 @@ public class RoutingHelper {
|
|||
if (showToast.value && OsmandPlugin.isDevelopment()) {
|
||||
String msg = app.getString(R.string.new_route_calculated_dist_dbg,
|
||||
OsmAndFormatter.getFormattedDistance(res.getWholeDistance(), app),
|
||||
((int)res.getRoutingTime()) + " sec", res.getVisitedSegments(), res.getLoadedTiles());
|
||||
|
||||
((int)res.getRoutingTime()) + " sec",
|
||||
res.getCalculateTime(), res.getVisitedSegments(), res.getLoadedTiles());
|
||||
app.showToastMessage(msg);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue