There still some assert left in the code, but removed
a fair number of the examples where, its just as easy
to handle the condition gracefully, without crashing.
By 3.1 we will have eradicated assert from the code.
This patch adds support for temperature and slope
across the ridefile readers.
For the most part their is no functional change
although it is now possible to view and edit these
data series in the editor.
File formats that can provide temp or slope include;
.bin, .fit, .srm, .sync, .wko
Further updates will be required to display the data
in the ride plot and histograms.
GTC will export all rides as a single TCX file so they
can be imported en-masse into another application.
We did not support >1 rides in a single ride file. This
patch adds support for reading multiple rides (if the ride
file reader supports it).
The ride import wizard will now extract and parse files from
a GTC export. Many thanks to Damien for writing the TCX file writer.
Fixes#371.
Lots of nitty fixups, largely for uninitialised temporary
variables.
I have left the use of boost::function and boost::bind in the
DownloadRideDialog alone, so it will vomit when compiled
with boost 1.46 and gcc 4.5 or higher. Will look into this
more carefully at a later stage.
I am working up to resolving issues identified from -pedantic next.
Added a headwind data field, which is available when using
an iAero head unit, to dramatically improve the calculation
of Chung analysis for users of more recent iAero devices.
All other data files than the iAero have the headwind term set to
zero when they append a point.
This file relies on Qt's QDataStream to handle the parsing
of primitive C types from Computrainer .3dp files, including
floats. In Qt4.5 and earlier, Qt defaulted to 32 bit
floats. In Qt4.6 and later, Qt started using 64 bit
floats by default. As a side-effect, parsing broke on
Qt4.6, leading to a crash when importing or using .3dp files.
This patch fixes the issue by using QDataStream's
"setVersion()" method to tell Qt to use the Qt4.0 serialization
format for the QDataStream used in this file. This
patch does not affect any other files. This patch
should make the formatting assumptions both backwards
and forwards compatible.
RideFile data points now include lon and lat members for the longitude
degrees and latitute degrees from the source ride files. As a result
most of the RideFile readers now set longitude and latitude to zero for
each data point, except for:
* Gc Format Files - now support read/write
* Wko Format Files - now support read
* Tcx Format Files - now support read (smoothed if smart recording)
Although there are no features within GC at this point in time that use
positioning data this may change over time. Critically, as users save
files to the new GC file format whilst adding interval data it is
important that this positioning data is not discarded before new
features arrive.
Computrainer 3D software lets you start your ride partway into
a course. But, if you do this, the first distance recorded
in the log file is the distance you started at, rather than zero.
GC expects the first data point to be at distance zero, however,
and therefore this causes total distance to be reported incorrectly.
This patch fixes the bug by remembering the distance of the
first data point, and subtracting that from all distances
reported to GC, so that distances are zero-based (i.e.,
so that the first data point is always at distance zero.)
Specifically:
1. The previous code assumed the wrong units while extracting
speed and distance from a .3dp file. Computrainer stores
speed in (miles per hour / 160), and distance in kilometers.
This patch converts .3dp speed/distance data points into
kph and km correctly. As a side-effect, speed and distance
are displayed correctly in GC windows and calculations.
2. This patch adds code to extract altitude data from a .3dp
file and include it in a ride.
3. .3dp files do not have a consistent inter-datapoint time
interval. Since GC expects one, the earlier version of this
code averaged 1000 data points from the middle of the ride to
estimate this interval. Unfortunately, this approach caused
a bunch of problems for various calculations that GC does,
such as calculating the riding time (vs. workout time),
average speed, xPower, critical power plot and FTP, and so
on. [GC assumes that # data points * inter-datapoint-interval
= workout time, but this isn't true when you used an estimated
interval.]
To fix this, this patch adds averaging and interpolation code
to covert the data point sequence in the .3dp file to an
averaged sequence with a data point every 250ms. Since the
inter-data-point interval is now fixed, these calculation bugs
went away, and correct values are now calculated and displayed
by GC.
4. Fix (3.) has another useful side-effect: the number of data
points per ride given to GC goes down by 10x. (Raw .3dp files
have a data point every 30-50ms. This averaging/smoothing
code emits a data point every 250ms.) Since the critical
power calculation is an O(n^2) calculation, the time for
this calculation is reduced by 100x. Instead of an hour
to do the calculation for a typical 2hr ride, it now takes
less than a minute.
5. The code was cleaned up in several regards: comments
were added to help document the .3dp format and explain
the averaging/smoothing code, and types from boost/cstdint.hpp
were used instead of native C types when using a variable
of a specific size (e.g., the code now uses uint16_t instead
of unsigned short, etc.).
This patch was built by Steve Gribble and Daniel Stark.