From abbe205dc9f9ebbdd9bb2bda3efca1538e7372ad Mon Sep 17 00:00:00 2001 From: "Sean C. Rhea" Date: Sun, 5 Aug 2007 14:57:57 +0000 Subject: [PATCH] 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!) --- src/cpint/cpint.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpint/cpint.cpp b/src/cpint/cpint.cpp index 58d2e0e94..ad8213dfd 100644 --- a/src/cpint/cpint.cpp +++ b/src/cpint/cpint.cpp @@ -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);