fix for future use when new track recording starts

This commit is contained in:
Skalii 2021-02-10 12:30:09 +02:00
parent fb3820f907
commit 162182a8ee

View file

@ -100,12 +100,15 @@ public class GpxBlockStatisticsBuilder {
GPXFile gpxFile = getGPXFile(); GPXFile gpxFile = getGPXFile();
GpxDisplayItem gpxDisplayItem = null; GpxDisplayItem gpxDisplayItem = null;
GPXTrackAnalysis analysis = null; GPXTrackAnalysis analysis = null;
boolean withoutGaps = false;
if (gpxFile.tracks.size() > 0) { if (gpxFile.tracks.size() > 0) {
gpxDisplayItem = getDisplayItem(gpxFile); gpxDisplayItem = getDisplayItem(gpxFile);
analysis = gpxDisplayItem.analysis;
} }
if (gpxDisplayItem != null && analysis != null) { if (gpxDisplayItem != null) {
boolean withoutGaps = !selectedGpxFile.isJoinSegments() && gpxDisplayItem.isGeneralTrack(); analysis = gpxDisplayItem.analysis;
withoutGaps = !selectedGpxFile.isJoinSegments() && gpxDisplayItem.isGeneralTrack();
}
if (analysis != null) {
float totalDistance = withoutGaps ? analysis.totalDistanceWithoutGaps : analysis.totalDistance; float totalDistance = withoutGaps ? analysis.totalDistanceWithoutGaps : analysis.totalDistance;
float timeSpan = withoutGaps ? analysis.timeSpanWithoutGaps : analysis.timeSpan; float timeSpan = withoutGaps ? analysis.timeSpanWithoutGaps : analysis.timeSpan;
String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app); String asc = OsmAndFormatter.getFormattedAlt(analysis.diffElevationUp, app);