mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-13 12:42:20 +00:00
Fix W' calculator for bad data
Fix 1s smoothing to ensure time doesn't go backwards as when the same timestamp is used more than once the QwtSpline used to interpolate returns all zeroes.
This commit is contained in:
@@ -71,9 +71,16 @@ WPrime::setRide(RideFile *input)
|
||||
// create a raw time series in the format QwtSpline wants
|
||||
QVector<QPointF> points;
|
||||
int last=0;
|
||||
RideFilePoint *lp=NULL;
|
||||
foreach(RideFilePoint *p, input->dataPoints()) {
|
||||
points << QPointF(p->secs, p->watts);
|
||||
|
||||
// lets not go backwards -- or two sampls at the same time
|
||||
if ((lp && p->secs > lp->secs) || !lp)
|
||||
points << QPointF(p->secs, p->watts);
|
||||
|
||||
// update state
|
||||
last = p->secs;
|
||||
lp = p;
|
||||
}
|
||||
|
||||
// Create a spline
|
||||
|
||||
Reference in New Issue
Block a user