mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user