Commit Graph

22 Commits

Author SHA1 Message Date
Mark Liversedge
05f1d577db Refactor MainWindow Part 2 of 5
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).

We no longer pass around a MainWindow pointer to children
but pass a context instead.

There are still a few pieces left in MainWindow that need
to move to a better place;
    * Setting/clearing filter selection
    * Working with Intervals
    * Adding/Deleting Rides
    * Save on Exit

As mentioned previously there are lots of other parts to
this refactor left to do;
    * break MainWindow Gui elements into Toolbar and Views

    * migrate from RideItem and Ridelist to ActivityCollection
      and Activity classes that are not tied into gui elements.

    * introduce Application Context and AthleteCollection
2013-07-11 14:02:02 +01:00
Mark Liversedge
e407237ac0 MainWindow Refactor Part 1 of 5
Breaking the MainWindow 'god object' into
separate classes for Athlete and Context.

Further updates will need to;
- break MainWindow Gui elements into Toolbar and Views

- migrate from RideItem and Ridelist to ActivityCollection
  and Activity classes that are not tied into gui elements.

- introduce Application Context and AthleteCollection

Once these are done we will be in a position to decouple
most classes from mainwindow and also introduce tabbed
athletes.
2013-07-07 15:50:28 +01:00
Jon Escombe
5a27ae15c9 Fix CRS file granularity
Using the CompuTrainer utility to convert GPS logs to a course profile
results in lots of very small segments where the height differences are
less than 1 metre. These were incorrectly handled as the altitude was
being stored as a long.

In fact the double to long conversion was always rounding down, for
instance 200+0.01 is 200 as expected, but 200-0.01 is 199. Therefore the
course would gradually ratchet downhill with every small data point.
2013-02-17 15:56:49 +00:00
Mark Liversedge
f5b5668905 Code Cleanup: ErgFile
.. XXX is a suggestion not a TODO.
2013-02-11 14:07:55 +00:00
Jon Escombe
7c84a1e905 Fix lap number issue
.. lap number jumps around when playing a crs file
2013-02-07 19:28:55 +00:00
Mark Liversedge
2d73924f25 ErgFile lookup CP
Instead of passing the CP value for the rider
when opening an ErgFile it now looks up the CP
value itself. Simplifies the API.
2012-12-21 11:09:52 +00:00
Mark Liversedge
d2ebedac20 Workout Library Part 1 of 3
Implementing a workout library that keeps
track of media and workouts that can be used
in train view.

This first part implements;
- library.xml to record search paths
- search dialog to find media/workouts

Part 2 and 3 will bring:
- Sqllite libraryDB to store found details
- Update traintool to use libraryDB and display
  icons, duration/distance, IF and TSS in list
- import and drag-n-drop of new media/workouts
2012-12-20 13:30:49 +00:00
Marc Boudreau
c1d8c1ca51 Fix:
- incorrect RegEx to read some CRS files
- all files were assumed to be metric - (UNITS = ENGLISH) now converts
- scaling adjusted to not clip the top when some graphs were longer
2012-03-16 12:28:32 +00:00
Mark Liversedge
194f944923 ErgFile now supports 'named' intervals
As a precursor to more sophisticated workout
creation and config, the ergfile format and
plot now supports named intervals.

This is so we can identify blocks of the workout
and reuse them by name (rather than having to
select a section, which should also be supported).
2012-01-06 19:49:11 +00:00
Mark Liversedge
b07284f1b3 Download from ErgDB
A new menu option added to download workout
files from the ErgDB. Will also need to look
at upload so we can share amongst the GC
community.

Fixes #521.
2011-11-26 17:57:14 +00:00
Mark Liversedge
dc3e06ba34 Fixup .pgmf support (set mode)
The .pgmf file support needed to set the workout mode but
that was missed.

Now tested the Train View with some Tacx ErgoVideos and they
work perfectly.
2011-11-15 20:13:54 +00:00
Mark Liversedge
fb626e683f Add support for Tacx/RLV Workout (.pgmf)
The Tacx ergometer has a workout file format
(.pgmf) that is similar in concept to the
Racermate .CRS/.ERG/.MRC file format.

