Commit Graph

62 Commits

Author SHA1 Message Date
Mark Liversedge
c0b29609be Fix WKO import - another optpad constant
.. 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 :)
2014-01-10 19:32:52 +00:00
Mark Liversedge
8a33e15750 Read reference lines in WKO+ files
Added support for reading the 'references' or 'guide lines'
from a WKO+ ride file.
2013-11-07 09:58:40 +00:00
Mark Liversedge
a2a962120c A lot less assert
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.
2013-08-04 11:06:07 +01:00
Mark Liversedge
96c4acafd6 Code Cleanup: Fix Xcode 4.6 compiler warnings
.. largely about unused member variables in class definitions
2013-02-17 20:26:22 +00:00
Mark Liversedge
0134931638 Fix compiler warnings
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.
2013-02-06 15:54:32 +00:00
Andy Bryson
53391f76fc Remove Boost Dependency - The Easy Bits
Replace boost stuff with QT or C++ equivalents
2012-12-27 17:04:36 +00:00
Damien
9425a4b5c2 Add FileType to RideFile
modified:   src/Bin2RideFile.cpp
	modified:   src/BinRideFile.cpp
	modified:   src/Computrainer3dpFile.cpp
	modified:   src/CsvRideFile.cpp
	modified:   src/FitRideFile.cpp
	modified:   src/FitlogParser.cpp
	modified:   src/FitlogRideFile.cpp
	modified:   src/GcRideFile.cpp
	modified:   src/GpxRideFile.cpp
	modified:   src/ManualRideFile.cpp
	modified:   src/PolarRideFile.cpp
	modified:   src/PolarRideFile.cpp
	modified:   src/PwxRideFile.cpp
	modified:   src/QuarqRideFile.cpp
	modified:   src/RawRideFile.cpp
	modified:   src/SlfRideFile.cpp
	modified:   src/SmfRideFile.cpp
	modified:   src/SplitActivityWizard.cpp
	modified:   src/SplitRideDialog.cpp
	modified:   src/SrdRideFile.cpp
	modified:   src/SrmRideFile.cpp
	modified:   src/SyncRideFile.cpp
	modified:   src/TacxCafRideFile.cpp
	modified:   src/TcxParser.cpp
	modified:   src/TcxRideFile.cpp
	modified:   src/TxtRideFile.cpp
	modified:   src/WkoRideFile.cpp
2012-11-14 00:37:24 +01:00
Damien
d51cb951ce Add Left/Right Power Support
Add Left/Right Power Balance for FIT and Polar HRM parsers
 Add Left/Right Balance metric
 Add Left/Right series to Ride Chart

Fixes #711.
2012-08-19 13:57:24 +01:00
Mark Liversedge
72a2d1094d Fix comment in WKO ride file
We now support all the data series present
in a WKO+ file. So the comment warning about
not supporting Temp, Slope, Wind has been
removed.
2012-02-12 14:25:29 +00:00
Damien Grauser
55cb396196 Add temperature to AllPlot
Fixes #536.
2011-12-07 21:55:35 +00:00
Damien Grauser
70c8f0223c Add Temperature and Slope Data Series
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.
2011-12-03 23:17:11 +00:00
Mark Liversedge
7915978916 Better device type handling for WKO+ files
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.
2011-10-11 13:14:59 +01:00
Mark Liversedge
2285b4683f Fix WKO+ iBike import
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.
2011-10-11 11:55:18 +01:00
Mark Liversedge
107ba0ff99 WKO+ iBike fixup was wrong
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.
2011-10-11 10:29:39 +01:00
Mark Liversedge
64bdc87d74 WKO+ file reader further fixups
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.
2011-10-11 09:43:12 +01:00
Mark Liversedge
81f0fcdf5d Notes in WKO file format v1
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.
2011-09-27 21:18:16 +01:00
Mark Liversedge
e3f5dc5e98 WKO+ File sanity checks and fix v12 support
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.
2011-09-27 12:09:40 +01:00
Mark Liversedge
d193512f7c Formally support v7 WKO+ Files
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.
2011-09-26 21:42:34 +01:00
Mark Liversedge
7719b0f953 WKO+ Improved Support for v7 files
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.
2011-09-26 20:42:44 +01:00
Mark Liversedge
c055c55ca3 Finalise full support for earlt WKO+ file formats
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.
2011-09-26 17:40:29 +01:00
Mark Liversedge
f7f4a4c344 Wko+ bitsize change lost
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.
2011-09-26 12:02:56 +01:00
Mark Liversedge
3d03580bfb Fix recIntSecs in Wko reader
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.
2011-09-26 11:17:48 +01:00
Mark Liversedge
8ddabfb6ec Improved WKO+ file support
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.
2011-09-25 19:27:36 +01:00
Mark Liversedge
2cb07528a8 Refactor WkoRideFile reader
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.
2011-09-24 15:09:55 +01:00
Mark Liversedge
03b0dea597 Support Garmin Training Center Export Files
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.
2011-08-05 20:53:13 +01:00
Mark Liversedge
043e66a00e Deprecate .notes in WkoRideFile
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.
2011-08-02 00:47:53 +01:00
Mark Liversedge
d06c9e97c9 Fix WKO+ file reader GPS 'drops'
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.
2011-07-30 19:24:21 +01:00
Mark Liversedge
d1f43a2800 Fix WKO parser for Ergomo users
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.
2011-05-25 20:26:37 +01:00
Mark Liversedge
5e89f9980c Fix 64bit WKO parsing GPS data
The decoding of GPS data erroneously assumed that a
signed long was 32 bits, which is not true on a 64bit
platform.

