mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 17:43:06 +02:00
Cleanup: SegmentStatisticUpdater.
This commit is contained in:
@@ -218,10 +218,6 @@ public class SegmentStatisticUpdater {
|
||||
);
|
||||
}
|
||||
|
||||
public Instant getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Should only be called on start.
|
||||
*/
|
||||
@@ -247,9 +243,8 @@ public class SegmentStatisticUpdater {
|
||||
totalDistance = totalDistance.plus(distance_m);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setTotalTime(Duration totalTime) {
|
||||
this.totalTime = totalTime;
|
||||
public void updateTotalTime(Instant now) {
|
||||
this.totalTime = Duration.between(startTime, now);
|
||||
}
|
||||
|
||||
public void addMovingTime(TrackPoint trackPoint, TrackPoint lastTrackPoint) {
|
||||
|
||||
@@ -111,7 +111,7 @@ public class TrackStatisticsUpdater {
|
||||
|
||||
// Always update time
|
||||
currentSegment.setStopTime(trackPoint.getTime());
|
||||
currentSegment.setTotalTime(Duration.between(currentSegment.getStartTime(), trackPoint.getTime()));
|
||||
currentSegment.updateTotalTime(trackPoint.getTime());
|
||||
|
||||
// Process sensor data: barometer
|
||||
if (trackPoint.hasAltitudeGainLoss()) {
|
||||
|
||||
Reference in New Issue
Block a user