The metric code for calculating NP was sub-optimal (actually
it was pretty crap). This patch improves the performance of
the calculation quite substantially (>50% improved).
Additionally, the critical durations code has been adjusted
to reduce the amount of work for long rides (>3hrs or more).
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.
Peak 1s - 5s critical heartrate was way off the charts and did
not represent the data within the ride file.
Almost certainly caused by the WKO+ file importer, or possibly
by the WKO+ files themselves. It is possible to have ride files
with samples that are shorter than recIntSecs, e.g. where the
recording sample rate is 1s you might see:
Time HR
01:21:32.0 157
01:21:32.7 157
01:21:33.0 157
In this case there are two samples between 1:21:32 and 1:21:33 rather
than the expected one sample. The code to compute averages used the
duration and recIntSecs to determine the average. This patch now
maintains a count instead.
Fixes#319
Many thanks to Gary Smith for helping to diagnose and fix
this error. It is caused by ridefiles that have a gap in
recording at the very start of the ride (i.e. the first
sample is > recIntSecs).
Hopefully this means the CP code is now robust. It is also
worth noting that after fixing the erroneous copy/paste
code in compute() it is now 5 times faster than the original
code and computes 5 times more data series.
Fixes#316.
When you clicked on 'All Rides' mainwindow emits a rideSelected
signal with a ridefile of NULL. When then selecting a valid ride
a SEGV occurred.
This temporary fix removes that signal, but the underlying issue
related to actions after a NULL ride is selected need to be resolved.
Fixes#318.
The new implementation of CP calculation uses a different
approach to identifying critical power/cadence etc which
makes it sensitive to gaps in recording (it assumes all
samples are temporally contiguous).
This patch ensures the data series are pre-processed to
add 0 values for any gaps in recording -- it does NOT
try to smooth data, since there are tools available to
do this, and if the data as presented has gaps we will
not attempt to 'correct' them -- the user can do this
themselves.
It leaves ride data intact.
Fixes SEGV in RideFileCache caused by incorrect recIntSecs setting
for a ridefile. Other reported issues with high power values for
short intervals was data related and not a bug.
Fixes#314.
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.
Fixes#312.
Fixes#285.
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.
The controls for the RideEditor (find) and AllPlotWindow
still try and do their thing when the current ride item
is NULL. This was either because it wasn't checked (or
expected) or the widgets in question were not notified. This
patch fixes this.
When I get a chance the whole codebase needs to be refactored
to gracefully handle NULL rideItems -- each plot/window should
clear state when it is notified that NO ride is selected.
If you delete the last ride and then select an interval in the
interval widget Interval summary window crashes. This patch fixes
this. It should have been picked up in the Null ride files tests
from last week, but slipped through.
I discovered a crash of GC when doing the following:
* Load two rides (you can load the same ride for 2 different days)
* Go to the Ride Plot tab
* At the bottom, choose "x-Axis shows distance"
* Switch rides in the "All Rides" widget
* GoldenCheetah should crash. At least, it does for me when I load the attached ride file.
Fixes#242
Fixups to compile video on WIN32 and added more configurability
in the realtime screens, but still not the chart and video use-case
needs to be decided.
The refactoring of the weekly summary window to use metricDB
and the introduction of HR zone config in options removed
the hr time in zone table on weekly summary.
This patch re-introduces it.
The refactoring of the summary window to use metricDB and the
introduction of HR zone config in options removed (temporarily)
the table on ride summary.
This patch re-introduces it.
GoogleMapControl crashes when the sidebar is hidden then shown
before a map has been drawn. This is because the resize event
attempts to redraw the map before all private data has been
initialised (in this case rideData is empty).
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.
Refactoring of WeeklySummary to use the metricDB (speed optimisation)
introduced a bug where the ridefile iterator was erroneously used
whilst computing daily averages. This patch fixes this by using the
daily iterator instead.
Many thanks to John Ehrlinger for identifying, reporting and helping
to diagnose this defect.
Update to training mode to improve the UI and overall
user experience. This initial patch introduces:
* Video Window - but ghetto and not fully functional
* Congigurable - drag and drop 'dials' onto homewindow
In future updates we need to:
* Support Video fully - Only Linux in this patch
* HomeWindow - Make Training mode the same as HomeWindow
* More Dials - Support metrics (e.g. BikeScore)
* RT Charts - Make RT plot drag/drop and support other
types of charts (e.g. Time In Zone)
* Controls - Add more controls for FFWD/REW, Skip etc
This patch has been tested on Linux ONLY. It is being committed
to support further build/deployment work for Win32 and Mac OSX.
This means that libusb0.dll does not have to be included in the
Golden Cheetah distribution - the code will load it automatically
from windows\system32 on demand when realtime mode is invoked in
Native ANT+ mode. Insertion of a USB2 ANT+ stick will cause Windows
to download and install libusb0 automatically.
This patch adds support for the Garmin USB2 stick using
libusb-win library. Instructions are included in gcconfig.pri.in
for configuring and installing the neccessary libs.
To enable support for USB1 and USB2 support in the same binary
stubs are created when UsbXpress/Libusb are not available and the
device i/o attempts to use USB2 before falling back to USB1.
Since I was also in the middle of some coding changes I merged
my developments (Mark) with Darren's patch whilst fixing it up
for commit, namely:
1. the configuration screen no longer demands a COMx port
when using Native ANT+ on Windows.
2. new signals in ANTChannel notify the ANT class when info is
stale or lost (but they are not used at present).
3. The previous debug messages have been removed, although new
debug messages are added for stale/drop/timeout signals.
A patch to create an 'antlog.bin' in the current working
directory when working with ANT+ devices. This is to enable
users to test the ANT+ support and share the received messages
to diagnose issues related to parsing messages and displaying
telemetry.
This 'antlog.bin' will ultimately become a native ant file format
and have an associated extension (.ant) and a ridefile reader.
For now it just writes a stream of fixed length messages (12 bytes)
of all received messages.
Fix SRM power decoding to stop requiring a new message
pair whenever a zero change occurs - this was erroneous
and severely limited the update rate. Power and Cadence
updates for SRM are now immediate.
Desk check of support for Standard Power messages showed
that the code was interfering with normal cranktorque or
wheeltorque power calculations. This did not show up with
SRM cranks since they do not send standard power messages.
This should help to resolve issues with erratic/incorrect
power readings from Powertaps. I am not sure if Quarq cranks
send standard power messages, but if they do then this should
improve power readings for those too.
If you have no valid zones configured for the week being
displayed the weekly summary window crashes on an assert.
This was caused by new code for v3 which uses the metricDB
to avoid unneccessary computation -- but introduced this
error.
This patch provides support for Garmin USB1 sticks under
Windows. Since the device does not present a serial port
this code uses the USBXpress API from SiLabs that the
Garmin device uses.
Support for USB2 sticks is pending.
To build you will need to download and install the SiLabs
development kit from http://www.silabs.com/products/mcu/Pages/USBXpress.aspx
and set USBXPRESS_INSTALL appropriately in gcconfig.pri. I
have provided instructions in gcconfig.pri.in.
At runtime the SiUSBXp.dll will need to be in the path, I will
assume that Gareth will fix up the windows installer for this, but
for now just copy the file manually.
Tested with a GARMIN USB1 stick on Windows 7 with SRM, Garmin HR and
a GSC-10 dual speed/cadence device.
There are other minor fixes to the ANTMessage code in this patch
related to decoding of calibration messages.