From cc8b8f85e13b4967f186e17139fc92c8a71f1481 Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 4 Nov 2016 14:53:39 +0100 Subject: [PATCH] remove heuristic test code - should be ok for now --- OsmAnd/src/net/osmand/plus/GPXUtilities.java | 18 ++++++++---------- .../net/osmand/plus/helpers/GpxUiHelper.java | 11 +++++------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/GPXUtilities.java b/OsmAnd/src/net/osmand/plus/GPXUtilities.java index 652c26208f..e0e2256a17 100644 --- a/OsmAnd/src/net/osmand/plus/GPXUtilities.java +++ b/OsmAnd/src/net/osmand/plus/GPXUtilities.java @@ -251,9 +251,9 @@ public class GPXUtilities { public long startTime = Long.MAX_VALUE; public long endTime = Long.MIN_VALUE; public long timeSpan = 0; - //*****Issue 3222, for testing only - public long timeMoving0 = 0; - public float totalDistanceMoving0 = 0; + //Next few lines for Issue 3222 heuristic testing only + //public long timeMoving0 = 0; + //public float totalDistanceMoving0 = 0; public long timeMoving = 0; public float totalDistanceMoving = 0; @@ -424,17 +424,15 @@ public class GPXUtilities { // Motion detection: // speed > 0 uses GPS chipset's motion detection // calculations[0] > minDisplacment * time is heuristic needed because tracks may be filtered at recording time, so points at rest may not be present in file at all - - //*****Issue 3222, for testing only - if (speed > 0 && point.time != 0 && prev.time != 0) { - timeMoving0 = timeMoving0 + (point.time - prev.time); - totalDistanceMoving0 += calculations[0]; - } - if ((speed > 0) && (calculations[0] > 0.1 / 1000f * (point.time - prev.time)) && point.time != 0 && prev.time != 0) { timeMoving = timeMoving + (point.time - prev.time); totalDistanceMoving += calculations[0]; } + //Next few lines for Issue 3222 heuristic testing only + // if (speed > 0 && point.time != 0 && prev.time != 0) { + // timeMoving0 = timeMoving0 + (point.time - prev.time); + // totalDistanceMoving0 += calculations[0]; + // } } } } diff --git a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java index 2a024abe91..e6ca28516d 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/GpxUiHelper.java @@ -133,12 +133,11 @@ public class GpxUiHelper { // 3. Time moving, if any if (analysis.isTimeMoving()) { - //*****Issue 3222, for testing only - final String formatDuration0 = Algorithms.formatDuration((int) (analysis.timeMoving0 / 1000), app.accessibilityEnabled()); - description.append(nl).append(app.getString(R.string.gpx_timemoving, - getColorValue(timeSpanClr, formatDuration0, html))); - description.append(" (" + getColorValue(distanceClr, OsmAndFormatter.getFormattedDistance(analysis.totalDistanceMoving0, app), html) + ")"); - + //Next few lines for Issue 3222 heuristic testing only + //final String formatDuration0 = Algorithms.formatDuration((int) (analysis.timeMoving0 / 1000), app.accessibilityEnabled()); + //description.append(nl).append(app.getString(R.string.gpx_timemoving, + // getColorValue(timeSpanClr, formatDuration0, html))); + //description.append(" (" + getColorValue(distanceClr, OsmAndFormatter.getFormattedDistance(analysis.totalDistanceMoving0, app), html) + ")"); final String formatDuration = Algorithms.formatDuration((int) (analysis.timeMoving / 1000), app.accessibilityEnabled()); description.append(nl).append(app.getString(R.string.gpx_timemoving, getColorValue(timeSpanClr, formatDuration, html)));