mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
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:
committed by
Sean Rhea
parent
d042f54e05
commit
2745291f59
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user