forked from upstream-mirrors/OpenTracks
Statistics: distance, total time, moving time are counted between automatic segments.
Fixes #1566.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user