Removed unused Waypoint.TripStatistics.

This commit is contained in:
Dennis Guse
2019-12-26 11:37:48 +01:00
parent 73b4977051
commit 3c52efadd6
6 changed files with 7 additions and 50 deletions
@@ -518,9 +518,6 @@ public class ContentProviderUtils {
tripStatistics.setMaxGrade(cursor.getFloat(maxGradeIndex));
hasTripStatistics = true;
}
if (hasTripStatistics) {
waypoint.setTripStatistics(tripStatistics);
}
if (!cursor.isNull(photoUrlIndex)) {
waypoint.setPhotoUrl(cursor.getString(photoUrlIndex));
@@ -742,22 +739,6 @@ public class ContentProviderUtils {
}
}
TripStatistics tripStatistics = waypoint.getTripStatistics();
if (tripStatistics != null) {
values.put(WaypointsColumns.STARTTIME, tripStatistics.getStartTime());
values.put(WaypointsColumns.TOTALDISTANCE, tripStatistics.getTotalDistance());
values.put(WaypointsColumns.TOTALTIME, tripStatistics.getTotalTime());
values.put(WaypointsColumns.MOVINGTIME, tripStatistics.getMovingTime());
values.put(WaypointsColumns.AVGSPEED, tripStatistics.getAverageSpeed());
values.put(WaypointsColumns.AVGMOVINGSPEED, tripStatistics.getAverageMovingSpeed());
values.put(WaypointsColumns.MAXSPEED, tripStatistics.getMaxSpeed());
values.put(WaypointsColumns.MINELEVATION, tripStatistics.getMinElevation());
values.put(WaypointsColumns.MAXELEVATION, tripStatistics.getMaxElevation());
values.put(WaypointsColumns.ELEVATIONGAIN, tripStatistics.getTotalElevationGain());
values.put(WaypointsColumns.MINGRADE, tripStatistics.getMinGrade());
values.put(WaypointsColumns.MAXGRADE, tripStatistics.getMaxGrade());
}
values.put(WaypointsColumns.PHOTOURL, waypoint.getPhotoUrl());
return values;
}
@@ -19,8 +19,6 @@ package de.dennisguse.opentracks.content.data;
import android.location.Location;
import android.net.Uri;
import de.dennisguse.opentracks.stats.TripStatistics;
/**
* A waypoint.
*
@@ -38,13 +36,12 @@ public final class Waypoint {
private double length = 0.0;
private long duration = 0;
private Location location = null;
private TripStatistics tripStatistics = null;
private String photoUrl = "";
public Waypoint() {
}
public Waypoint(String name, String description, String category, String icon, long trackId, double length, long duration, Location location, TripStatistics tripStatistics, String photoUrl) {
public Waypoint(String name, String description, String category, String icon, long trackId, double length, long duration, Location location, String photoUrl) {
this.name = name;
this.description = description;
this.category = category;
@@ -53,7 +50,6 @@ public final class Waypoint {
this.length = length;
this.duration = duration;
this.location = location;
this.tripStatistics = tripStatistics;
this.photoUrl = photoUrl;
}
@@ -129,18 +125,6 @@ public final class Waypoint {
this.location = location;
}
public boolean isTripStatistics() {
return tripStatistics != null;
}
public TripStatistics getTripStatistics() {
return tripStatistics;
}
public void setTripStatistics(TripStatistics tripStatistics) {
this.tripStatistics = tripStatistics;
}
public String getPhotoUrl() {
return photoUrl;
}