Cleanup: rename to totalDuration and movingDuration.

This commit is contained in:
Dennis Guse
2025-11-11 21:28:53 +01:00
committed by Dennis Guse
parent 59ea50b96f
commit 4307dceb70
16 changed files with 65 additions and 67 deletions
@@ -209,8 +209,8 @@ public class ExportImportTest {
assertEquals(Instant.parse("2020-02-02T02:02:02Z"), trackStatistics.startTime());
assertEquals(Instant.parse("2020-02-02T02:04:00Z"), trackStatistics.stopTime());
assertEquals(Duration.ofSeconds(56), trackStatistics.totalTime());
assertEquals(Duration.ofSeconds(26), trackStatistics.movingTime()); //TODO Likely too low
assertEquals(Duration.ofSeconds(56), trackStatistics.totalDuration());
assertEquals(Duration.ofSeconds(26), trackStatistics.movingDuration()); //TODO Likely too low
// Distance
assertEquals(222049.34375, trackStatistics.totalDistance().toM(), 0.01); //TODO Too low
@@ -333,8 +333,8 @@ public class ExportImportTest {
assertEquals(Instant.parse("2020-02-02T02:02:02Z"), importedTrackStatistics.startTime());
assertEquals(Instant.parse("2020-02-02T02:04:00Z"), importedTrackStatistics.stopTime());
assertEquals(Duration.ofSeconds(56), importedTrackStatistics.totalTime());
assertEquals(Duration.ofSeconds(26), importedTrackStatistics.movingTime());
assertEquals(Duration.ofSeconds(56), importedTrackStatistics.totalDuration());
assertEquals(Duration.ofSeconds(26), importedTrackStatistics.movingDuration());
// Distance
assertEquals(222049.421, importedTrackStatistics.totalDistance().toM(), 0.01);
@@ -473,8 +473,8 @@ public class ExportImportTest {
assertEquals(Instant.parse("2020-02-02T02:02:03Z"), importedTrackStatistics.startTime());
assertEquals(Instant.parse("2020-02-02T02:03:50Z"), importedTrackStatistics.stopTime());
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.totalTime());
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.movingTime());
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.totalDuration());
assertEquals(Duration.ofSeconds(107), importedTrackStatistics.movingDuration());
// Distance
assertEquals(222271.734, importedTrackStatistics.totalDistance().toM(), 0.01);
@@ -151,7 +151,7 @@ public class GPXTrackImporterTest {
// 3. trackstatistics
Statistics trackStatistics = importedTrack.getStatistics();
assertEquals(0.75, trackStatistics.maxSpeed().toMPS(), 0.01);
assertEquals(Duration.ofSeconds(101), trackStatistics.movingTime());
assertEquals(Duration.ofSeconds(101), trackStatistics.movingDuration());
// 4. trackpoints
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
@@ -206,7 +206,7 @@ public class GPXTrackImporterTest {
// 3. trackstatistics
Statistics trackStatistics = importedTrack.getStatistics();
assertEquals(5.0, trackStatistics.maxSpeed().toMPS(), 0.01);
assertEquals(Duration.ofSeconds(101), trackStatistics.movingTime());
assertEquals(Duration.ofSeconds(101), trackStatistics.movingDuration());
// 4. trackpoints
List<TrackPoint> importedTrackPoints = TestDataUtil.getTrackPoints(contentProviderUtils, importTrackId);
@@ -246,7 +246,7 @@ public class TrackStatisticsUpdaterTest {
));
// then
assertEquals(Duration.ofSeconds(35), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(35), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
}
@Test
@@ -276,7 +276,7 @@ public class TrackStatisticsUpdaterTest {
));
// then
assertEquals(Duration.ofSeconds(40), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(40), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
assertEquals(Distance.of(1040), subject.getSegmentStatisticUpdater().getStatistics().totalDistance());
}
@@ -294,8 +294,8 @@ public class TrackStatisticsUpdaterTest {
subject.addTrackPoint(new TrackPoint(TrackPoint.Type.IDLE, Instant.ofEpochSecond(30)));
// then
assertTrue(subject.getSegmentStatisticUpdater().isIdle());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().totalTime());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().totalDuration());
assertEquals(Distance.of(10), subject.getSegmentStatisticUpdater().getStatistics().totalDistance());
// when
@@ -304,8 +304,8 @@ public class TrackStatisticsUpdaterTest {
.setSensorDistance(Distance.ZERO));
// then
assertTrue(subject.getSegmentStatisticUpdater().isIdle());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(40), subject.getSegmentStatisticUpdater().getStatistics().totalTime());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
assertEquals(Duration.ofSeconds(40), subject.getSegmentStatisticUpdater().getStatistics().totalDuration());
assertEquals(Distance.of(10), subject.getSegmentStatisticUpdater().getStatistics().totalDistance());
// when
@@ -314,8 +314,8 @@ public class TrackStatisticsUpdaterTest {
.setSensorDistance(Distance.of(1)));
// then
assertTrue(subject.getSegmentStatisticUpdater().isIdle());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(45), subject.getSegmentStatisticUpdater().getStatistics().totalTime());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
assertEquals(Duration.ofSeconds(45), subject.getSegmentStatisticUpdater().getStatistics().totalDuration());
assertEquals(Distance.of(11), subject.getSegmentStatisticUpdater().getStatistics().totalDistance());
// when
@@ -324,8 +324,8 @@ public class TrackStatisticsUpdaterTest {
.setSensorDistance(Distance.of(10)));
// then
assertFalse(subject.getSegmentStatisticUpdater().isIdle());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(50), subject.getSegmentStatisticUpdater().getStatistics().totalTime());
assertEquals(Duration.ofSeconds(30), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
assertEquals(Duration.ofSeconds(50), subject.getSegmentStatisticUpdater().getStatistics().totalDuration());
assertEquals(Distance.of(21), subject.getSegmentStatisticUpdater().getStatistics().totalDistance());
// when
@@ -333,8 +333,8 @@ public class TrackStatisticsUpdaterTest {
// then
assertFalse(subject.getSegmentStatisticUpdater().isIdle());
assertEquals(Duration.ofSeconds(40), subject.getSegmentStatisticUpdater().getStatistics().movingTime());
assertEquals(Duration.ofSeconds(60), subject.getSegmentStatisticUpdater().getStatistics().totalTime());
assertEquals(Duration.ofSeconds(40), subject.getSegmentStatisticUpdater().getStatistics().movingDuration());
assertEquals(Duration.ofSeconds(60), subject.getSegmentStatisticUpdater().getStatistics().totalDuration());
assertEquals(Distance.of(21), subject.getSegmentStatisticUpdater().getStatistics().totalDistance());
}
@@ -150,7 +150,7 @@ public class IntervalStatisticsUpdaterTest {
}
// then
assertEquals(track.getStatistics().totalTime().toSeconds(), totalTime, 0.01);
assertEquals(track.getStatistics().totalDuration().toSeconds(), totalTime, 0.01);
assertEquals(track.getStatistics().totalDistance().toM(), totalDistance.toM(), 0.01);
assertEquals(intervalList.size(), (int) Math.ceil(track.getStatistics().totalDistance().toM() / distanceInterval));
if (totalGain != null && totalLoss != null) {