.. amazingly there are still some constant values we have
not seen before. This time from files provided by
Patrick McNally.
.. optpad values we have seen now range from 0x8007 through
0x801a and crucially with only one value missing 0x8008
.. its just a matter of time before we see one of those :)
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.
All are harmless but for the sake of clarity have
fixed them all bar a couple;
- Lucene grumbles about signed/unsigned conversion which
is/isn't valid depending upon the version of CLucene you
compile with. Either way it is harmless.
- QxtScheduleView has a bunch of issues, but since it is a
third party widget its better to leave it unchanged.
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.
We now recognise more 'device types' in the WKO+
parser. This patch sets the devicetype for these
instead of just defaulting to 'WKO'.
* 0x00 - Powertap (for v1/v7 WKO+ files)
* 0x0E - Ergomo
* 0x1A - SRM (is actually a PC 6)
Additionally, the device type is set to WKO (xx)
when we get a device type we do not recognise to
make it easier for users to report.
Fixed the iBike import. The recent commit removing the
different pausetime length for iBike had a logic error.
The iBike files are no different to any other device
and by treating gaps in recording the same as all other
devices we can now successfully parse all iBike WKO+
files.
There are still 3 files amongst the 7,000 WKO+ files I
have received that fail to parse successfully.
I will look to validate these files with WKO+ since they
may be corrupted.
reverted after testing against more files. There is something
decidedly odd about WKO+ files from iBike computers. The scheme
used to mark pauses in recording is different, but cannot work
out why.
Two minor modifications;
* iBike files now parsed correctly (they
where handled as a special case that was
not warranted)
* Some rudimentary bounds checking whilst
parsing the raw data to reduce SEGV crashes
when parsing fails / is incorrect.
For some reason the code for setting notes
in v1 WKO files was commented out, this patch
reinstates notes for this version, but will
not get Workout Code since it is not available
in this file format.
Also removed a duplicate switch statement where
sport was being set twice for some reason.
Fixed parsing of v12 files which contain ride graph
horizontal gridlines. This brings the code back into
line with all other versions and suggests the parsing
of v12 files is now robust.
Also added some sanity checks to avoid data integrity
problems;
* Magic number is correct 'WKO^Z'
* File isn't too small
* Start time is zero, will adjust if not
All files from a collection of 2,500 have been parsed
successfully and/or handled gracefully.
There is still a chance the parser will crash with a
malformed file or a protocol we haven't seen before,
but these checks protect other parts of the code.
Code comments have been adjusted to reflect the current
state of the code, which is much better after the
recent refactoring.
This patch removes the invariance for the graph tab and
uses the same protocol as v1 reliably. This has been
tested against 600 files without error.
All popular formats of the WKO format are now supported,
the warnings for v7 have therefore been removed.
Having just recovered almost 900 v7 files I have
improved the code to support this file format. I
now have 4 files quarantined (that cannot be
parsed successfully) from a corpus of over
2,500 WKO+ files.
With over 500 files now processed successfully for
early versions of WKO+ (Cycling Peaks) we can now
support v1 and v12 of the WKO file format.
This means we now offer full support for;
* CP 1.0 and 1.1
* WKO+ 2.2 and 3.0
The warning message has been removed and problems
related to parsing the 'graph' tab settings in v1
files is now fixed.
We need to see more v7 files (quite rate) before we
can move that version out of beta support. Looking at
the code it is unlikely that the v7 support is very
robust, but until we have more files to test this is
as good as it gets.
Re-instate Altitude bitsize for earlier version that was
undone in previous commit. This was a fixup posted in a
recent push that I reversed, but further testing showed
that the original fix was in fact valid.
Fix bug 1s time increment bug introduced in recent
commit and replaced with a safety net check for
daft values for recIntSecs which examines the ride
file looking for the most frequent recording gap
and uses that.
Refactored to improve support for files created
in earlier versions of WKO/CyclingPeaks. The
changes are largely focused on parsing charts
and caches that we don't really use, but need
to be waded through to land on the data points.
This has been tested on over 1,500 WKO+ files
and found to be ok for those. Further regression
testing would be beneficial.
Better support for;
* Running / Swimming files (different chart setup)
* Where users have customised the default charts
* Earlier versions of CP/WKO+ (esp v1 and v12 format from CP v1.1/1.2)
* Latest versions (v3.0)
Specifically;
* Better support for WKO file formats v1 and v12
* Fix parsing of distribution caches and config
* Improved parsing of MeanMax caches and config
* Support for Suunto devices added
* Support for files with no time data
Fixes#457.
No functional change, but fixed up some of the coding nits
in the WKO+ ride file reader.
References to static variables removed (for thread safety)
References to global WKO_HOME variable removed (multi athlete)
WkoParser class introduced (for further code refactoring)
Updates are pending for more robust parsing when users have
customised charts or the files contain running/pace charts
since these tend to cause a crash at present.
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.
The WKO+ file reader still wrote to a .notes file
rather than updating the Notes metadata tag. This
patch fixes that.
Notes files are still referenced in LTMPopup, so the
current bug request for completing the notes file
deprecation cannot be closed, yet.
The WKO+ file format appears to record drops in
recording of GPS data with a latlon of 180,180. We
expect this to be 0,0.
This makes the WKO+ file reader consistent with the
GoogleMapControl and removes the need to clean data
there.
If it is found that 180,180 is the standard way of
recording drops in GPS signal then we can change the
code. We use 0,0 since it is conveniently at sea off
the west coast of Africa.
The WKO ride file reader used wrong constants for the bit
field size of the sample data when decoding files from
Ergomo devices.
merged from v2 master.
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.
The logic in the WKO+ ridefile parser tried to
re-use code blocks for working with alt, wind
and slope but as a result ended up overwriting
variables and losing data as a result.
It also mishandled negative values for those
data series.
It also falsely reported iBike files as Ergomo.
Fixes#164
Files kindly supplied by Alex Simmons have demonstrated a bug in the
parsing of WKO+ files that contain data downloaded from an SRM
Powercontrol VI. The files are parsed incorrectly and often lead
to crashes or absurdly high summary values.
This might be version specific, since the files were WKO v3 files, we
should watch for WKO+ v2.2 files that contain Powercontrol VI data and
potentially make this version specific if needed.
User configurable data entry for recording information about
each workout.
FEATURES:
* Config UI for defining tabs and fields to maintain
* Config UI for defining keywords and colors
* Data maintenance UI on RideSummaryWindow
* "Special" Metadata fields are related to current variables
* Read/Write new fields/metric overrides via GcRideFile
* Metadata extraction in WKO files
* Calendar uses keyword and color config
* Numeric metadata is plottable on the Metric charts
*Metric refresh has been optimised
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.
The WKO+ file format version is changing version numbers
at a fairly accelerated pace, but the general structure of
the files are still readable by the WkoRideFile reader.
This patch issues a warning rather than an error on new
files. Recent v29, v30 and v31 of the WKO+ file format have
all been parsed successfully.
fixes#47
The best interval dialog rounded intervals to the nearest second
due to a casting of a double to int. This was introduced by Mark L
during the intervals code patch and is an error.
All the plots have now been adjusted to correctly determine if a ride
point is within an interval. Related cropping and binning issues in
3d plot an Histogram plot have also been corrected.
fixes#15
The bodge to manage so-called 'optional padding' which led to the
need to keep updating constants like 0x8014 et al was caused by a
misunderstanding of how Distribution Charts are recorded in a WKO
file.
This patch correctly decodes these segments of a WKO file and as
a result remove the need for the optpad2 function. There are still
some 'weird' constants that are parsed, but these are limited to
the artefacts resulting from the fact that the WKO software uses
MFC persistent object format to write the file data and these
constants reflect the POF Archive PIDs.
Summary analysis suggests the new (v29) of the WKO 3.0 file format does
not contain any differences (or noticeable) to the previous version.
This patch enables files to be imported using the existing code instead
of being rejected because they are 'newer than the supported format'.
Further testing and analysis will be performed on the WKO 3.0 file formats
but this patch should enable users of v3 to import there files into GC.
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.