mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 08:08:42 +00:00
Truncate Altitude values
We know the highesst point on Earth, so any activity that contains an altitude greater than that is definitely incorrect. This patch truncates the altitude to the maximum possible, this has the happy by product of curing a major mem alloc crash in QWT when trying to plot altitudes with very large values. Fixes #700
This commit is contained in:
@@ -510,6 +510,11 @@ void RideFile::appendPoint(double secs, double cad, double hr, double km,
|
||||
if (!isfinite(watts) || watts<0) watts=0;
|
||||
if (!isfinite(interval) || interval<0) interval=0;
|
||||
|
||||
// truncate alt out of bounds -- ? should do for all, but uncomfortable about
|
||||
// setting an absolute max. At least We know the highest
|
||||
// point on Earth (Mt Everest).
|
||||
if (alt > RideFile::maximumFor(RideFile::alt)) alt = RideFile::maximumFor(RideFile::alt);
|
||||
|
||||
RideFilePoint* point = new RideFilePoint(secs, cad, hr, km, kph,
|
||||
nm, watts, alt, lon, lat, headwind, slope, temp, lrbalance, interval);
|
||||
dataPoints_.append(point);
|
||||
|
||||
Reference in New Issue
Block a user