forked from upstream-mirrors/OpenTracks
Track recorded stats shows sensor data from trackpoints table.
Heart rate: maximum and average. Cadence: maximum and average. Power: average. Fixes #525 and #502.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package de.dennisguse.opentracks.stats;
|
||||
|
||||
public class SensorStatistics {
|
||||
private Float maxHr;
|
||||
private Float avgHr;
|
||||
private Float maxCadence;
|
||||
private Float avgCadence;
|
||||
private Float avgPower;
|
||||
|
||||
public SensorStatistics(Float maxHr, Float avgHr, Float maxCadence, Float avgCadence, Float avgPower) {
|
||||
this.maxHr = maxHr;
|
||||
this.avgHr = avgHr;
|
||||
this.maxCadence = maxCadence;
|
||||
this.avgCadence = avgCadence;
|
||||
this.avgPower = avgPower;
|
||||
}
|
||||
|
||||
public boolean hasHeartRate() {
|
||||
return maxHr != null;
|
||||
}
|
||||
|
||||
public float getMaxHeartRate() {
|
||||
return maxHr;
|
||||
}
|
||||
|
||||
public float getAvgHeartRate() {
|
||||
return avgHr;
|
||||
}
|
||||
|
||||
public boolean hasCadence() {
|
||||
return maxCadence != null;
|
||||
}
|
||||
|
||||
public float getMaxCadence() {
|
||||
return maxCadence;
|
||||
}
|
||||
|
||||
public float getAvgCadence() {
|
||||
return avgCadence;
|
||||
}
|
||||
|
||||
public boolean hasPower() {
|
||||
return avgPower != null;
|
||||
}
|
||||
|
||||
public float getAvgPower() {
|
||||
return avgPower;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user