Commit Graph

799 Commits

Author SHA1 Message Date
Berend De Schouwer
d4ee3fe8cd Calendar move defaults to constructor 2009-12-31 10:08:44 -05:00
Sean Rhea
255f57b5f7 read intervals in iBike CSV files 2009-12-30 22:08:10 -05:00
Berend De Schouwer
4f4973ab18 Multiple rides per day in the calendar 2009-12-30 18:41:37 -05:00
Sean Rhea
abbdd4667e bug fix: remember user's curve preferences
Fernando Maldonado pointed out that if he deselected, for example, Cadence on
the Ride Plot, then switched to another ride, the Cadence check box remained
unchecked but the Cadence curve showed back up on the plot.  To hide the
curve, he had to check and uncheck the box again.  This commit fixes that bug.

I'm not entirely happy with this fix.  I'd rather AllPlot had access to the
QCheckBox objects in AllPlotWindow, but I can't think of a clean way to do
that.  This patch at least seems to work.
2009-12-30 17:52:13 -05:00
Sean Rhea
be9a35354d fix indentation -- no functional change 2009-12-30 17:15:14 -05:00
Sean Rhea
cae1d15f4d respect user's unit pref in import wizard
Based on a patch by Thomas Weichmann.
2009-12-30 17:13:28 -05:00
Sean Rhea
b89ff9f1d6 about dialog nits: add line breaks, remove italics 2009-12-30 10:17:55 -05:00
Sean Rhea
6cba1d0c94 show home path in about dialog 2009-12-30 10:13:23 -05:00
Sean Rhea
a2665bc3b9 fix segfault in ModelPlot on bad ride files 2009-12-30 09:42:49 -05:00
Mark Liversedge
3d72d7e812 3D Modelling
A new tab on the ride analysis view for analysing ride data in three
dimensions. Interval selection is supported and a z-axis slider is
available for helping to identify data in the z-plane. A color legend
is displayed since coloring is independent of x/y/z values.

Coloring and Z axis values are averages for associated values of x/y.
The code requires qwtplot3d to be installed (see gcconfig.pri.in) and
with older Mac dev envs you will need to add -lz to LIBS too. (LIBS += -lz).

On Linux qwt3d_function.h needs a #include <stdio.h> added to compile.

Greg Steele helped design and test.

