Find Peak Powers only for Intervals smaller than entire ride time

The find peak powers functions was previously adding peak intervals for
durations that were longer than the entire ride, for example a 20 minute
ride would still have a 30min and 60min peak power interval added.

The duration of the ride is now checked and only peak intervals that
are shorter or equal to the length of the ride are added.
This commit is contained in:
Mark Liversedge
2009-12-14 13:18:09 +00:00
committed by Sean Rhea
parent d042f54e05
commit 2745291f59

View File

@@ -624,6 +624,9 @@ MainWindow::addIntervalForPowerPeaksForSecs(RideFile *ride, int windowSizeSecs,
QList<const RideFilePoint*> window;
QMap<double,double> bests;
// don't add for intervals that are longer than the entire ride!
if (ride->dataPoints().last()->secs < windowSizeSecs) return;
double secsDelta = ride->recIntSecs();
int expectedSamples = (int) floor(windowSizeSecs / secsDelta);
double totalWatts = 0.0;