Create SegmentStatisticUpdater by passing Statistics (1/2).

This commit is contained in:
Dennis Guse
2025-10-28 18:03:30 +01:00
parent be653b73ee
commit fff5f2d406
3 changed files with 28 additions and 43 deletions
@@ -83,6 +83,7 @@ public class TrackPoint {
private HeartRate heartRate = null;
private Cadence cadence = null;
private Power power = null;
//TODO Use AltitudeGainLoss
private Float altitudeGain_m = null;
private Float altitudeLoss_m = null;
@@ -98,20 +98,6 @@ public class SegmentStatisticUpdater {
isIdle = statistics.isIdle();
}
@Deprecated //TODO Remove
@VisibleForTesting
public SegmentStatisticUpdater(String startTime, String stopTime, double totalDistance_m, int totalTime_s, int movingTime_s, float maxSpeed_mps, Float totalAltitudeGain_m, Float totalAltitudeLoss_m) {
this.startTime = Instant.parse(startTime);
this.stopTime = Instant.parse(stopTime);
this.totalDistance = Distance.of(totalDistance_m);
this.totalTime = Duration.ofSeconds(totalTime_s);
this.movingTime = Duration.ofSeconds(movingTime_s);
this.maxSpeed = Speed.of(maxSpeed_mps);
this.totalAltitudeGain_m = totalAltitudeGain_m;
this.totalAltitudeLoss_m = totalAltitudeLoss_m;
altitudeExtremities.set(0.0, 0.0);
}
/**
* Combines these statistics with those from another object.
* This assumes that the time periods covered by each do not intersect.