Fixed up the code to use withings weight when calculating watts
per kilogram and the display on the CP chart.
There will be issues when retrospectively refreshing data from a
withings account, but that is such an edge case we can just ask
people to delete old .cpx files to ensure they are refreshed.
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.
Return value when out of bounds had a fencepost error. Annoyingly
it is exactly the same fencepost error that was fixed in a line
of code 10 lines lower in the source.
This fixes rare issues with rides where intervals start at the
end of the ride file. This can happen with rides that have been
split.
Added support for.fitlog file format. The reader
was written by Mark Liversedge and the writer
was written by Damien Grauser.
There is no support for manual workout files (either
exporting or importing) this can be introduced at a
later date.
SportTracks does not export speed or distance if GPS
data is available. Speed and Distance are derived from
GPS and time. This is sub-optimal and may result in
differrent values between GC and ST.
I would recommend using a common file format to exchange
data between GC and ST (e.g. TCX) to avoid these issues
with their native file format.
Fixes#481.
The export functions in mainwindow are getting quite
cumbersome with multiple menu options.
This patch creates a single menu option "Export.." which
allows the user to select a supported format and a filename.
To support this the ridefile reader code needed to be adjusted
to allow registered readers to declare capability to write and
use a consistent (virtual) method to do so.
By modifying the base class for ride file reader we now allow
new readers to register both read and write capability.
Updates to the version 3 split activity wizard to bring it
back in line with the original v2 functionality;
* Splits at markers, rather than extracting intervals
* Shows a small plot to show the split visually
* Will automatically mark gaps rather than work between gaps
This will not be backported to v2 since the functionality
is working, albeit difficult to understand for this casual user.
A popup bubble when hovering over the activity
history or an entry on the calendar.
It is a pre-cursor for the activity bar for
selecting rides and is available for any
widget to call (it is a member of mainwindow).
To support the data series indicator icons a
new metadata field 'Data' has been added to
store a string to represent the data series
that are present.
In addition, the Sport code is used to decide
if a bike/run/swim icon should be shown instead
of a string (but needs translation support when
we get round to that).
Lastly, it has been coded for horizontal alignment
but will need to be updated for the activity bar
to support vertical alignment.
This is an experimental feature and will develop
over time, specifically;
* you cannot define which metrics are show in the
bubble -- they are hardcoded at present
* the coloring is hardcoded, as is the font size
* Only the activity list and diary use it.
Very basic start, this will now let you plot
VAM on the CP curve. VAM is a measure of climbing
speed and for comparative purposes should be
normalised to the slope climbed.
In this first pass of implementation the VAM metric
is not normalised in any way. It merely represents
the climbing rate, in meters per hour, that was
sustained over each time interval from 5mins to the
ride duration.
If the ride is undulating then only ascension is
included, any time on the flat or descending is
included but meters climbed will be zero. This is
akin to the way we handle power where we include time
when freewheeling.
More sophistication is needed, especially normalising
the value to a common gradient (e.g. 10%). But this
will prove challenging when VAM is comprised of
undulating elements (i.e. gradient is cumulatively
zero, but could contain segments with steep parts).
It may be more appropriate to only measure VAM for
sustained climbing i.e. ignore ride sections when
descending or on the flat.
More thought needed.
Fixes#414.
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 ride import wizard would only allow the user to
change the ride date/time if it was a .gc .json or
.csv file. This was because (wrongly) it was because
we could not update the date/time defined within the
ride file itself.
Of course, we encode the ride date/time in the filename
and so it could be changed. However, not all the RideFile
readers supported this.
To get around this, the import wizard now does let you
change the date and time for any file type and the ride
file factory method openRideFile() will override whatever
date and time is returned by examining the filename. The
user needs to double click the date or time to edit it.
Additionally, the select date... combo would only register
when you changed the selection, it now defaults back to
the 'select date..' option after each selection.
Lastly, the 'choose date' function now works as advertised
and triggers editing the date for the ride selected.
This patch needs plenty of testing and is potentially going
to resolve the 'misleading UI' bug numer 11, but will need
to be cherry-picked back to v2 master once it has been
adequately tested.
Some ride file formats use -1 to indicate sensor not
present or data loss (e.g. TPX) and on occasion a NaN
or Infinite value will be presented.
This patch handles this by converting negative data sample
values to zero and handling out of bounds values when
selecting zone ranges.
This is not a substitute for better handling of poor ride
data but it reduces the effect.
Also fixes#311.
An update to the ride list on the left hand side
to enable the user to choose and sort or group-by
metrics, metadata fields and ride information.
In addition, the sidebar has been 'improved'
cosmetically and to require less screen estate.
Also, the ticks and frames on plots have been
adjusted to be more aesthtically appealling.
There is more to come on the look-and-feel front,
but this patch heralds some work on the sidebar
which needs to be resolved.
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.
A tooltip is now shown on the CP chart if you move
the cursor over a point in the chart. The old picker
ribbon is still shown when using left-click with
the dates and values shown in the controls.
The Skiba and Coggan metrics for xPower and NP
respectively can now be plotted on the CP curve.
There are two issues;
* Downsampling of data to 5s samples skews xPower's EWMA
* Setting scale to start at 30mins breaks the x-axis scale engine
Both issues need fixing, since the first skews xPower upwards and
the second suggests that xPower/NP are meaningful for durations
less than 30 minutes.
Fixes#307.
This patch enables more data series to be plotted on a CP plot.
We can now show curves for heartrate, cadence, speed and torque
as well as the original power and energy.
The CP code is refactored into the plotting functions and a new
RideFileCache that precomputes the mean-max as well as distribution
data (for a later patch to show histograms across date ranges).
The code for computing mean-max values has been re-written and
significantly optimised by;
* computing 1s intervals up to 5mins only
* computing 20s intervals for the remainder of the ride
* downsampling data to 5s samples for longer durations
* using a binary file format (cpx) for faster read/aggregation
* using multiple threads
Testing on an old Athlon dual-core showed an increase in performance
over the old cpi code of approximately x20, but since new data series
are now computed it is only x4 faster. Quad/Octo core systems will
show a greater performance increase though.
When no ridefiles are available (new cyclist) or the last ridefile
is deleted the current ride will be null. In addition the ride
importer deletes the memory for a ride imported to ensure VM is not
exhausted on large imports.
This patch fixes a whole host of null errors across the codebase. They
were identified by creating a new cyclist, executing every menu option
and tab/chart and then importing a file choosing everything and then
deleting the file and choosing every option again.
This negative testing should be performed before every stable release since
it has identified at least 6 bugs which are almost certainly present in the
current V2 code.
A wizard to create workouts based on absolute wattage and time
relative wattage and time (to CP60) slope and distance and import
an existing ride, and provide some smoothing to the ride data.
Also fixes NP calculation SEGV when recIntSecs is negative.
Fixes#249
Ride files may be created as hidden files in some
instances on Windows 32. This patch ensures that
they are subsequently included in the ride list
(i.e. ride files can be hidden files).
Fixes#176
This patch introduces new functionality for working with
Heartrate based data.
* HR Zones can be defined, from Resting, Maximum and Lactate HR
* TRIMP metrics are calculated; TRIMP, TRIMP100 and Zonal TRIMP
* TRIMP metrics can be used to drive the PMC
* Time In Zone metrics for HR have been added
* Histogram window will now work with Power/HR zones
* User Settings have been added to record gender, weight and others
* RideFile has a new tag "Athlete" which is set to the athlete name
Fixes#140
The recent data processor / ride editor patch added some
post-processing actions after a ride file is opened. The
functions are called without checking for an open ride
failure. This patch fixes that stupid error.
A new tab 'Editor' for manually editing ride file data points and
associated menu options under 'Tools' for fixing spikes, gaps, GPS
errors and adjusting torque values. A revert to saved ride option
is also included to 'undo' all changes.
The ride editor supports undo/redo as well as cut and paste and
"paste special" (to append points or swap columns/overwrite
selected data series). The editor also supports search and will
automatically highlight anomalous data.
When a file is saved, the changes are recorded in a new metadata
special field called "Change History" which can be added as a
Textbox in the metadata config.
The data processors can be run manually or automatically when a
ride is opened - these are configured on the ride data tab in
the config pane.
Significant changes have been introduced in the codebase, the most
significant of which are; a RideFileCommand class for modifying
ride data has been introduced (as a member of RideFile) and the
RideItem class is now a QObject as well as QTreeWidgetItem to
enable signalling. The Ride Editor uses a RideFileTableModel that
can be re-used in other parts of the code. LTMoutliers class has been
introduced in support of anomaly detection in the editor (which
highlights anomalies with a wiggly red line).
Fixes#103.
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.
A user configurable chart for showing ride metrics and
other calculated values over time.
* Uses SQLITE database to store metrics
* Supports any metric available from the metric factory
* Adds new MaxHr, VI, Peak Power and Time In Zone metric
* Also includes LTS/STS/SB for PM charting
* Aggregates in days, weeks, months or years
* Reads and Updates seasons.xml
* Adds cycles and adhoc date ranges in seasons.xml
* Date ranges can be selected on the plot with shift-left click
* Allows users to customise preferences for color, symbols et al
* Allows user to customise metric names and unit names
* Supports smooth curves and topN highlighting
* Has a linear regress trend line function
* Allows users to save charts to charts.xml
* A default charts.xml is built-in
* A chart manager to import/export/rename/delete charts etc
* Provides a tooltip to provide basic datapoint information
* Performance Manager adjusted to use the MetricDB
* User configurable setting for SB calculation (today/tomorrow)
This commit allows every ride file to specify a set of "metric overrides":
values to use in place of those for RideMetrics we would otherwise compute.
The most gratifying immediate result of this change is that we can associate a
"skiba_bike_score" metric override with each Manual CSV file, thereby
eliminating the need for a bogus "bs" parameter in RideFilePoint.
In the future, though, we can also save these overrides to a GcRideFile using
a syntax something like this:
<override>
<metric name="skiba_bike_score" value="100"/>
<metric name="average_speed" secs="3600" km="30"/>
</override>
(Note that average_speed needs to store time and distance in order to
aggregate properly.)
Then we can add a dialog that allows the user to override the computed value
of a metric for any given ride. For example, if my HRM was on the fritz
during a ride, I could estimate my average HR and override that metric.
(We might want to show these overrided metrics in a different color, so that
it was clear they weren't the computed values.)
Finally, I think we could actually use this feature to eliminate the Manual
CSV format altogether, and just use GcRideFiles without any samples or
intervals, but with metric overrides for all the available metrics.
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.
Replace handcoded binary search in RideFiletimeToDistance() method
in RideFile with lower_bounds, since it is more efficient. The
distanceToTime() method has been removed since it is not used.
Eventually, I'm going to remove interval as a member of RideFilePoint, and
only use RideFileIntervals. But I have to rework a bunch of other code first,
so for now the two will coexist.