There are 2 open issues x/y/z axis labels occasionally appear in the
wrong place. lastly, the bin selection is for X&Y bin sizes and it
would be better to have separate sliders.
2009-12-30 09:41:33 -05:00
Sean Rhea
a79f2865cc split ride saves in .gc format 2009-12-28 11:36:38 -05:00
Sean Rhea
80a3c275b0 bug fix: set ride start time correctly in .gc files 2009-12-28 11:36:38 -05:00
Dag Gruneau
7ae6763bc5 bug fix: don't crash when computing metrics on empty intervals 2009-12-28 11:02:08 -05:00
Sean Rhea
a5f75ec569 add hysteresis to ElevationGain metric 2009-12-25 10:43:13 -05:00
Sean Rhea
0d488cb9ea fix neg alt bug in ElevationGain metric 2009-12-25 10:40:54 -05:00
Sean Rhea
ed063cf6a4 choose your own metrics for intervals
This commit adds a page to the config dialog in which the user can choose
which metrics GC will show for intervals.  The GUI design could use some work,
but the functionality is there.  All implemented metrics are available to
choose, and choices are saved across restarts.
2009-12-24 17:51:50 -05:00
Thomas Weichmann
30b931bedb Fixed unit conversion in CSV importer 2009-12-24 10:38:56 -05:00
Sean Rhea
9d1ed11186 fix compile error with std::sort on Linux 2009-12-23 07:57:46 -05:00
Sean Rhea
58e6fe59b6 remove old intervals code 2009-12-22 18:11:02 -05:00
Sean Rhea
818f678436 use RideMetrics for intervals in RideSummaryWindow 2009-12-22 17:54:50 -05:00
Sean Rhea
ea2177cc62 add ninety_five_percent_hr metric 2009-12-22 17:54:50 -05:00
Sean Rhea
4b1805f3c2 add max_power metric 2009-12-22 17:54:38 -05:00
Sean Rhea
96b00f4b77 fix metrics for interval use 2009-12-22 17:53:40 -05:00
Sean Rhea
fa843db0ab figure out zoneRange from RideFile::startTime 2009-12-22 15:40:30 -05:00
Sean Rhea
ef200085a8 compute metrics in RideMetric
Move the logic for how to compute RideMetrics from a RideFile, including
dependency tracking, out of RideItem and into RideMetric.  I'm going to start
using them for intervals as well as rides, and I don't want to construct a
RideItem for each interval.  It also seems more natural here.  For
performance, RideItem still caches the computed metrics for a RideFile.
2009-12-22 15:23:02 -05:00
Sean Rhea
e16443e23f aggregateWith takes a const reference 2009-12-22 15:23:02 -05:00
Sean Rhea
0d7e923c93 get rid of PointwiseRideMetric
It's no shorter than just calling foreach, and I feel it just confuses things.
2009-12-22 15:23:02 -05:00
Sean Rhea
85e9202c15 add more comments to RideMetric.h 2009-12-22 15:23:02 -05:00
Sean Rhea
abae88dc6c don't repeat "Average"
In the average column of the RideSummary, we don't need to re-emphasize that
the averages names' start with "Average ".  I hope this doesn't cause
problems for translation.
2009-12-22 15:23:02 -05:00
Sean Rhea
59a0908da4 get rid of metricsXml
Instead, just list the symbols of the RideMetrics for each column, then get
the name and precision of each metric from the RideMetric object.  This change
builds the groundwork to letting the user specify which metrics to show.
2009-12-22 15:23:02 -05:00
Sean Rhea
d096eb8854 add RideMetric::precision
...which specifies how many digits after the decimal we should show when
displaying the value of a RideMetric.
2009-12-22 15:23:01 -05:00
Sean Rhea
8aa0996e6e add RideMetric::name
The name of a RideMetric is a short string suitable for use as a label in the
ride summary.  It should be translated using QObject::tr().
2009-12-22 15:23:01 -05:00
Sean Rhea
d2b44ec508 rename RideMetric::name to RideMetric::symbol
The symbol of a ride metric is the string by which we refer to it in the
code, configuration files, and caches (like stress.cache).  It should not
be translated, and it should never be shown to the user.
2009-12-22 15:23:01 -05:00
Sean Rhea
9b4782ab98 srm interval end bug fix
If the user forgot to end an interval before downloading a ride, GC
would crash due to an assertion failure.  The included ride file
demonstrates the bug.
2009-12-22 14:49:54 -05:00
Mark Liversedge
32b94d954f add bring to front/send to back to PfPvPlot
Another rightclick menu for intervals, adding a bring to front and send to
back option but only when viewing the pfPvPlot, additionally the algorithm in
PfPv plot for determining which interval a point is used for has been adjusted
to fully populate every interval curve where appropriate (and incorrect
comments and redundant code have been removed).

IntervalItems now have a display sequence number so when you have
overlapping intervals you can bring to front and send to back on the
PfPv plot. The display sequence could be used on other plots if/when
they distinguish between intervals.

Previously, the coloring of intervals on PfPvPlot was determined solely
by the order they were defined which could be quite confusing.
2009-12-22 09:51:02 -05:00
Dag Gruneau
7a90ac8783 use setting for imperial/metric in interval dist
Before, the heading showed "Distance (km)" but the actual value was always
displayed in miles.  This patch fixes it.
2009-12-22 09:44:09 -05:00
Thomas Weichmann
9717eeb798 add context menu to ride tree
Includes save, delete, split, find peaks and best interval functions.
2009-12-22 09:35:20 -05:00
Mark Liversedge
d10b08e86f switch from QToolBox to QComboBox
This patch removes the QToolBox from commit e93970 and replaces it with
a QComboBox instead. A new object ViewSelection can be included in any
new views and will manage the interaction with MainWindow to switch
between views. It is essentially a QComboBox with some code to interact
with MainWindow.