Fixes #333.
2011-05-22 20:51:00 +01:00
Mark Liversedge
a48f7c00d1 Clean compile time nits
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.
2011-05-12 22:12:36 +01:00
Mark Liversedge
3aba7dd788 Inital V3 Branch 2010-12-30 17:35:23 +00:00
Mark Liversedge
fc583e6404 Fix WKO+ files with Alt, Wind or Slope
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
2010-10-31 21:45:50 +00:00
Mark Liversedge
d106086afe Fix WKO+ with Powercontrol VI RideFile reader crash
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.
2010-10-25 21:20:50 +01:00
Mark Liversedge
778d651f00 User Configurable Metadata
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
2010-04-01 10:29:13 -04:00
Mark Liversedge
636e8f3895 Add Headwind from WKO files
The attached exracts windspeed (+/-) from WKO files to
support the recent patch for headwind.

fixes #57
2010-03-21 08:41:11 -07:00
Andy Froncioni
a02bfaf810 Added headwind to Aerolab calculation for iAero
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.
2010-03-06 13:11:36 -05:00
Mark Liversedge
bc85a3b5fe Change WKO+ version error to warning
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
2010-02-28 08:13:01 -08:00
Mark Liversedge
391fc7b9c9 True Interval Patch, second part
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
2010-01-20 08:28:42 -08:00
Sean Rhea
6d759b8d1d fix unused variable warning 2010-01-10 10:07:57 -08:00
Mark Liversedge
68845644f6 WKO Parsing Dist Chart Fix
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.
2010-01-10 10:06:18 -08:00
Mark Liversedge
0d96ba220d Support for WKO v3 file format
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.
2009-12-21 12:56:23 -05:00
Mark Liversedge
45d7d3c610 GPS support in RideFile
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.
2009-12-14 19:13:45 -05:00
Mark Liversedge
014c6301f6 Free references in WkoFileReader 2009-12-13 14:57:00 -05:00
Mark Liversedge
29a9e41444 Interval features and new GC file format 2009-12-12 11:41:35 -05:00
Sean Rhea
5dc82a6c93 add descriptions to RideFile types
...and use these to get rid of the explicit list of ride file type
descriptions in the import wizard.
2009-10-31 15:00:37 -04:00
Mark Liversedge
18068b1cae more WKO file constants
New optional padding data 0x0e 0x80 and data cache marker 0x1d 0x80.
2009-10-05 09:20:12 -04:00
Mark Liversedge
b08bd55b1b add additional wko padding value
...including test file from Jim Baker.
2009-10-02 09:31:23 -04:00
Mark Liversedge
6dca518fff more messing around with dates in ride import
- Allow user to edit any file date during import.
- WKO reader uses filename date over metadata in the file after import.
2009-09-30 08:59:59 -04:00
Mark Liversedge
850213b968 report errors up from WkoRideFile 2009-09-26 16:15:59 -04:00
Berend De Schouwer
f3cb9c6fab do not load wko files with zero records
Includes a test wko file that previously caused a crash.
2009-09-26 16:15:06 -04:00