Statistics: distance, total time, moving time are counted between automatic segments.

Fixes #1566.
This commit is contained in:
Dennis Guse
2023-05-31 17:25:09 +02:00
parent 3f891f7fb4
commit 11c5ec43e2
6 changed files with 26 additions and 26 deletions
@@ -130,11 +130,11 @@ public class TrackPoint {
return this;
}
public boolean isSegmentStart() {
return type == Type.SEGMENT_START_AUTOMATIC || type == Type.SEGMENT_START_MANUAL;
public boolean isSegmentManualStart() {
return type == Type.SEGMENT_START_MANUAL;
}
public boolean isSegmentEnd() {
public boolean isSegmentManualEnd() {
return type == Type.SEGMENT_END_MANUAL;
}
@@ -38,6 +38,7 @@ import de.dennisguse.opentracks.data.models.TrackPoint;
*/
//TODO Use null instead of Double.isInfinite
//TODO Check that data ranges are valid (not less than zero etc.)
//TODO Should be a Java record
public class TrackStatistics {
// The min and max altitude (meters) seen on this track.
@@ -95,7 +95,7 @@ public class TrackStatisticsUpdater {
*
*/
public void addTrackPoint(TrackPoint trackPoint) {
if (trackPoint.isSegmentStart()) {
if (trackPoint.isSegmentManualStart()) {
reset(trackPoint);
}
@@ -154,7 +154,7 @@ public class TrackStatisticsUpdater {
updateSpeed(trackPoint, lastTrackPoint);
}
if (trackPoint.isSegmentEnd()) {
if (trackPoint.isSegmentManualEnd()) {
reset(trackPoint);
return;
}