Renamed SensorDataSetLocation to TrackPoint (similar to SQLite table).

This commit is contained in:
Dennis Guse
2019-12-27 18:00:51 +01:00
parent 5cb7b623d9
commit 4129985b0f
10 changed files with 48 additions and 48 deletions
@@ -732,7 +732,7 @@ public class ContentProviderUtils {
* @param cursor the cursor pointing to the location
*/
public Location createTrackPoint(Cursor cursor) {
Location location = new SensorDataSetLocation("");
Location location = new TrackPoint("");
fillTrackPoint(cursor, new CachedTrackPointsIndexes(cursor), location);
return location;
}
@@ -994,8 +994,8 @@ public class ContentProviderUtils {
}
//SensorData
if (location instanceof SensorDataSetLocation) {
SensorDataSetLocation sensorDataSetLocation = (SensorDataSetLocation) location;
if (location instanceof TrackPoint) {
TrackPoint sensorDataSetLocation = (TrackPoint) location;
SensorDataSet sensorDataSet = sensorDataSetLocation.getSensorDataSet();
if (sensorDataSet != null && sensorDataSet.hasHeartRate()) {
values.put(TrackPointsColumns.SENSOR_HEARTRATE, sensorDataSetLocation.getSensorDataSet().getHeartRate());
@@ -1041,8 +1041,8 @@ public class ContentProviderUtils {
if (!cursor.isNull(indexes.bearingIndex)) {
location.setBearing(cursor.getFloat(indexes.bearingIndex));
}
if (location instanceof SensorDataSetLocation) {
SensorDataSetLocation sensorDataSetLocation = (SensorDataSetLocation) location;
if (location instanceof TrackPoint) {
TrackPoint sensorDataSetLocation = (TrackPoint) location;
float heartRate = cursor.isNull(indexes.sensorHeartRateIndex) ? SensorDataSet.DATA_UNAVAILABLE : cursor.getFloat(indexes.sensorHeartRateIndex);
float cadence = cursor.isNull(indexes.sensorCadenceIndex) ? SensorDataSet.DATA_UNAVAILABLE : cursor.getFloat(indexes.sensorCadenceIndex);
@@ -4,7 +4,7 @@ import android.location.Location;
import android.location.LocationManager;
/**
* Creates a new {@link SensorDataSetLocation}.
* Creates a new {@link TrackPoint}.
* An implementation can create new instances or reuse existing instances for optimization.
*/
public class LocationFactory {
@@ -15,6 +15,6 @@ public class LocationFactory {
public static LocationFactory DEFAULT_LOCATION_FACTORY = new LocationFactory();
public Location createLocation() {
return new SensorDataSetLocation(LocationManager.GPS_PROVIDER);
return new TrackPoint(LocationManager.GPS_PROVIDER);
}
}
@@ -24,16 +24,16 @@ import de.dennisguse.opentracks.content.sensor.SensorDataSet;
*
* @author Sandor Dornbush
*/
public class SensorDataSetLocation extends Location {
public class TrackPoint extends Location {
private SensorDataSet sensorDataSet = null;
public SensorDataSetLocation(Location location, SensorDataSet sensorDataSet) {
public TrackPoint(Location location, SensorDataSet sensorDataSet) {
super(location);
this.sensorDataSet = sensorDataSet;
}
public SensorDataSetLocation(String provider) {
public TrackPoint(String provider) {
super(provider);
}