When the samples in a ride file start from a large offset
e.g. 6hrs is the timestamp for the first sample. The
ridefilecache will compute bests over the initial 6hr
gap.
This patch adjusts the timestamps so they always start
from zero, but only when calculating bests -- it does not
modify the ride data.
We may want to consider 'automatically' fixing this during
ridefile reading, but for now this fixes a nasty bug that
causes GC to hog CPU for large periods of time when computing
the cache.
Fixes#510.
VLC will disable the screensaver during playback. This patch
exploits this functionality bringing it in line with the Mac
builds.
One small nit remains; under Windows/Linux the screensaver
is only disabled if video playback is being used, whilst on
the Mac the screensaver is disabled whenever you are active
(e.g. on a basic workout or streetview).
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
When compiling the Mac video stuff on Lion with SDK10.5
the code used a pre-processor directive to include code
based upon the max version allowed.
But if you are using an earlier SDK the max version allowed
is still higher, so instead we use the GC_HAVE_LION define
instead.
This change only really affects anyone on Lion or higher building
with an earlier version of the SDK.
Because black does not show up against a black background
(the default for a ride plot).
This was not a big issue, but it is used by the train view
as the color for the timer and results in black writing on
a black background.
This might be cool if you're in a band called Disaster Area
but not so cool if you want to ride your turbo.
The "tabs" of the toolbar are now offset to the right
and fixed with a specific spacing.
Similarly, the training view buttons are fixed to the
left.
This ensures that the "tabs" don't move as toolbar
buttons are added/removed.
This removes the flickery artefacts when moving away
from train view and also gets ready for more specific
buttons on the other views.
Updated the realtime view (Train) to put the
realtime controls in the toolbar and removed
the old realtime controls chart. They only
appear in Train view.
Additionally, the workout list and media list
are now in the sidebar under 'Workout Library'.
Finally, the first device configured is always
selected at startup, but this is a temporary
change until the realtime device wizard is coded
to set a default device.
A few minor fixups for Mac OS X;
* LionFullScreen.mm compile issues resolved by introducing
a new define in gcconfig.pri. This will hopefully go when
issues with Qt and AvailabilityMacros are resolved. See
DEFINES += GC_HAVE_LION in gcconfig.pri.in
* The buttons on the realtime controls are now set to GTK to
avoid Qt constraints regarding spacing and format of
QPushButtons. This will hopefully go when we move the controls
to a task bar at the bottom of the screen.
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.
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.
The train view video/media list is constructed by attempting
to parse any file found in the workout directory. This was
a strategy to avoid missing files with odd extensions that
could be processed by VLC and also to avoid needing to
maintain a list of common extensions.
In practice, this was very slow to process and quite annoying.
VLC would load large volumes of DLLs and Codecs when trying
to parse.
In addition, the most common file types /by far/ are from
a relatively short list i.e; .mov, .avi, .mkv, .mp4 etc.
The strategy is now adjusted to search for a common list of
file types, namely;
3GP ASF AVI DIVX FLAC FLV M4V MKV MOV MP4 MPEG MPG
MXF Nut OGG OGM RM VOB WAV WMA WMV
The filename is checked without case sensitivity, i.e. files
will match regardless of whether they are in upper or lower
case (or combination of upper/lower).
The libvlc options setup used --extraintf=logger, which
causes a debug console window to be opened on Windows.
This patch removes this since debug output is only of
value to developers and should not be in released code.
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.
The refactoring of the realtime display last year
removed the display of metrics such as BikeScore and
kJoules.
This patch adds more metrics that can be displayed;
* Averages for; power, hr, cadence, speed
* KJoules of work
* Coggan Metrics; NP, TSS, IF, VI
* Skiba Metrics; xPower, BikeScore, RI, Skiba VI
Also included is an updated default layout to
include some of these metrics.
Fixes#231
We call usb_reset between sessions on Linux/Mac
because the USB device is left in an undetermined
state after close. In the comments I noted that
it was odd this was not required on Windows.
Well, it turns out it is not available on Windows.
This patch ensures we do not try to call it when
compiling for Windows.
Add support to toggle full screen mode on Linux
and Windows, in similar fashion to the recent
update for Mac OSX Lion.
A new view menu option to toggle full screen has
been added in lieu of the Mac titlebar icon on
either Win/Linux. Additionally, hitting Function
key F11 toggles fullscreen and hitting ESC whilst
in full screen also returns to normal.
Even if the C pre-processor will remove a class definition
in a header file the QT moc utility will still create a
moc_Xxxx.cpp file which requires the class to be defined.
As a result the attempt to create an empty header for the
LionFullScreen class when compiling on earlier versions than
Lion causes issues.
The LionFullScreen class is now always declared and defined
but will be not do anything useful on earlier versions of
Mac OS X than Lion.
Temporary modification so non-OSX builds work (Linux/Windows).
The header was added to the main HEADERS += entry due to problems
with moc runs when added conditionally.
Will test on OSX and make further updates if needed.
Because of a bug in qmake we add LionFullScreen.h to the
list of headers to ensure moc is called for the include.
When adding AvailabilityMacros.h to the header it needed
to check that we were compiling for a Mac.
LionFullScreen used this macro to determine if the version
of the SDK is recent enough (Lion or higher).
Unfortunately, I forgot to also check if the OS was Mac OSX
and didn't include the correct header (AvailaibilityMacros.h)
to get the define. As a result all builds on anything other
than OSX Lion failed.
The Cocoa header defines an array called 'slots'
that conflicts with the QT macro (which replaces it
with whitespace).
Re-ordered header includes to avoid the macro clash when
compiling on SDK10.4 or earlier.
Building for versions of OSX prior to Snow Leopard
fails since QTMovieOpenForPlaybackAttribute is not
available, this patch makes this setting conditional
on build support for OS X >= 10.6.
Previous commit only cancelled fullscreen mode
when Ctrl-Cmd-F is pressed, but the common usage
is for the key sequence to toggle fullscreen
on and off.
So we can build on earlier versions of OSX. To improve
things a little since we will no get QuicktimeX without
this reference we now set QTOpenForPlaybackAttribute to
get at least some optimisation.
Mac OS X Lion introduces support for fullscreen applications
and places a fullscreen button on the title bar and animates
etc.
This patch adds support for fullscreen mode. Since there is
no standard way of exiting fullscreen mode we have adopted
pressing the 'ESC' key, since this is inline with most of the
Apple applications (e.g. Mail).
Need to call QTMovie::invalidate before QTMovieView::setMovie to
ensure the mmap is deleted before allocating for the new one. This
fixes mmap errors when scrolling up and down a list of videos.
When resizing windows in tile view the update is a bit
wonky when you have a video window on screen. The layout
code now repaints the entire homewindow when one of the
charts are resized.
Deallocate errors when scrolling through large numbers
of videos, but otherwise functional.
The redraw of the layouts needs to be looked at, since
there are some nasty artefacts when resizing the video
window that need to be fixed separately.
Ghetto code with video selection and all the basic
building blocks in place. Playback is only via the
quicktime controls, paint issues abound and there
is a problem with deallocation of the movie object.
But the basic stuff is there, time to refine and iron
out all the little bugs.
Written whilst on hols in Gran Canaria :)
If cadence is zero when calculating power then we
should set power to zero. Speed will not be zero
when freewheeling and therefore the calculation
will overstate power output.
Secondly, the NullController (for testing) did
not call the realtimeController post process
function. It does now so we can test the virtual
power calculation.
The LeMond revolution trainer has been analysed in
some depth by Tom Anhalt and as a happy by-product
idenitfied the power/speed curve.
Since Darren Hague had already added the ability to
approximate power from Speed when training on a turbo
this patch extends that to include the LeMond device.
All the analysis Tom performed can be read over on
wattagetraining.com here:
http://wattagetraining.com/forum/viewtopic.php?t=335Fixes#498.