mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-03 01:53:05 +02:00
Idle: move idle into TrackStatistics.
This commit is contained in:
@@ -61,6 +61,8 @@ public class TrackStatistics {
|
||||
// The average heart rate seen on this track
|
||||
private HeartRate avgHeartRate = null;
|
||||
|
||||
private boolean isIdle;
|
||||
|
||||
public TrackStatistics() {
|
||||
reset();
|
||||
}
|
||||
@@ -81,6 +83,7 @@ public class TrackStatistics {
|
||||
totalAltitudeGain_m = other.totalAltitudeGain_m;
|
||||
totalAltitudeLoss_m = other.totalAltitudeLoss_m;
|
||||
avgHeartRate = other.avgHeartRate;
|
||||
isIdle = other.isIdle;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -168,6 +171,8 @@ public class TrackStatistics {
|
||||
setMaxSpeed(Speed.zero());
|
||||
setTotalAltitudeGain(null);
|
||||
setTotalAltitudeLoss(null);
|
||||
|
||||
isIdle = false;
|
||||
}
|
||||
|
||||
public void reset(Instant startTime) {
|
||||
@@ -248,6 +253,14 @@ public class TrackStatistics {
|
||||
return totalTime.minus(movingTime);
|
||||
}
|
||||
|
||||
public boolean isIdle() {
|
||||
return isIdle;
|
||||
}
|
||||
|
||||
public void setIdle(boolean idle) {
|
||||
isIdle = idle;
|
||||
}
|
||||
|
||||
public boolean hasAverageHeartRate() {
|
||||
return avgHeartRate != null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user