This patch adds support for this kind of
workout file.

Further work is required to support the .rlv
file format in order to support video playback
to match the user's speed (keeping the video
in sync as you ride).

In addition, for Turbos that do not support
variable load using gradient/slope we will need
to add an algorithm to approximate speed from
power/weight/slope.

Fixes #382
2011-11-12 18:30:56 +00:00
Mark Liversedge
da6a2dc6d4 Further realtime improvements
A number of new features / enhancements;

* Display IF/TSS or Elevation/Grade in the controller
  when a workout is selected.

* Added buttons for forward/back which emulate the
  forward/back from a computrainer controller

* Added a slider to increase and decrease intensity/grade
  on-the-fly (during a workout), tied in with the
  computrainer controller's + and - keys.

* Unpicked the manualOverride code previously implemented

Mostly, or at least for this release, fixes #494.
2011-11-05 18:31:55 +00:00
Mark Liversedge
368aeba04d Remove Globals from ErgFilePlot
The original ErgFilePlot code used local static variables
to bridge between the selected ErgFile and the Qwt data
handlers.

This was not an issue when we only allowed one chart of this
type to be available at once. But now, with a more configurable
layout it is possible to have multiple.

The currently selected ErgFile can now be referenced from
MainWindow in the same manner as the current RideFile can.

This patch introduces no functional change for users.
2011-11-05 13:06:31 +00:00
Mark Liversedge
0edbc5ef11 Reverse unwanted change to ErgFile::wattsAt() 2011-11-04 23:15:29 +00:00
Mark Liversedge
3ca9c14710 Workout (ErgFile) computes metrics
When a workout file is opened, the contents are used
to calculate the NP,xPower thru TSS/Bikescore values
for the workout.

This is in preparation for on-the-fly adjustment of the
intensity of a workout and displaying the target stress
load (TSS/BikeScore) the workout will produce.

No user functional change.
2011-11-04 23:09:06 +00:00
Mark Liversedge
fc826ecc97 Improvements for Train View
The training view has a number of improvements, most
notable of which is the workout plot now plots the
telemetry as you ride. This enables you to view
your performance against the workout as you ride.

In developing and testing this I found and fixed a
number of other minor issues;

* The workout plot didn't have any axes
* The workout plot title didn't reflect the workout selected
* The workout plot markers didn't honour preferences
* Values didn't reset on stop/start of workout
* The rolling 30 second power plot in realtime was broken
* Lap numbers were not available for display

In addition, some minor changes were made;
* Save workout is no longer optional - it always saves
* The control buttons/margins did not resize nicely
* The workout plot uses colour to distinguish between
  workouts that are time or distance based.
* A new default train layout for new users to avoid
  having to muck about with layouts
* Removed the race servers since they are not used
  and steal screen estate. Will re-introduce when
  multi-rider or internet racing is implemented.

I have also added a few workout files into the
test/workouts directory, we should think about how
we can distribute these and allow users to share and
contribute them in the future.

Fixes #493.
2011-10-24 18:09:59 +01:00
Greg Lonnon
42508c7f88 Computrainer Workout Wizard
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
2011-01-30 14:24:29 +00:00
Mark Liversedge
4552cafdb6 MRC File Format Fix
The Racermate MRC file format for workout files did not
honor TIME/PERCENT format files correcty. The code is a
little confusing because it mixes the device mode and
workout file format. Ideally, the file format and device
mode would be kept as separate state settings, but this
patch at least fixed the bug.

fixes #40
2010-03-21 08:35:22 -07:00
Sean Rhea
eb257e0746 remove global ptr to main window from ErgFile 2009-12-13 12:42:09 -05:00
Sean Rhea
1169ca9239 public zones in MainWindow is const 2009-12-10 10:16:58 -08:00
Mark Liversedge
82ac0f5e1f add realtime mode
Joint work between Mark L, Justin, and Steve Gribble.
2009-11-23 10:42:48 -05:00