Sane failure for rides longer than a week, which usually happen because

someone sets the date on their PT and doesn't reset the device before going
for a ride.  This fix will keep GC working until the user splits the ride
(and until we add a ride-splitting function).
This commit is contained in:
Sean C. Rhea
2008-05-18 14:19:37 +00:00
parent f91e45d950
commit babbaa7e2c
2 changed files with 12 additions and 0 deletions

View File

@@ -82,6 +82,14 @@ AllPlot::recalc()
if (!timeArray)
return;
int rideTimeSecs = (int) ceil(timeArray[arrayLength - 1]);
if (rideTimeSecs > 7*24*60*60) {
QwtArray<double> data;
wattsCurve->setData(data, data);
hrCurve->setData(data, data);
speedCurve->setData(data, data);
cadCurve->setData(data, data);
return;
}
double totalWatts = 0.0;
double totalHr = 0.0;
double totalSpeed = 0.0;

View File

@@ -118,6 +118,10 @@ update_cpi_file(const cpi_file_info *info, QProgressDialog *progress,
assert(out);
int total_secs = (int) ceil(data.points.back().secs);
if (total_secs > 7*24*60*60) {
fclose(out);
return;
}
double *bests = (double*) calloc(total_secs + 1, sizeof(double));
bool canceled = false;