A new signal viewChanged(int) has been implemented in MainWindow to
notify of a view change. The parameter will be set to VIEW_ANALYSIS
or VIEW_TRAIN depending upon which view was selected.

In addition, a new TrainWindow object has been created which implements
the Realtime code and is comprised of the TrainTool and TrainTabs
implemented in e93970. It also sets its splitters from remembered values
in the same fashion as the central splitter on the Analysis view.
2009-12-21 13:34:28 -05: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
e93970ed4d Introduce Toolbox to GUI
The left side of MainWindow is now a toolbox which contains
Ride Analysis and Racing and Training options. The Right side
tabs have been reorganised and associated with the toolbox.

To support the population of the Racing and Training left tool
the config dialog has been updated to enable the user to configure
the location of their workouts.

In addition, the config dialog now calls upon MainWindow to issue
a configUpdate() signal to notify widgets when config has been
updated. This is a refactoring of the existing mechanism that
only called realtimeWindow->updateConfig, now any widget can
connect to the MainWindow signal and re-read its config appropriately.
Currently, the TrainTool and RealtimeWindow widgets have been coded to
use this.
2009-12-20 21:39:38 -05:00
Sean Rhea
e5affbbc64 introduce "metric overrides"
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.
2009-12-20 12:29:33 -05:00
Sean Rhea
0dae2b88cc don't explicitly specify bs
It's going away soon.
2009-12-20 12:29:25 -05:00
Thomas Weichmann
9474f281db reorder ride menu, add separators, capitalization 2009-12-19 19:09:26 -05:00
Mark Liversedge
30341cf339 Stress Calculator loses pending changes
The stress calculator works through every ride and updates stress.cache.
After each file is processed its details are wiped with a freeMemory, this
causes unsaved changes to be lost (isDirty is ignored).

This patch adds a check to make sure the file is not dirty before the
in-core values are deleted.
2009-12-19 18:58:17 -05:00
Mark Liversedge
937907c6b8 Support Metric/English units in realtime mode
Realtimode mode now supports miles and kilometers for speed, average
speed and distance telemetry.
2009-12-19 18:54:17 -05:00
Mark Liversedge
1a96535708 Computrainer code to open COM ports above 9 on Windows
The docs for CreateFile indicate that to open a comm port above
COM9 you must use a filespec of "\\.\COMX". The original code
did not apply this rule and failed to open ports above COM9 as a
result. This is especially important since it is quite common for
the USB->Serial converters to assign an assignable comm port number.
2009-12-19 18:50:40 -05:00
Mark Liversedge
d1d2037883 New Cyclist set first CP SEGV fix
When setting up the CP for a new cyclist the code for inserting
ranges called setCP with an unitialised range number variable. This
fix sets it to 0 for the very first range.

Also fixed the indentation of the code around the fix to make it
easier to follow.
2009-12-19 18:48:54 -05:00
Mark Liversedge
feb111a4ff RideFile reading refactoring
With the introduction of the rideSelected signal the RideFile was
opened (as previously) by the RideSummaryWindow::htmlSummary()
member. In some cases, this signal was processed by RideSummary window
AFTER the other charts (AllPlot etc) this results in 'No data' being
shown on other charts.

This patch moves the file reading to RideItem::ride() which was previously
a public RideFile * (that is now a protected member ride_). As a happy by
product it removes the need to check if the file has already been read
across all other functions ensuring in-core values are not accidentally
overwritten. The read errors are made available by a new RideItem::errors()
member.

This modification is required to support the RideImportWizard in freeing
loaded RideFiles during batch import to ensure virtual memory is not
exhausted when large numbers of files are imported at once. This modification
is also included in this patch.
2009-12-18 19:39:29 -05:00
Sean Rhea
71d67e2203 check that cp > 0
The commit replaces the erroneous commit a3ae0ee.  I thought the problem with
the zones file that motivated that commit was that some of the zones were of
length zero.  In fact, the problem was just that the CP is zero in the first
zone range, and a CP of zero leads to a RI of inf.
2009-12-18 09:38:22 -05:00
Mitsukuni Sato
009c013521 add calls to tr() for translation 2009-12-17 19:10:36 -05:00