Move temp functionality into TrackStatisticsUpdater.

This commit is contained in:
Dennis Guse
2025-11-22 17:49:35 +01:00
parent 92cecb6f3a
commit 6d33adffce
3 changed files with 31 additions and 10 deletions
@@ -116,10 +116,9 @@ public class TrackRecordingManager implements SharedPreferences.OnSharedPreferen
}
RecordingData getDataForUI() {
TrackStatisticsUpdater tmpTrackStatisticsUpdater = new TrackStatisticsUpdater(trackStatisticsUpdater);
Pair<TrackPoint, SensorDataSet> current = trackPointCreator.createCurrentTrackPoint(lastTrackPointUIWithSpeed, lastTrackPointUIWithAltitude, lastStoredTrackPointWithLocation);
tmpTrackStatisticsUpdater.addTrackPoint(current.first);
TrackStatisticsUpdater tmpTrackStatisticsUpdater = new TrackStatisticsUpdater(trackStatisticsUpdater, current.first);
ALTITUDE_CORRECTION_MANAGER.correctAltitude(context, current.first);
@@ -72,13 +72,14 @@ public class TrackStatisticsUpdater {
resetAverageHeartRate();
}
@Deprecated
public TrackStatisticsUpdater(@NonNull TrackStatisticsUpdater toCopy) {
this.currentSegment = new SegmentStatisticUpdater(toCopy.currentSegment);
public TrackStatisticsUpdater(@NonNull TrackStatisticsUpdater toCopy, TrackPoint tmp) {
this.statisticsWithoutCurrentSegment = toCopy.statisticsWithoutCurrentSegment;
this.currentSegment = new SegmentStatisticUpdater(toCopy.currentSegment);
this.lastTrackPoint = toCopy.lastTrackPoint;
resetAverageHeartRate();
addTrackPoint(tmp);
}
/**