Serious bug fix: while interval duration SHOULD be computed by using

previous data point (i.e., q->secs - p->secs), the duration to multiply
the wattage value by SHOULD NOT be.  Instead, should multiply by
rec_int.  (My ride from Jul 31, 2007 demonstrates the problem.  I
started an interval with a 1-sec wattage of 773 after a ~48 second rest.
Using the old code, that gets credited as 773 watts for 48 secs!)
This commit is contained in:
Sean C. Rhea
2007-08-05 14:57:57 +00:00
parent 253e2083f7
commit abbe205dc9

View File

@@ -200,7 +200,7 @@ update_cpi_file(cpi_file_info *info,
goto done;
}
}
sum += (q->secs - prev_secs) * q->watts;
sum += data.rec_int_ms / 1000.0 * q->watts;
double dur_secs = q->secs - p->secs;
double avg = sum / dur_secs;
int dur_secs_top = (int) floor(dur_secs);