.. now we've optimised out the model resets the diary window
(calendar chart) needs to explicitly repaint when a ride is
selected because the model won't reset unless the ride selected
is for a different month to the one currently shown.
.. lots of unneccessary setting of dates and refreshing optimised out.
.. but probably more lurking coz we handle updates from all over the
place and worse to miss one than do it twice in most cases.
This reverts commit 6fdc55528f.
The performance decrease is considerable. Using mallocs across
my personal ride collection takes 5:19 to compute all the caches.
Using the QVector equivalent took 22:40.
Need to consider looking at QVector across the GC codebase.
.. will refresh after the metrics and cpx have been refreshed
.. it invalidates the data rather than refreshing immediately
since thats expensive and better wait until refresh is needed.
If an incore cache of an aggregated RideFileCache is invalidated
by a ride in the same period being edited it does not clear
until the cache array is cleared (25 of them so likely to be
never) or upon a restart.
This fixes them being invalidated by refreshCache.
When GC is restarted after being closed full screen, the saved geometry
is larger than the actual screen size - resulting in the title bar being
drawn off screen & not easily reachable.
This patch checks whether the saved geometry is larger than the current
screen size, and resizes to the screen size instead of the saved values.
.. actually it was an uninitialized variable bug introduced
by the earlier fix for the calendar model.
Caused by new code checking if an index was -1 before setting
it, but forgetting to initialise it to -1 to begin with.
Fixes#531.
.. it turns out the translation for Data and Date are both
Data!
.. we now use the first column that matches when seeking special
fields. This is a bit of a hack, but good enough for now.
Fixes#530.
When youi switch to Diary view no date range is known by the
charts because they have just been created. Since we have a
lazy create we need to resignal the date range after they
are created.
This was already in MainWindow with a call to GcCalendar::refresh
but a recent update optimised that out.
The search/filter selects in the activity list but doesn't
highlight the rides on the calendar.
This patch highlights the dates that have activities that
match with a red border and a red number.
After download fails a .strava file is left in the
athlete directory. This is picked up on restart and
causes a crash.
We now create the temporary file in a temporary
directory to avoid this issue.
Fixes#525.
.. example on the cover page of the manual
.. we need them to follow a naming convention
if section-keyword.pdf, e.g. 0-icon.pdf for
the icon on the title page (section 0).
After taking out the double refresh in the previous commit
we got a bug with the last selected date stating highlighted
when clicking on the left and right buttons.
Fixed by signalling date changes after the model has been
queried. Still lots faster than before.
.. no longer ignored in .gitignore
.. they are committed to the repo in the same
way that translation .qm files are
.. in this way those without the right tools installed
(in this case tex and texinfo tools) can still use
them.
.. So FAQ becomes GC3-FAQ
.. and Manual becomes GC3-Manual
This is just so they can be distributed and installed in their own
right and still be identifiable as GoldenCheetah v3 files.
.. restructured the doc directory to distibguish between
website content and user documentation
.. added basic content for FAQ and Manual, but neither
are complete and contain no markup
.. added to the splitter handle context menu
.. also took IntervalItem.h and IntervalTreeView.h from MainWindow.h
coz I was getting pissed with recompiling everything when changing it.
Thats why so many other files have been changed in this commit.
Fixes#338.
.. the RideFile::data member is used by the ride editor and was deleted
when a ridfefile is deleted, but we have no way of telling the editor.
.. now doesn't delete, which is a small memory leak.
.. will use entered text and append 1,2,3 etc
.. or if entry ends with a number, will start from that
.. eg; "Int#3" will result in "Int#3", "Int#4" .. "Int#n"
Fixes#513.
.. akin to the Mac look and feel
.. still needs a bit of cosmetic work, but basically sound
.. also added in fixes to native file imports
Fixes#404Fixes#504
D'oh.
The ridefile reader for JSON files spotted when a file failed
to open but then continued to try and parse it! Now returns NULL
when fopen fails.
This is particularly relevant when using foreign characters in
a filename passed to fopen(). We need to remove the fopen stuff
and replace if QFile reading to a buffer.
.. if you resize them they will show as many months
as they can fit vertically.
.. also removed the scrollbars in the summarys shown
in the diary and LTM sidebar
Fixes#503.
.. taking out last remnants in the code from previous design. This will
also remove the focus block that appears on calendar handle in diary view,
but only really visible on Linux with Gtk/Gnome.
This is the first step to reinstating the calendar on the analysis view
sidebar. Next step is to enhance it to show multiple months and then to
refactor the diary sidebar GcCalendar to use it.
The visual headings are not reset when the view is reset, for
example after startup. This means the wrong columns are offered
on the activity popup menu for group by.
The resetView() function needed to call columnsChanged() to get
the visual headings reset.
.. the start date would progressively change as you selected a
date range in the sidebar. This is because the code to set the date
range to the start of a week looked at the wrong date variable when
using a custom date range.
Fixes#500.
.. but only deletes references and db entry
.. we do not delete from the filesystem -- need to add a dialog
to ask the user to confirm deleting the file from disk.
.. akin to the NSImage 'template' function we now pre-process
the GcSplitter icons to get a shaded and embossed look. Its a bit
clunky code, but its only run at startup.
.. when switching views. It seemed like a good idea at the
time, but now it is really irritating. If I want the sidebar to
be shown I'll select it thanks.
Rather than relying on the parent to maintain the splitter sizes
and states, the GcSplitter remembers its own state and sizing.
This includes remembering if the children have been hidden via the
icon bar at the bottom of the splitter.
The icons are adjusted via utility function iconFromPNG()
which currently just adjusts the icon color to be a muted
gray as opposed to black.
This is the first pass at recreating the 'template' function
used by the cocoa image functions. Will add an emboss feature
later, but at least now they are less vibrant and when clicked
turn black giving a visual clue that they are clickable.
Moved icon bar back to the bottom and made Splitter handle
same size as scope bar.
The splitter handle paint artefacts were caused by splitter
size restore from before the "new" splitter. We will need to
rename all the settings to ensure we don't get incorrect sizes
for them in future.
Since the treeviews didn't fill the space in the sidebar.
This was because the splitter itself wasn't expanding since it
used the sizepolicy of its children.
.. not sure the class hierarchy is right for this stuff, but will
stick with it for now.
.. train tool segvs on device types that were previously
configured but are no longer supported. This fix now silently
ignores any devices that are no longer supported.
Fixes#497.
.. some cosmetic and tidy ups for the recent sidebar WIP update
from Damien. Just trying to get clean look before making the icon
bar look more like the one in XCode and make the icons use the
Cocoa "template" look.
It seems the new PowerAgent version (7.5.7.34) changed the format
of the date/time data in the csv file:
6,2011-01-02 21:22:20|2011-01-02 21:22|01/02/2011 21:22|2011-01-02 21-22-20,0,0, ...
Here are the header lines of the new PowerAgent csv file:
Version,Date/Time,Km,Minutes,RPE,Tags,"Weight, kg","Work, kJ",FTP,"Sample Rate, s",Device Type,Firmware Version,Last Updated,Category 1,Category 2
6,2011-01-02 21:22:20|2011-01-02 21:22|01/02/2011 21:22|2011-01-02 21-22-20,0,0,0,,55.8,807,227,1,CycleOps Joule,18.054,,0,0
User Name,Power Zone 1,Power Zone 2,Power Zone 3,Power Zone 4,Power Zone 5,Power Zone 6,HR Zone 1,HR Zone 2,HR Zone 3,HR Zone 4,HR Zone 5,Calc Power A,Calc Power B,Calc Power C
,0,0,0,0,0,0,148,157,167,172,250,0,-0,0
Minutes, Torq (N-m),Km/h,Watts,Km,Cadence,Hrate,ID,Altitude (m),Temperature (°C),"Grade, %",Latitude,Longitude,Power Calc'd,Calc Power,Right Pedal,Pedal Power %,Cad. Smooth
.. go back to more GC-like color defaults, which became a little
too vibrant in a recent update to introduce linear gradients to
the CP, Histogram and LTM plots.
.. in JsonRideFile.l
Because we added a call to yy_lex_destroy in the parser
but it may not exist in Flex < 2.5.9 or if we are not using
GNU Flex, e.g. good ol' ATT lex.
OK, I admit it, I am OCD when it comes to this stuff. The
handles are a WIP and Damien is working hard on it, but for
now I just wanted to get rid of;
- spacing between handle and content
- focus / height of handle toolbar
Its gonna go when Damien finishes his excellent work, but I
just needed to get rid of it temporarily, I was getting bit
of a twitch ;)
.. just upgraded to Xcode 4.6 and the project files
created by qmake 4.8 don't work. After scanning the
web I found a workaround in QTBUG-29371 and implemented
it in a little shell script: qmake-xcode.
.. to run, from the src directory invoke it with
$ sh ./qmake-xcode
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.
- none - no shading on the all curve
- derived CP - as before using the CP value derived from all curve data
- CP - the value of CP for the time of the ride
NOTE: When in rangemode (i.e. on home) the CP is set to the mean CP for
the date range selected.
.. warnings from Xcode 4.6 (still some remaining)
.. and deprecated Quarqd code (we have native ANT now)
.. and MultiWindow deprecated (it isn't finished)
.. kept allocating a new RideFileCache but didn't delete
the previous one. Given their relatively large size this
can lead large amounts of memory lost in a short amount
of time.
As a personal habit I tend to use the C pre-processor to
comment out code blocks I don't want to remove. This is in
case the code will be required in the future.
I think it is now safe to say the code commented out is not
required -- most of it is legacy and marks the transition from
earlier designs or legacy code.
I've done this in one big commit since in theory it has no
functional change, and in future can look in this commit for any
code we may want to reinstate.
.. lots of confusion about virtual power based upon speed and
using lack of cadence to show no power -- this is invalid since there
may not be a cadence sensor present!
Not sure why, but setting the text on a treewidget item seems to
cost a lot of memory. So we don't bother since it is never used.
In general the valgrind output is ok, quite surprised. There are
very few non-widget items that are alloced but never free'd in the
GC code.
Train view - race* - out of date and no used
Train view - SimpleNetwork - not used
Analysis view - WeeklySummaryWindow - not used
MainWindow - RideCalendar - deprecated 2 years ago
Removed deprecated / unused code, includes;
- racedispatcher.cpp
- simplenetworkcontroller.cpp
- simplenetworkclient.cpp
Will look at the network stuff in OpenTrainer.
.. wow, nasty memory leak fixed. Leaked memory every
time a ride was selected or calendar was refreshed!
.. tbf it was marked with a 'XXX' memory leak comment
but really lazy to leave it there.
.. was also highlighted by valgrind, which is promising,
since I've been using it to hunt down any memory managment
issues -- most of them are within 3rd party libraries tho.
Noticed when looking for memory/stack overflow issues that
the importRide function allocates an aggregator on the heap
for the lifetime of the method. No biggie, but better to use
stack for that.
Because the image representation was stored in the pixmap
which was allocated on the stack -- it should be allocated on
heap since the underlying data is never actually copied.
This seems to fix the issue, but need to keep monitoring it!
Fixes#477.
Removing and fixing 'XXX' code markers across the ANT+
code. Largely this was to confirm against specs and mark
for future support (e.g. burst data, further refactoring
of the quarqd sources).
.. the code assumes the kickr connection will always work, even
when no BTLE hardware is present.
If no BTLE hardware is available then connections fail immediately
and so do attempts to find devices.
If BTLE hardware is available but the kickr connection cannot be
established in 30 seconds in train view then it returns an error.
Also added better device descriptions to check the device subtype
so we can identify stages, inride and kickr separately.
When switching between a ride with datapoints and one
without, then back again. Editor data was being deleted
for previous ride edited when selecting a ride with no
data!
All are harmless but for the sake of clarity have
fixed them all bar a couple;
- Lucene grumbles about signed/unsigned conversion which
is/isn't valid depending upon the version of CLucene you
compile with. Either way it is harmless.
- QxtScheduleView has a bunch of issues, but since it is a
third party widget its better to leave it unchanged.
The find dialog and anomalies list are now available
from the ride editor toolbar and not hidden in the
chart controls.
As a result the ride editor no longer has any chart
controls and so they are removed altogether.
When plotting distribution for a date range instead of
for a specific activity we should not hide when the current
ride has no data (since we are plotting a range not the current
ride).
A few fixups for BT40 discovery, we now search for BT40
devices properly.
- delete BT40 properly
- scan for longer
- return count of total found
- a few fixups to logic in AddDeviceWizard
Now need to update the pair screen to let the user
select/deselect sensors that are part of this "device".
Then obviously update the BT40/Controller for runtime
activity (and filter out the RFLKT since it will have
its own device type.
Just a checkpoint before BT40 pair updates to connect with
each found sensor and display current data on the pair screen.
This is so the user can select the devices they want to be
included in this device definition (if they have lots of
BTLE devices).
I guess this is gonna mostly be dcrainmaker and wahoo employees!
Ensure the Kickr and BT40 devices can co-exist by
ignoring subtypes.
Also introduced a deviceFound signal so we can get a
device pairing page for BT40 (non-Kickr) devices.
To enable support of BTLE (BT 4.0 'smart') devices
as well as the Kickr.
Very basic skeleton code to get started. Will need
to;
- add a BTLE 'pair' in AddDeviceWizard
- use profile not portspec for the uuids
- filter out RFLKT and KICKR as they have their
own device types
- fixup BT40.cpp which is KICKR code in this commit
Changed the WF API wrapper to return a sensor connection
descriptor (int) in the same way open/close system calls
return a file descriptor.
This means we will be able to setup multiple connections
at once .. but not neccessarily in separate threads.
No need to scan first, connect directly to
the previouslt paired device uuid.
By no longer scanning we can have multiple
threads connecting at once without conflicting
with each other.
The load setting was not working properly, this update
ensures the load is set 10 times a second, but will
generate errors even though the device claims to be
connected.
Also added a few new methods to get/singal connection
status in the code.
Fixed up the Kickr code to resend the load if the
user is generating more than 50% over the load or
is only generating 50% of the load.
This is in case the last message was not processed
for some reason (connection being established, or
noise).
Just cleaning up the WF API code before adjustments to
the recent BTLE support or Kickr to also support other
BTLE devices (e.g. Speed/Cadence and HR straps).
This will mean adjusting the WF API code to use 'handles' to
reference multiple parallel connections since the existing code
assumes a single connection to the Kickr.
A number of memory management errors fixed, no doubt there
are more lurking in there.
* CocoaInitializer now sets up an application wide NSAutoreleasePool
* Kickr now init/releases an NSAutoreleasePool for its thread
* Local autorelease pools in constructors etc have been removed
* Searchbox and Button no longer release in the constructor
The icon corruption seems to be improved (I think it is a memory
management issue) but has not been totally removed.
I changed the fixed height of the allplot reveal
controls and forgot to set it back. It leaves a
little artefact on the plot when they hide.
I took out my edit and it fixed it.
After discussion with Damien;
* solid white background for the controls looks best
* CP on chart labels need to be less obtrusive
* keep the controls to a simple but useful set
I also tidied up some of the margins since they were
also wrong.
.. when plotting QA or Scatter plots we frame
intervals with all points of data. By default this
has been black.
.. this tones it down to be less high contrast. But
really we should make it a configurable color longer
term.
This finalises beta support for the Wahoo Kickr
using their WFConnector API for BTLE.
This support will only work on Mac OSX - pending
ANT+ support to be available and/or BTLE support
is made available on Windows and Linux.
Fixes#446.
.. connects and disconnects to the Kickr
.. gets instant telemetry
Still need to sort the other channels (are there
any?) and also set load and gradient.
Pretty close and need to then clean up the qDebug
messages and we have a first pass at Kickr support.
It was because the connector was still searching when
asked it to connect to a sensor. We now cancel any
search before attempting to connect.
But sadly, the connection is dropped and a bunch of
error messages popup about firmware.
.. because it blocks the event loop that hosts the WF API
class. And we definitely want it to stay on the main event
loop along with the native WF classes and delegates.
.. because we didn't maintain the currentWindow when
showing blankstate pages the drag and drop functionality
didn't work.
This is kinda key when you have no videos and workouts, its
the simplest way of providing the files needed.
.. needed to manage autorelease pool
Lets not talk about the hours wasted trying
to fixup the code whilst BT was disabled via
OSX and the Kickr wasn't actually plugged in.
Made the spacing in tile mode smaller and cleaned up
the decorations to make them cleaner and more in line
with modern UIs like Win 8 and OSX.
Also parameterised the spacing / margins in HomeWindow
in case we want to add a slidebar to adjust them or
maybe even a zooming.
First pass of using latest WF API (3.0.beta2) but
there are event exception problems within the WF API
so committing a checkpoint.
This has BTLE status and Scan functions implemented,
I also updated About dialog top include the WF version.
Just the framework for the abstraction layer. I
wanted to commit this since its the blank state
and clean.
Now to implement;
1 hasBTLESupport and friends
2 scanForDevices
3 connect/disconnect device
4 getRealtimeData
5 setLoad/setGrade
Once thats done should be easy to write a controller
and runner for TrainView.
Last step will be to add a configuration pane -- but
might wait until I have a BTLE HR strap to include
the 'multi-device' stuff.
.. black controls on a black background might
be cool if you play in a plutonium rock band
from the Gagrakacka Mind Zones, but for the
rest of us its helpful if the controls are
slightly more visible.
A bit of hacking with style sheets and the controls
now change color to contrast with whatever background
color is selected.
Provide more data to Garmin Training Center and
also makes the export compliant with the latest
TCX schema. It displays correctly in GTC.
As an avid runner and biker I use GTC to combine
the data from both sports for additional analysis.
I'm sure others would benefit from the additional
data in the TCX file when importing to other tools.
The following derived/computed metrics have been
added to the export:
1. Added MaximumSpeed
2. AverageHeartRateBPM
3. MaximumHeartRateBPM
4. MaxBikeCadence
5. AvgSpeed
6. AvgWatts
7. MaxWatts
8. HeartRateBPM defaults to 1* (if not present or zero value)
*Garmin training center won't display the HeartRate
charts if the tag isn't part of every TrackPoint and
greater than zero.
.. I broke this in an earlier commit where I set
contents margins to 0, thus making it impossible
to resize in tile mode and also making the chart
overlap with the border.
.. it needs to be applied every time a
date range is selected, so need a new bool
useToToday to flag that up.
Will need to fix the other date range charts
to do the same.
Write a valid TCX file, that conforms to its
schema, including;
- ProductId is ProductID
- Watts must be an integer
- Language ID is required
- PartNumber has a specific format
Add reveal controls to the histogram window, using
the new reveal framework.
I only added a small number of controls, we should
be careful not to overload this feature with a zillion
controls "because one user wants it".
Setup code to enable revealed chart controls. When
in tabbed mode, if the cursor is towards the title
then the chart controls are revealed, as the cursor
moves away or off the chart the controls are hidden.
Each chart, that wants revealed controls must implement;
bool hasReveal() -- return true if controls are available
void reveal() -- show controls (must be at top of chart and a single line)
void unrveal() -- hide controls
Will now work through each chart adding the controls as needed.
Will also probably end up with a 'standard' flat stylesheet for
the controls, can implement this later.
See description for this feature here:
https://github.com/GoldenCheetah/GoldenCheetah/issues/31#issuecomment-12040318
.. now closes train view blankstate when device added
and workouts have been imported.
.. and made the home and diary views have same buttons
as the analysis view. That may change in later releases
when we have planning functions.
The diary, home and analysis blank state screens will
now close if rides are added.
Still need to make the train view blank state screen
close when devices and workouts are added.
Tcx XML HR must be positive, so if there is no
value (i.e. it is zero) then don't write it.
Thanks to Dean Junk for diagnosing this and
posting his findings to them mailing list.
Bug reported by many users, should know better than to
dismiss it so out of hand. There was a bug. The ANT+
code used an old global setting and not the per device
configuration.
Fixes#441
Just wordwrap the labels gives more screen estate to
the right side image making it less likely to be out
of proportion with the text size.
Also changed disc to disk in one of the narrative
texts. Maybe its a 'British English' thing tho ;)
Set the default size of fonts and screens based upon the
screen size we're running on.
We may need to think about retrospectively adjusting the
font size for users that have not realised they can change
from the defaults (which may not be valid for their hardware).
Nothing major, just setting no focus on buttons since
it gives them a salmon pink color, which is pretty nasty
on the 'img' button.
Did I mention that I love this new feature?
Changed the second action to search for videos and workouts
rather than import. It makes more sense to setup the library
rather than import a single file.
We still need to change the conditions for the train view blank
state to no devices or no videos/workouts.
When overriding the duration, time riding and other
time based metrics in the metadata screen it asks
the user for the time in seconds.
This update offers a QTimeEdit to edit them, a little
more user friendly.
Fixes#422
Added chart date selection to the Histogram chart.
This now completes the updates to enable custom date
ranges to be defined in charts that support date
ranges.
Any further 'ideas' for setting custom ranges can be
added into the DateRangeEdit widget and will be re-used
across all the charts.
Fixes#417
To get the date settings to register user interaction
you needed to restart gc after adding the chart. This
was caused by an initialisation error, setting the active
flag to true on object creation -- it should have been
set to false.
.. added a 'This' option to choose a date range
such as this month, week, year. I also added the ability
to specift a 'prior' period.
So in July you could plot for this month prior 1 to choose
a date range for June.
This allows folks to have a static setup of charts for this
this-1 and this-2 months and data to change over time.
Updated LTM chart date range to allow the
user to specify a number of alternative
ranges;
- use current selected
- use current selected thru today
- between x and y
- last n days/weeks/months/years
- from - today
An update to allow users to define a specific date
range for a chart on the home window. This update
only applies to the LTM chart and only allows a
date range from/to to be defined.
It would be nice to also support a last 'n' 'period'
selection too (i.e. last n days/weeks/months).
Also, further updates are required to add similar
functionality to TreeMap, CP, Dist and Summary charts
when they are on the home window.
column names from xml file need to be translated to match translated headings,
other posibility would be to match before translation, but this option needed
fewer changes.
When optimising for performance the measures
refresh was lost in LTMPlot. This reinstates
them.
Additionally, measures are now shown on the
metric list with a "(m)" after their name to
help differentiate them.
For example the notes field on its own tab looks fugly
with a frame inside a tab (especially on a Mac). So this
patch removes the frame and background for a cleaner look.
For some reason when selecting a target directory
for batch export on the Mac the returned value was
always the same as the supplied value.
Fixed via temporary variables, but not sure why it
fixes the problem, tbh.
The Mac button icons would go a bit odd, this seems
to be caused by not setting an alternate image for
buttons (they have two images one for each state).
Base classes should have virtual destructors to
ensure derived classes destructor is also virtual.
This is not a major issue, since in all of the
warning cases there is no base destructor, but
its nice to shutup the compiler warnings.
It wasn't possible to add a season until a user
defined season was available!! This fixes that.
We need to make the sidebar Splitter have titled
handles with actions like this on it (ala QtCreator).
There is a feature request open for this.
I really hate the way QMacStyle changes the style of
a button based upon its size. Its really annoying, especially
since you cannot override it.
Updated last couple of commits to have no effect on Mac where
they make some of the buttons in the preferences pane look ugly.
Put a button on the scope bar to add a chart. This is more
intuitive than the right click menu. The style could be
better but ok for now.
Deprecated the right-click menu option since it is unintuitive
and hidden from the user (i.e. bad UX).
Remember the selected video or workout when refreshing list
on data change. This is particularly relevant when dragging
and dropping in videos and workouts.
- Added drag and drop dialog and functionality
- if only 1 video/workout imported it is imported and selected
- if multiple they are imported with a dialog
- now shows any references in the scan function
The use of references to avoid making copies of videos is
a touch complicated -- the workflow could be friendlier.
It's possible to use macports to install the qt dependencies and this change introduces language to that effect. It describes how to install both qt and the qt-sqllite dependencies.
As reported on the list the cu/usbserial device contains
a non-hexadecimal number (given example cu.usbserial-A2QYN3QJ)
this update changes the regexp to match.
Some fixups to recent update for the workout
library support;
- ergDB download now updates the DB
- mainwindow menu options names more consistent
- sort order in the video and workout list
- hooks for import/drag and drop
Will now write the importer for drag-n-drop and
import workouts menu option.
Always on top hint is not appropriate for the
chart settings since the LTM chart settings
open another dialog -- which then appear behind
the dialog and cannot be moved.
Fixes#401.
Linked up the training db to the train tool to
allow users to select from the db.
Further enhancements to the list could be made,
but leaving this till we move to OpenTrainer.
Still need to add drag and drop to copy into
the library or add reference to the file.
Fixes#301.
My eyes started to bleed at the burst of color
on the cp plot after the introduction of a
linear gradient there. Just toned it down a bit
for the "rainbow" all curve.
Add trainDB sqlite database of workouts and videos
found during a library search. A bit ghetto but
works well enough.
Part 3 will need to;
- update traintool to list contents from db
- allow drag-n-drop of files into db (and worry
about copy to library vs add path).
Don't ask about height/width factor, no-one knows
what they mean and ou can adjust it once added to
the view anyway.
Also, if there are not chart controls don't reserve
the space for them.
Only refresh when dateRange actually changes
within dateRangeChanged() since it is a signal
used by the HomeWindow to ask a replot when
a tab is selected.
Should speed up navigation across diary and
home view.
When dateRange was implemented in LTMSidebar and the property
dateRange was introduced to LTM charts a nasty double and
triple plot bug was introduced.
This update ensures the chart is only plotted once when it is
selected.
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
There were a bunch of preferences that really
weren't needed; STS/LTS starting values were not
being used (and logic flawed anyway).
The mode/days to estimate bikescore were only used
in one place (manual ride dialog) so moved there
instead.
Fixes#396.
ANT.cpp now emits a signal for each ANTMessage
ANTlocalController wires up this signal to a slot in ANTLogger which
writes the message to antlog.bin
Signed-off-by: dhague <darren.hague@fortybeans.com>
Right click to add/delete a new device on the device list
in the train view sidebar.
It is temporary to bring the train view in line with the rest
of GC, but will then be updated as we remove functionality that
is hidden behind a right click.
The recent update to allow CP charts to be added to the home
view and display the cp chart for the range selected did not
update to cater for ride/add delete whilst the season combo
is not set.
As a result when a ride was added/deleted the current index for
the combo was used (-1) to reference the season array resulting
in an fatal assert on array bounds.
Tidied up and enhanced the manual ride dialog. It now
lets users add Sport, Workout Code and Notes (or leave
them blank if they don't use them).
Also added Average HR, Cad, Watts and Speed as well as
deriving TSS and Work.
If there are no rides in the last 'n' days it falls back
to the default for all rides logged.
It also now writes json format files.
Appears to be related to add/removing labels during a paint event,
which is pretty bad practice anyway. To get past this crash the
labels have been removed -- the chart still shades areas to show
the parts of the ride that will be split out, but no longer shows
the number for each segment.
Fixes#379.
The restore / set geometry for the config dialog and mainwindow
was 'adjusted' by setUnifiedTitleAndToolBarOnMac. This meant
that when restoring geometry at startup the window would gradually
decrease in size (by roughly 42 pixels).
Still defaults to the original value of 3 meters. Because
the metrics need to be recalculated when it changes we also
add the hysteresis factor to the zone fingerprint CRC.
Big refactor of the code since it was really messy
and also moved to a Mac style config dialog with
a bit of Mac UI polish.
Moved many of the pages around to make it more user
friendly.
Removed the fortius and proxy code altogether
and removed the measures config since we will need to
look at this in v3.1 and don't want to have to add
backward compatibility support for users that change it.
Fixes#358.
This patch keeps the original english name of SpecialFields and SpecialTabs
as internalName, to preserve compatibility, while it uses a translated
displayName for user interfase in other languages.
The code setting metric names and units was moved from constructors to
an initialize method, to be called after translator initialization.
English Name is preserved as InternalName for metadata.xlm compatibility
in metric override.
Q_DECLARE_TR_FUNCTIONS(class-name) macro is used to set tr() context
when class-name is not QObject sub-class.
When a cell in the treemap plot is clicked they are displayed
in the popup pane also used by the LTM charts.
We do need to tart up the popup, but at least now the treemap
plot does something meaningful.
Fixes#364.
The treemap chart was developed as a variation of an LTM
chart and as a results has the same chart settings etc.
It has now been refactored to be a standalone chart with
no need to re-use the LTM settings and code.
This is also in preparation to support click through on
the cells to show a popup of rides.
When parsing in locale's where numbers use a
',' as a decimal point, strtod fails to parse
lon/lat values.
Thanks to Horst Huschauer for the fix.
Fixes#365.
There were a few metric options on the LTM
chart that were introduced a looooong time
ago when playing with filter ideas.
They don't do anything and will confuse the
hell out of users. They are now removed.
Workaround that by putting new columns at the left
not at the right and the problem goes away. Suspect
it is related to issues with QT and expandLastColumn()
which also displayed issues.
Linker error using different TimeScaleDraw::label but
also a memory leak with unneccesary calls to create a
new ScaleDraw object.
Also applied recent fixes from qwt6 for scale draws. We
should look to pick up some of the other recent fixes
-- especially QT5 support.
Fixes#363.
When adding a chart to the home view no date range is set.
This update ensures that the last selected date range is
used, so when a chart is selected/configured some data
will be shown.
When importing a GTC export (which contains multiple ride
files in a single .TCX) the screen update stalls whilst the
file is split. The import dialog is half drawn and looks
ugly to the user for a split second.
We now delay updates until the export has been expanded
into separate files, which means there is a slightly longer
delay as the file is initially processed, but the screen
updates are cleaner.
Recent commit 8eee2ddb got some of the logic
the wrong way round for converting weight to KGs
before saving (and when switching between metric
and imperial units).
We always store weight in KGs.
Recent update to use deleteLater() when removing
a chart in the event loop /always/ deletes the chart
regardless of the user selection, this is because it
is deleted in the wrong place.
It was deleted when the user selected the close menu
option (in GoldenCheetah.cpp) rather than after the
user had confirmed (in HomeWindow.cpp).
If you press ESC on the chart settings (not add chart) dialog
then the dialog is closed and deleted, causing a SEGV. This
patch overrides reject() to ensure the dialog is just hidden.
The painting artefacts are a problem only on a Mac. Suspect
it is a QT bug. Disabling the bubble on a Mac for this reason.
Its starting to grate anyway, perhaps there is a better way
of doing this.
RideNavigator set the GCBubble to the wrong position on
screen which can be confusing when you have a narrow list
of rides. The bubble appeared to be displaying for a totally
different ride.
The last patch to show events on the LTM chart only
worked when grouping by weeks. This is because the
groupby x dimension is baselined to the starting date;
i.e. groups always start from 0.
This patch fixes displaying events when grouping by
days, months or years.
Events are now maintainable in the sidebar and this
update now plots them on the LTM plot.
Events and season markers are shown so long as they
fall within the chosen date range.
Add the ability to create and maintain events in
the LTMSidebar. This is a follow up to adding
support for Events in seasons.xml.
The last step is now to add support for annotating
charts to show the events for the date range selected
and possibly for the seasons within that date range.
When reading a PWX file we try to guess the recording interval
by looking at the first two samples. This can lead to silly
values when there are recording errors.
This patch sanity checks the recording interval and sets it to
1s recording if the derived value is unusual.
The last of a series of recent patches to address performance
degradation from the introduction of the LTMSiebar. This last
patch introduces a CPX aggregates cache to re-use aggregated
CPX data (e.g. for plotting a specific season or date range).
The cache is set to only hold 25 caches, which should be enough
for most folks list of seasons. But won't get unwieldy if they
scroll around in the diary view.
The following will be introduced in the last patch of
this series:
1. Introduce 'events' within a season and plot them on the
LTM chart -- a form of 'annotation' but also the beginning
of planned events in the future too.
2. Implement click functionality on LTM charts but decide if
we use click to annotate or to define a new date range or
both?
Don't refresh CP, LTM or Histogram plots when dateRange property
is set, if the dateRange was previously plotted anyway. Will set
to stale if a ride is added or deleted too.
This means the replot of tabs is not performed when simply switching
between tabs. But will if the date range does change or a ride is
added or deleted meaning the aggregate needs to be re-calculated.
There is still one more performance improvement required;
1. get RideFileCache to have a cache of recent aggregations.
Since (a) the same ranges will be called over and over by
different charts when a season is selected and (b) there
are only likely to be 20-30 seasons defined in total, so
lets cache them instead of recalculating every time.
Remove the double update from HomeWindow and only
update in CP and Histogram when visible.
Still need to:
1. get CP/Histogram to remember what the last update
was to not bother unless something has changed.
2. get RideFileCache to have a cache of recent aggregations.
Since (a) the same ranges will be called over and over by
different charts when a season is selected and (b) there
are only likely to be 20-30 seasons defined in total, so
lets cache them instead of recalculating every time.
We now have a date range selector in the sidebar. The
sidebar has a date range selector and summary. It is
used to set the date range for the charts in the view.
As a result we can now add summary charts to the home view
and LTM/CP/Histogram charts to the Diary view. The weekly
summary chart is now deprecated.
Creating seasons has also been disabled on metric charts. We
will need to decide what clicking on an LTM chart should do,
and look at whether we want to keep the popup bubble or
adjust it.
There are some unfortunate performance degradations as a result
of this patch when selecting date ranges and switching between
charts in tab view. This needs to be addressed as a priority.
Follow up patches, part 2 and 3 will need to;
1. address performance degradations & cache results
2. introduce events in sidebar and as annotations on charts
3. implement click functionality on LTM charts (annotate vs
define a new season/range)
NOTE: existing HOME, ANALYSIS and DIARY chart setups will need
to be rebuilt since chart ids and properties have changed
in this patch -- do not raise a bug until you have deleted
and re-added the offending chart.
Uses the QT proxy query and application wide proxy setting
to allow users behind a corporate firewall to use network
functions (maps, TP.com, ergDB etc).
Fixes#27.
When adjusting column widths take into account the
contents margins. Also shows sort indicator on the
columns when not on a mac (this was changed as part
of the recent Mac native polish commits).
The mac searchbox using a NSSearchField works a
treat on Mac, but the code accidentally removed the
searchbox on Linux and Windows.
This patch reinstates it.
The mac searchbox using a NSSearchField works a
treat on Mac, but the code accidentally removed the
searchbox on Linux and Windows.
This patch reinstates it.
The ride navigator crashed on search after the new
time column was added. This was caused by incorrectly
setting the groupBy member variable (-1 is used to
indicate no group by, it was set to -2).
In addition to fixing the code to set it to -1 the
array reference now does bounds checking to avoid
crashing for invalid values.
The menu drop down can appear on the list view. This is
now disabled via a window property "nomenu".
Also set the new attribute to set native widgets on a Mac.
There is now a little button to show and hide the sidebar
just like in Mac Mail. We now only have to add the add chart
button for the toolbar/scope bar changes to be complete.
Added a scope bar for native mac. The windows and linux
toolbar is a combined toolbar and scope bar, on a Mac it
looks much more elegant to split the two.
We will need to now add a show/hide sidebar control on the
left of the scopebar (like apple mail), the train view controls
in the centre and the add chart to the far right).
In readiness for a scope bar, the Mac unified title and toolbar height
is too large and needs to reduce. It now has very similar margins as the
Mac Mail toolbar.
The scope bar will make it look less compact when it is introduced.
Adjustment sneaked in by accident to reduce the
font size was hard to track down, but this patch
fixes it and also removes some errant (but harmless)
code in the navigator too.
To give the user a bit more feedback when hovering
over the day number in the diary sidebar it gets a
gray background to feedback it is clickable and also
to give a more fluid feel.
This mimics the same approach used in the Mac cal application.
Thanks to Claus Assmann for the fixups;
- RideNavigator double foreach loops used same name for iterator
- N_TTY line discipline is not defined on OpenBSD (possibly)
Would be nice to have a better fix for the line discipline
stuff, but 0 is usually the TTY line discipline. Bit of a
hack, but ok for now.
The left sidebar is now a stacked widget and the toolbox
has been consigned to history. We are now ready to add a
left sidebar for the metric "home" view.
Main purpose of the Performance manager is to show History up to now -
though, peeking at decline of values in next days is still interesting.
This commit makes the PM show the graph up to today, but still allows to
check the next days.
The toolbar buttons for find intervals, split and delete were
too narrow and looked oddly smaller than the buttons to the
left .. perhaps it was an optical illusion but they are now
wider and look more consistent.
Part of a series of commits to adjust the UI on a Mac to
look more native and conform better to the Mac UI design
guidelines.
This patch introduces a unified title and toolbar which hosts
a search field and buttons for commonly used functions like
import, split ride, delete etc.
Since it is not possible (or more importantly good practice) to
hide and show toolbar items the Train View controls have now been
moved to the sidebar on a Mac. This is a temporary measure and
will be resolved in future updates.
Further updates planned are;
Part 2 - fixup the preferences pane to be more Mac-like
Part 3 - Spit and Polish around the charts; drop shadows, controls etc
Hack to workaround QT webkit pretending to have gestures when
it doesn't is no longer needed. It also now breaks the grab
and navigation in the google map.
Fixes#349.
But NOT for win32 and ONLY on the sidebar and tabwidget (for
performance reasons). Since most users prefer the tabbed look
anyway this should be ok.
Performance of the graphicseffect has improved remarkably in
the 2 years since we tried it before. Worth experimenting with
since it adds a bit of polish to the look and feel.
Users turn it on and off in options, it is off by default.
The ride navigator has 0 contents margins which made
grabbing and resizing impossible in paned mode. This
was done to make it look beter when it is a ride list.
It now has a constructor argument to specify if its
being put into mainwindow as the ride list or its being
added to a view.
You can now add the summary chart to the diary
view to get a summary of the date range currently
being summarised on that view.
Once the Home view has its own sidebar that selects
date ranges you will be able to add it there too
and summarise seasons etc.
To allow charts to have a property set for the date range
to plot a new property is added. This will work in the same
manner as the "ride" property.
No functional enhancement.
The ride list / navigator gets a horizontal scrollbar
every time it is shown as the columns are resized but
not taking into account the need for a vertical scrollbar.
The reasons behind this are more complicated but this
patch fixes this annoyance.
Temporary update just to select the left sidebar whenever
a different view is selected. This will go away eventually
but starts to get closer to the finished concept.
Now need to work on the Home View sidebar.
It should be white to be in line with the rest of the
sidebars and have some semblance of coherence.
I also put a rectangle around the box so if the day
color is white you can still see there is a ride that day.
A summary ala the interval summary will come next summarising
either day, week or month for the ride selected.
The readme hasn't been updated for 3 years and needed
to reference the websites with builds and the detailed
build instructions in the INSTALL* documents.
Drop the notion of a rhs sidebar and move the calendar
from the rhs to the lhs toolbox. It will soon be the
context sidebar for the diary view, and also get a
day summary at the bottom, but for now lets just remove
the references to a rhs sidebar.
The chart settings are no longer in the side bar and can be selected
from a drop down menu on the chart. This works in tiled and tabbed
mode and allows for further enhancements e.g. custom menu options
for commonly use config options (ala Android).
This is part of a series of updates to migrate away from a sidebar
that is a toolbox of ridelist etc and move back towards a context
sensitive sidebar.
Use the wrong stylesheet and are hard to read. This adjusts
tooltip and menu to make them more readable but may not be
ideal for those with heavily customised setups.
The named search dialog box uses the same style sheet as
the search box, which looks odd in a dialog box.
This patch ensures the stylesheet is only applied to the
search box and not any children.
An annoying bug that has been around for far too long.. the ride
list headings are resizable and the user can adjust them. But
when GC restarts the sizes are lost.
This was caused by an error in the code that saved away to column
widths -- it failed to use the logical index for each column (since
columns can be re-arranged).
Now upon restart the columns will be the right size -- but for the
very first launch after this bug is fixed the sizes will still be wrong.
They will need to be reorganised and then restart GC one more time.
The sidebar elements all get a blue focus rectangle on
Mac OSX. This is a platform specific setting. This patch
removes the focus rectangle for sidebar components only.
Having used the LTM and Home View for well
over a year I am proposing this default setup
for the home view.
It is just a PMC, Power tracker, CP chart and
a time in zone histogram.
No time and distance etc. But the user can add
these, the charts.xml is there to help.
Last part of the search/filter functionality;
* SearchBox now incorporates filter and search
with a new widget. We can update this widget
to include more fancy UI/Interactions without
having to change the ride list or charts etc.
* Added search/filter widget to the relevant charts
and screens; Metrics, TreeMap, CP, Histogram,
Activity Log, Ride list (refactored out of MainWindow)
* Added namedsearches.xml and adding/selecting them
from a drop down menu on the search box.
* Fixed some performance bugs related to duplicate
signals and redraw/reprocessing. Also ensured that
CLucene remains optional -- but means no search or
filter functionality unless it is available.
Added evaluation of filters and integrated with the ride list, this
means the user can filter the rides listed.
Additionally the search box will highlight the filter in red if
it doesn't parse correctly, and a tooltip describes the errors.
A bit of tidy up to make the About dialog look a bit
like it used to in terms of size and layout. Is now
an acceptable size for those on netbooks or devices
with a small screen.
The about dialog was 800x600. This patch reduces margins and
spacing around the widgets to make it somewhat smaller. There is
still room for improvement though.
Part 1 of Data filtering, this patch adds the ability
to enter and parse filter statements in the search box
(by clicking on the magnifying glass it becomes a filter
box).
The statements can reference metrics and metadata fields
allowing the user to define boolean expressions to filter
data. An example of the syntax;
Average_Power > 200 and Duration > 3600
This references the metric Average_Power and ride Duration. But
will also support operations on metadata fields, for example;
Workout_Code endsWith "SST"
The operators are;
= <> > >= < <= matches contains endswith beginswith
( ) && and || or
Filters are syntactically and semantically validated. But at
this point the resulting tree is not evaluated, i.e. we can
parse the filters, but do not execute them.
Two further updates are pending (once written and tested):
- Part 2 of 3 : Execute filters and apply to the ride list
- Part 3 of 3 : Allow named filters and apply to LTM charts
Further updates will support a visual editor and allowing filters
to be applied to CP and Histogram charts and affect the PMC stress
calculators.
1. Use the whitespace analyzer so its easier to search for
tokens that are a mix of letters and numbers e.g. workout
codes and TT route names.
2. Search as you type. Since we have very small collections
to search across (typically no more than a couple of thousand)
there is no major overhead in searching as you type.
3. Search all texts by default not just the Notes field. This is
a more appropriate default and is less likely to confuse new
users. In addition, it is most likely what most users want to
do anyway.
The Macports lucene does not work, added instructions
to the INSTALL-MAC for getting and building the clucene
libs from their git repository.
Fixes issues with deleting rides corrupting the index.
There are some issues with document deletion and support for
the latest release of CLucene which may be related to having
concurrent IndexWriters and IndexReaders.
This refactoring works fine on Linux. Pushed for safety for
any users that may be experiencing issues when deleting rides.
Further investigation is required on mac and windows builds.
QT crashes if exceptions are raised in the event loop. This was
happenning during program exit and also when deleting rides with
a right click.
This patch traps those exceptions and also, since Macports will
install 0.9.23 we can use IndexWriter to deleteDocuments.
A bug was introduced by the new search/filter update causing the
ride list to not get refreshed when rides were imported or deleted.
This was due to signals from the source model (sql) not being propagated
upstream (groupby) in the standard implementation of qsortfilterproxymodel.
This patch fixes that.
Added virtual power calculations for a Minoura V100
with one selection for whichever gear it is set to.
Thanks to 'frenchman' on the slowtwitch forums for
working out the formulae.
When calculating TSS, BikeScore et al the user can
set a ride specific value for CP to override the
default zones set within configuration (power.zones).
This is because some users like to have a different CP
for indoor vs outdoor riding.
To use this the user will need to add an "CP" metadata
field and only enter a value when they want to override,
since by default it will be zero, causing the standard
zone CP to be used.
Last commit added a new metric but didn't increment the DBAccess
DB schema version, causing DB functions to break. This patch just
increments the version to ensure the DB is rebuilt to include
the new metric.
A few months ago I commented out the calculation of metrics
for manual ride files. This was a hack to avoid fixing the code
to handle metric calculations from overrides where there are no
data points.
This annoyingly meant that the 'rides' metric was zero for manual
ride files, and any derived metrics similarly were zero.
This patch fixes that.
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.
Re-enabled the measures feature, largely to allow donwload
from Withings for folks that track weight.
This is to provide better support ahead of showing watts/kg
on the mean max "CP" chart.
so far, the Performance manager restricted the view to the latest exercise
or today. So it wasn't possible to see predicted TSB for the upcoming
days.
This patch allows me to get a better forecast on when to do the next ride.
This might be meaningless for actual analysis, but helps to match numbers
of devices, that exclude time with zero power from the average
calculation.
While it's controversal to be usefull, this leaves the choice to the user.
Although you should not link with local compress
libraries if you are using the QT supplied ones, it
has caused a lot of problems for newbies.
We now link with compress by default, we may see some
odd / incorrect behaviour with images and TrainingPeaks
upload if the libs mismatch but the developer can fix
that should it arise.
Fixes#668.
Fixes#6.
The qollector binary warning message is not relevant to large
numbers of GC users and not sure if the qollector is even still
being sold.
The message is now removed.
power zone settings dialog allowed new entries with CP=0. This was written
to power.zones, but the parser refused to read these files, afterwards.
This patch rejects new zones with CP=0.
Find interval dialog will now allow you to add
intervals by time or distance (e.g. add interval for
every 10 minutes or every kilometer).
Since there were three menu options all doing similar
things, they have now been consolidated into a single
dialog.
- 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
There was a unit conversion from km->miles being applied to cadence. I have
removed the offending line.
I've also changed the precision so the we report cadence as an integer.
Fixes#601.
Upgrade to QWT 6.0.1, but still uses a locally patched copy
since support for 8 axes has not been included, despite it
being a relatively simple patch.
Fixes#634.
Fixes#567.
oops, overwrote the startTime, accidently. Wondering how this passed any
testing as this resulted in all blocks being skipped.
Added explicit initialization of wanted field, aswell.
turned statusCallback into a member of Device (instead of a parameter to
download() and preview(). This allows all methods to access it, directly
and provide better feedback during open/close/erase.
The patch that was applied was missing a number of critical changes
and needs to be recreated and retested. The majority of qwt was not
uplifted and remained at Qwt 5.
This reverts commit e97aac7919.
didn't have enough precision.
Found all (most) of the gps coord to string conversions and used a constant
to insure all conversions occur with the same precision.
Signed-off-by: Greg Lonnon <greg.lonnon@gmail.com>
Andy Bryson's fixes for quarq power spikes removed
processing of standard power messages (see commit
cc0bd29).
This was because a check was performed on ANTMessage::period
which is not set for Standard power messages and will always
be zero.
This may fix processing of power2max power telemetry.
Includes:
- Resize dialog for Mac users to display all fields
- Modify display of data in fields
- Add Average HR check
- Base code formatting to remove tabs
Fixes#622
Changes to src.pro are to make it so that anything that is set in src.pro
can be overwritten out of gcconfig.pri. This hopefully means that src.pro
will never have to be changed by someone wanting to compile the code using
a different setup to the main developers or on different platform.
Changes to gcconfig.pri.in are to allow the changes in src.pro to be used.
It also adds some new tweaks and documents how to use the changes in the file.
A rudimentary calendar, not customisable or resizable
and only every selects first ride for the day selected.
But it is the beginning of the widgets needed for the
new UI "look" discussed on the list.
Need to work on font sizes for Win/Mac and refining
the whole look and feel. Especially a sidebar widget
to put it in!
Fixes#369.
Last vestiges of references to the old .notes file which
is now deprecated fully and replaced with a metadata tag
"Notes".
If a .notes file exists it will be read in and used to
initialize the Notes metadata tag -- this is pre-existing
functionality and not changed with this patch, which is
just related to LTM Popup.
There are no other know references to the old .notes file
left in the active code.
Fixes#179.
Allow the user to add a chart from the top-level
view menu, or by right clicking on the home page.
I did not implement as right click on toolbar since
there is already an add chart icon on the toolbar
and adding right click is kind of redundant in that
case.
Fixes#606.
The recent AddDeviceWizard exposed some of the
Quarq devices which are possibly experimental.
Commented them out in case they re-appear at a
later date.
A timing issue - when cancelling the background scan
it is possible for the next scan to be performed after
the controller has been deleted.
This is an edge condition and pretty rare, but since it
causes a crash pretty high impact.
The logic for the AddSearch page (which only appears
if the user did not have the device connected when the
initial scan is performed) would find the device and then
terminate without moving on to the final page.
If you define GC_WANT_ROBOT in gcconfig.pri then
we will compile with support for adding a null
device (robot), which is useful for developers
when testing.
See the last line of gcconfig.pri.in.
You will need to touch DeviceTypes.cpp after
modifying src.pro and before typing make.
The initialisation of the new 'channels' member
was being set inside LIBUSB conditionals. This
means when built without LIBUSB channels would
not get initialised.
The interval view now allows the user to drag and drop intervals
up and down in the list.
We could extend the drag and drop of intervals to support analysis
of segments/intervals from multiple rides in the future too.
Fixes#405.
ANT+ telemetry data processing in ANTChannel now
checks for previous message period values.
Fixes#607.
[Tested by author on Quarq cranks, error not recreated
on SRM or Powertap devices, but may be Quarq specific]
Introduce a wizard for adding realtime devices since it
is prone to user error, is relatively complicated and is
something most users will only ever do once or twice.
There are several logical updates within this patch:
First; Fix intermittent ANT+ not working
* LibUsb - check bufRemaining is > 0 not non-zero
* LibUsb - Always reset the USB stick on open
* ANT.cpp - Support > 4 channels on USB2
* ANTChannel - Do not use pairing, but always
* unassign, assign and set channel id.
Second; Fix device discovery
* Find and discover support in realtime controllers
* Extend Serial.cpp to cover more Serial devices
* Support for 4 or 8 ANT channels for USB1/USB2
Third; Introduce Add Device Wizard with
* General and Specific wizard pages for each device type
* Device pairing with telemetry display
* fixed compile time warnings
Fourth; Update Device Config Page
* use wizard to add new device
* remove edit fields, replaced by wizard
* remove pair, firmware buttons replaced by wizard
Fifth; Deprecate/Remove Device Types
* Null Device - used by developers only
* Quarqd client - replaced by Native ANT+
* GC Server - not implemented yet
I have also introduced a device specific wheel size
and flags for controlling the default selection and
sources for sensor data when in multi-device mode. These
are not yet supported in the code.
Fixes#611.
Fixes#497.
More complex than I had hoped for, to add
Temperature I needed to;
* introduce two new metrics Avg/Max temperature
* adjust metric conversion to include a conversionSum
for the C to F conversion
* handle temperature as a metadata field as well as a
ride data series
* handle the RideFile::noTemp value rather than just
averaging or calculating max.
Fixes#603.
Thanks to Peter Norberg for the sample data export
files. This support has been written against the
two files supplied.
if the export has imperial/metric conversion options
then this support will need to be adjusted to cater
for different units.
Fixes#322.
Recent update to support distance calculation from
speed and time erroneously assumed speed units of
kilometers per hour. The docs state that speed is
represented in Meters per Second.
Apologies, and thanks to Walter Bürki for his
perseverance with me on this one.
Fixes#598.
Low cadence values (<30) lead to very high
AEPF values. In reality, these very low
cadences are sprious, since they can occur
after freewheeling (the sensor cannot
differentiate).
We restrict the AEPF scale on the PfPvPlot
to 2,500N which should be meaningful for
most humans.
The seasons class emits signals to let
everyone know if the season config changes
at runtime.
The recent patch to add configuration of
seasons deleted and re-instantiated the
seasons member in MainWindow which breaks
updating across the code.
This patch fixes that.
Standard power messages include an instant cadence
value which we ignored. We should use this if it is
available.
Fixes previous attempt by setting Cadence rather than
wheelRPM with the instant cadence value (!)
Fixes#556.
So we can calculate speed from wheelRPM when working
with ANT+ speed sensors in realtime.
The config screen is still ugly as hell, but there is
another bug raised to resolve that.
Fixes#529.
It causes significant performance issues when
pasting complex font information, we only allow
plain text since we only serialise the plain text
elements anyway.
Fixes#599.
Allow the user to add,delete and reorder
seasons in the config dialog.
Although the user could create and manipulate
seasons / date ranges in the LTM chart, this
provides a more coherent place to do the same
but also adds the ability to re-order seasons.
Fixes#399.
It was removed when we had a serious bug
that caused a crash when adding a chart.
That turned out to be related to mouse
event processing and drop shadow graphic
effects.
We can remove this is folks don't like it.
QT-BUG 22574 suggests there is a problem with the
QMacCocoaContainer on 4.8 RC 0. This is a quick workaround
for those building against the 4.8 release candidate.
When using the fast forward and rewind buttons for
a workout we now also fast forward and rewind the
video playback on Linux/Windows.
The same feature needs to be incorporated under
Mac where we use QTKit for video playback.
Fixes#594.
Fit ride file contains samples where the distance
is set to zero, even if the previous sample is
non-zero.
The parser has been adjusted to keep the previous
distance used when a zero value is encountered.
Fixes#544.
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).
Added a usb_init() call prior to starting a workout, this
appears to clear state inside libusb.
Also added some commented code for displaying diagnostics
when sending/receiving ANT messages.
This should make the ANT+ connection more robust on first
use, since subsequent uses are now fine.
This may be related to the state the USB host controller (stick)
is left in after we first connect, more investigation is required.
It was neccessary to reset the USB2 stick between
sessions. This was due to incorrect state data
being maintained within the ANT code.
New sessions should start without requiring a USB
device reset or running ANT agent etc.
Fixes#558.
The recent commit for multi device support cleared
the spinscan data, breaking the plot updates. This update
retrieves the spinscan data if a computrainer has been
selected for the workout.
The TCX parser ignored samples where distance
is zero even when speed and time are available.
This broke reading files from TrainerRoad.com.
Fixes#580.
The metric aggregator did not clear the "errors"
string list when refreshing metrics. This caused
the Json parser to always fail if preceding files
had warning messages.
This was quite common with fit files.
Fixes#552.
It is now possible to select multiple devices to
workout with.
To enable multi-device support a new setting in
tools->options (preferences on Mac) allows the
user to enable multi-device selections (this just
enables the user to select more than one device
in the side bar).
When a workout is started the user can select which
devices will supply which data.
This enables ANT+ devices to override information
provided by Computrainers or Fortius devices.
Fixes#578.
Allow data smoothing, which is particularly useful
during bike fit sessions to watch trends rather than
micro changes.
Also allow the user to select which data series to
plot. This allows you to open multiple plots for
each series.
Forgot to increment the power channels count, which
mean't that the alternate power device was not set.
Also now allow for scanning for same device types on
multiple channels.
The realtime plot was originally set to only show the
last 10s of activity to reduce CPU overhead.
In reality, the CPU overhead for the plot is minimal,
especially when anti-aliasing is disabled.
This update modifies the plot to show the last 60s of
data, instead of the rather restrictive 10s.
Add support for dual ANT+ power devices (in this case using
dual track SRM cranks). The two power devices are assumed to
represent power and alternative power.
The following changes have been made for this support:
* ANT+ device profile support multiple power devices
* Allow editing ANT+ device profile on Mac/Linux (it
is already available on Windows)
* When a second ANT Channel is assigned to power it is
set as alternative, and updates alternative watts
* RealtimeData now supports Watts and AltWatts
* AltWatts dial and associated color settings
* LRBalance dial to show difference between Watts and AltWatts
* Realtime plot plots watts and altWatts
Fixes#572.
Since it can be confusing to new or occasional users, the
workout directory now defaults to the top-level GC directory.
This kind of makes sense since it is shared across all cyclists
and is guaranteed to exist, and will still work when running
from a USB stick.
When we get round to implementing feature 193 and 570 we can
adjust this to suit.
Fixes#571.
Added a menu option to quit all windows rather than
just the current one.
Each window will process a close event and so give the
user the option to save changed files and cancel closing
it.
Fixes#566.
Now only shows monthly view, since;
* qxtscheduleview (weekly) has too many bugs
* rideSummary (ride) is redundant, just add that window to the view
Fixes#546.
Aside from just expanding the sidebar to show it, this update
creates a bit more space for the display of best values in
the CP chart controls.
It would be better if the tooltip also showed the date.
Fixes#565.
For expoediency the training dials used the qwtplotmarker
color but this often lead to things like lap, time being
displayed in black on a black background.
We now have a realtime dials default color setting in the
appearances pane. The default is gray, so will show up on
a black or white background.
The slider in the controls should only be shown
for HR/Power/Cadence. Additionally, it is more
of a 'smoothing' (rolling) average, so the text
has been changed to reflect that.
This is to avoid confusion with the other series
entitled Average Power. Average Cadence and
Average heart rate - which are averages for the
entire ride.
Tom Compton of AnalyticCycling.com has provided
a formula to calculate virtual speed based upon
slope, weight, power, cdA, crr and air density.
This is now implemented as 'Virtual Speed'.
It is expected that this new virtual speed will
be used to control streetview, video rendering
and future implementations of group riding over
a predefined course.
Fixes#527.
Recent fixups introduced a delay of 50ms when
reading from the Fortius controller to avoid
interrupt write errors.
The smoothing of power data was not adjusted to
take into account the reduced frequency of
telemetry updates.
We now smooth at 16hz not 60hz.
By default the TrainingPeaks.com download dialog will
fetch the last year of ride files. This can take a long
time for some users. We now only ask for the last month
by default.
Fixes#561.
When selecting the speed tab on an imported ride-file, GC exits
with the following error on the command- line: ASSERT failure in
QVector<T>::operator[]: "index out of range", file
/usr/include/qt4/QtCore/qvector.h, line 347.
File: PowerHist.cpp on line 393
low has value -5.55111512312578e-17 which is like -0.0000000000x
This caused an out of bound error on array lookup.
Fixes#551.
To work with Tacx Fortius on 32/64 bit platforms without
having to install the Tacx software (which requires the
user to pay to upgrade to TTS2/3/4).
Fixes#550.
Under Mac OSX the Tacx Fortius support needed
a few minor tweaks;
* sleep 60ms between read/write operations to
avoid interrupt errors
* clear_halt on read/write endpoints before
attempting to read/write to the device
* remove the errant usb_reset which really should
not have been called in LibUsb since it deletes
the device structure(!)
The LibUsb class has been modified to clear_halt
when opening ANT devices too -- since regression
testing on Mac showed that a) you need the latest
drivers to work with a USB2 stick on Lion (64bit)
and it now appears to mandate a clear_halt when
opening the device (but this may be related to the
Garmin ANT agent leaving it in an unknown state).
The LibUsb (and possibly other classes) need to know
what operating system we are running on at runtime. In
the past this has been achieved with lots of #ifdef pre-
processor conditionals, but this makes the code quite
difficult to read in places.
This patch introduces the variable OperatingSystem and
it can be one of WINDOWS, LINUX, OSX.
Initial support for Tacx Fortius devices.
Note this requires libusb support to be present and will
work on Linux, Mac and Windows.
The handlebar buttons up/down will increase/decrease the
load/intensity in a similar fashion to the +/- keys on
the Computrainer controller.
The cancel button will stop a workout and the enter key
is used to mark a lap.
Slope and Ergo modes are supported, but we do not set the
brake at all if the speed is below 10kph, this is to
ensure it does not get burnt out when users 'grind'.
SPECIAL NOTE:
The Fortius handlebar controller is a Ez-Usb device
and requires firmware to be loaded when it is connected.
Since this is copyrighted by Tacx BV we do not distribute
it, instead, when the user sets up a Fortius device they
must also provide the file. Full instructions on how this
should be done are given when configuring the device.
Additionally, for Linux users udev rules should be added to
ensure that the USB devices are accessible to non-root users.
Fixes#538.
Computrainer spinscan memcpy() used offsets
but failed to declare the datatype used by
pointers.
Interestingly, some compilers will assume a
void* points to a byte, whilst others will
rightly complain.
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.
When working with ANT+ devices the load dial always
showed zero, because the ANT device was not updating
the realtime data with the desired load.
In addition, the target load telemetry always showed
watts even when working in slope mode (where it should
show the gradient).
Fixes#532.
I finally got round to decoding the spinscan data
from computrainers. This is now implented in train
view.
A new chart is available 'Pedal Stroke' to show the
spinscan data returned by the computrainer.
I am unsure if the decoding is 100% on the money but
have been testing for a week and it seems ok.
Fixes#530.
Passing a filename with spaces in it causes some issues
on WinXP/2003, this patch converts all filenames to valid
URLs (which is the preferred way to reference media in VLC).
Specifically;
* The file path is prepended with file://
* backslashes in filenames are converted to forward slashes in URLs
* Spaces are converted to %20
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.
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.
A menu option to upload ride files to the Strava website.
Original code from Justin Knotzke ported to v3 by
Damien Grauser.
If the ride has already been uploaded the upload menu
option is disabled, once uploaded a tag is set in the ride
with the strava id.
Fixes#519.
Pressing F3 on the handlebar controller now starts calibration
mode and pauses all video and recording. Pressing F3 again will
resume the workout and restart.
Fixes#392.
Eric Brandt provided a fix for the new FTDI adaptor
sold with Computrainers from late 2009. It only fixed
the problem under Windows.
This fix applies the same modification to turn off
hardware flow-control for Linux and Mac.
Fixes#523.
All the existing wpk metrics concentrate
on the wpk for a fixed period, which is great
but we should also support it for an interval
(where it is arguably most interesting).
This patch fixes that.
Fixes#467.
They are horrible. We need a better solution. The
"smart" layout was the wrong solution and everyone
hated them.
We need some ideas about how this should work.
Some users often switch between v2 and v3 of GC. Either
because they are testing or they are transitioning from
v2 stable to v3 development builds.
But at launch the metricDB is refreshed each time, since
the v2 and v3 metrics are so different.
To avoid this, from version 3 the metricDB file will be
called metricDBv3 to avoid conflicting with the original
metricDB file.
Fixes#376.
The show/hide sidebar, Toggle Tabbed Mode, FullScreen
and Add Chart buttons now have a tooltip to help explain
what they do.
We still need better icons too!
Fix compile on Mac SDK < 10.7, silly initialisation
of fullScreen in MainWindow when it doesn't exist
and fixup gcconfig.pri.in definiton of GC_HAVE_LION.
When building with the latest Xcode their is a conflict
between the QtMacSegmentedButton cocoa container and the
same declared in QtMacVideoWindow.
This patch removes QtMacSegmentedButton since we do not
use it. There appears to be a container in 4.7 anyway
so we no longer declare our own.
Video and FullScreen are fully operational now on 10.6
or higher using 4.7.4 or higher of QT.
The add chart menu had the ride plot on home
and charts were ordered in a relatively random
order.
This patch orders the charts by relevance for the
particular view and moves the 'Performance' chart
to the Analysis selection.
We have previously written a walkthrough for building
on Windows and Linux, we now have a walthrough for
building on a Mac.
INSTALL-MAC is in the top level directory is a plain text file.
The TimeScaleDraw declaration and definition in
ErgPlot.h clashes (silently) with the definition
in PerfPlot.h.
This caused a SEGV at runtime, but only with some
build tools (but notably Xcode on Lion). Not at
all sure how this has not arisen before.
ErgFilePlot now declares as HourTimeScaleDraw to
avoid the clash.
Mostly caused by the Nazi style police in Cocoa wanting
huge margins etc. Steve knows best. Now uses the Windows
style for toolbar buttons so we get control back from
you know who.
The group by model gets called by the view with a row
number -1. The code didn't check it was in bounds, which
causes a crash with Qt4.8, possibly a bug in 4.8 but a
bounds check is pretty harmless anyway.
Instead the defaut layout now has the ride summary
and details as the first chart in analysis view.
Funny how we've come full circle back to the original
layout. Kinda reassuring I suppose.
Also fixes SummaryWindow splitter handle being rather
ugly.
Fixes#518.
The drag and drop function for adding charts may
be functionally appropriate, but it is not intuitive
for new users.
This patch moves the add chart function to the toolbar
as a drop down menu. it also makes the chart selection
context sensitive - so on training view only realtime
charts are listed.
Fixes#517.
If no workout is selected (and ERGO/SLOPE mode are also not
selected) then the plot does not extend once you workout
beyond the first hour.
This was due to an uninitialised variable (ergFile) this patch
fixes that.
Fixes#515.
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.
Added a button to toggle fullscreen on the toolbar. Not on
a Mac though since it is in the titlebar.
Also made the view buttons slightly larger. We desperately need
some nice icons / branding for the UI.
Fixes#513.
To switch between tab/tiled mode the selector has
been moved from the homewindow to the toolbar. A
menu option to select tab/tiled mode has been
added to the view menu.
I have also added icons (that change) for show/hide
sidebar and tab/tile select. The show/hide sidebar
check was not being changed when you use the toolbar
button, this has also been fixed.
The scroll view mode has been deprecated. (But the code
has been retained in case we decide to re-introduce it).
Fixes#512.
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.
This update completes support for USB2 sticks for ANT+ devices
in train view. The code now works on Linux and Mac as well as
Windows.
IOKit is now a required framework for builds on Mac OSX and
src.pro has been updated accordingly.
I have also added a tarball of the required version of libusb
in a new 'contrib' directory. Users may wish to use a later
version or download from an alternative source, but this
version is guaranteed to work.
Fixes#310
Fixup support for USB2 on Linux via libusb. The code
is pretty ghetto with a maze of pre-processor conditionals.
But it works.
Of special note:
* You MUST build with a very specific version of libusb, the
stock libs in Ubuntu do not work. Might pull the code into
the main repo, since its pretty darned tiny.
* On Linux access controls for the USB devices is controlled
by udev, and requires a rule adding to ensure the devie can
be read/written by users other than root. A udev rule file
has been added to a 'linux' subdirectory in src.
Some of the timeouts and usb setup/reset code has been adjusted
to ensure the device is always in a consistent state. This appears
to be more important on Linux than Windows for some reason.
Make the buttons expand to fit space, so as you resize
the controls the buttons increase in size.
This is a temporary measure as the controls are going
to move to the toolbar later anyway.
The code to select media and then start/stop/pause
playback during a workout has been implemented.
This requires libvlc to be installed at compile time
and will also require Videolan (and desired codecs)
installed at runtime.
Since the main headaches are likely to be related to
deployment rather than coding this update has been
pushed for deployment support to be enhanced and
tested before closing the feature request on the
bug tracker.
References to TrainingPeaks should never have a
space between the words Training and Peaks.
Modified at the request of our friends over at TrainingPeaks.com.
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.
The realtime control background now matches the rest
of the realtime charts.
This is a temporary measure before adding view specific
controls on the toolbar (see feature request 492).
Updated the realtime plots and dials to use the colour
settings from the ride plot. So if you prefer plots of
light colours on dark backgrounds you can do this now.
The use of colour on the telemetry values makes it easier
to distinguish which value related to power et al .. especially
when you're pushing out that last max power interval.
Now we adjust the axes for large values it is helpful
to be able to zoom into areas of the chart to look
at the 'bulk' of data (or perhaps even outliers).
This patch adds a zoomer;
* mouse select to choose zoom area
* right click to zoom back out
After feedback, the wizard has been tweaked so that;
* The default minimum gap to find is 1 minute
* The default minimum segment size is 5 minutes
* It is now possible to uncheck gaps in recording
Also, on a Mac the wizard style is forced to ensure
that a cancel button is available since the Mac
assistant style did not (you needed to press ESC).
Higher values for AEPF/CPV have been observed with
track sprinters. The fixed axis on the PfPv (QA)
charts truncate the display.
This patch adjusts the axes to suit the data and will
also ensure the zone shading and labels are extended
to the new maximums.
The PfPv code also contained a lot of tab characters
and the general style was quite dense, making it
difficult to read and understand. I have adjusted
to use a 4 space tab-stop and adjusted to match the
general style of the rest of GC.
Fixes#463.
Linux build using the 4.8 qt rc uncovered a couple
of bugs in the new ride navigator code. This fixes
that, but needs to be tested in earlier versions,
e.g. 4.6, 4.7.
You can now place a ride navigator on the chart layouts, this allows
the user to configure many more columns and use the navigator to
browse and order the activity history in a log/journal format.
The default diary layout now has two tabs; one for the calendar and
another for the activity history.
There appears to be a few minor bugs related to column/chart resizing
that have been present for a while, but are more obvious now the navigator
is a chart in its own right. These will be resolved later.
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.
Moved to the view menu and initialised 'currentWindow'
to the analysis window on startup to avoid a SEGV if
you reset the layout without having ever switched views.
The interval highlighter on the ride plot
uses the same axis as power, but if no
power is present in the activity the axis
is hidden, and therefore so is the interval
highlighter.
This patch will set the interval highlighter
curve axis to one that is in use.
By making the grid 'relatively' small snap to grid feels
quite acceptable as a standard way of resizing, alleviating
the need to make it a user preference.
The old 'smooth' resizing was a pain to get things lined up
nicely and thus is deprecated in favour of this scheme.
Added a function for Batch Export of current
activity history. The user can select files
to export, the target directory and format to
use.
This completes the updates to improve export
functionality.
Fixes#476.
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.
We ask for phonon in src.pro, but it is NOT required, this
is because the video playback was rewritten to use the vlc
libraries.
Additionally, the build.pro now asks for ordered builds to
ensure the qwt libs are built before src is started. This is
useful when performing builds with multipe jobs (make -j n).
We now recognise more 'device types' in the WKO+
parser. This patch sets the devicetype for these
instead of just defaulting to 'WKO'.
* 0x00 - Powertap (for v1/v7 WKO+ files)
* 0x0E - Ergomo
* 0x1A - SRM (is actually a PC 6)
Additionally, the device type is set to WKO (xx)
when we get a device type we do not recognise to
make it easier for users to report.
Fixed the iBike import. The recent commit removing the
different pausetime length for iBike had a logic error.
The iBike files are no different to any other device
and by treating gaps in recording the same as all other
devices we can now successfully parse all iBike WKO+
files.
There are still 3 files amongst the 7,000 WKO+ files I
have received that fail to parse successfully.
I will look to validate these files with WKO+ since they
may be corrupted.
reverted after testing against more files. There is something
decidedly odd about WKO+ files from iBike computers. The scheme
used to mark pauses in recording is different, but cannot work
out why.
Two minor modifications;
* iBike files now parsed correctly (they
where handled as a special case that was
not warranted)
* Some rudimentary bounds checking whilst
parsing the raw data to reduce SEGV crashes
when parsing fails / is incorrect.
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.
Issue a warning if the user changes the ride date/time
to the same as an existing ride.
They can still go ahead, but when saving it will overwrite
the existing file.
Fixing the save routines to check would require significant
refactoring and can be fixed at a later date.
Fixes#466.
Split ride is a bit of a radical change from the
original; more thought is needed to ensure the
original functionality is retained whilst making
the UI and workflow intuitive.
This patch reverts MainWindow back to using the
old SplitRideDialog.
In some instances split ride will refuse to overwrite existing
ride files (where they have the same date/time). This patch
increments the start time by one (or more) seconds to ensure
there is no conflict.
Fixes#165.
A new wizard to walk the user through the split
'ride' feature. It allows the user to control
the removal of the original and the minimum
gap size and segment size (when searching for
points at which to split the ride).
It also allows the user to select segments and
intervals to split and displays the actions that
will be performed to allow the user to confirm
processing.
if a new activity conflicts with an existing
activity the start time is incremented (by a
second or more) to avoid data loss.
Aside from removing the current ride it is now
impossible to overwrite or lose existing data.
If you select an erg file then choose ergo/slope
mode in train view the workout plot will crash
when the sidebar is hidden / window resized because
the workout plot is still referencing an ergfile
that has been deleted.
This patch ensures the workout plot is notified that
NO ergfile is selected thus clearing the plot and
also ensuring no reference to the deleted ergfile
remains.
The default train-layout.xml adds a controls widget
that references the streetview window. This patch
modifies it to reference the new window id.
In hindsight, we should not have renumbered the chart
ids when introducing the streetview patch, but its out
there now and at least this fixes it for new users.
For some reason the code for setting notes
in v1 WKO files was commented out, this patch
reinstates notes for this version, but will
not get Workout Code since it is not available
in this file format.
Also removed a duplicate switch statement where
sport was being set twice for some reason.
Fixed parsing of v12 files which contain ride graph
horizontal gridlines. This brings the code back into
line with all other versions and suggests the parsing
of v12 files is now robust.
Also added some sanity checks to avoid data integrity
problems;
* Magic number is correct 'WKO^Z'
* File isn't too small
* Start time is zero, will adjust if not
All files from a collection of 2,500 have been parsed
successfully and/or handled gracefully.
There is still a chance the parser will crash with a
malformed file or a protocol we haven't seen before,
but these checks protect other parts of the code.
Code comments have been adjusted to reflect the current
state of the code, which is much better after the
recent refactoring.
This patch removes the invariance for the graph tab and
uses the same protocol as v1 reliably. This has been
tested against 600 files without error.
All popular formats of the WKO format are now supported,
the warnings for v7 have therefore been removed.
Having just recovered almost 900 v7 files I have
improved the code to support this file format. I
now have 4 files quarantined (that cannot be
parsed successfully) from a corpus of over
2,500 WKO+ files.
With over 500 files now processed successfully for
early versions of WKO+ (Cycling Peaks) we can now
support v1 and v12 of the WKO file format.
This means we now offer full support for;
* CP 1.0 and 1.1
* WKO+ 2.2 and 3.0
The warning message has been removed and problems
related to parsing the 'graph' tab settings in v1
files is now fixed.
We need to see more v7 files (quite rate) before we
can move that version out of beta support. Looking at
the code it is unlikely that the v7 support is very
robust, but until we have more files to test this is
as good as it gets.
Re-instate Altitude bitsize for earlier version that was
undone in previous commit. This was a fixup posted in a
recent push that I reversed, but further testing showed
that the original fix was in fact valid.
Fix bug 1s time increment bug introduced in recent
commit and replaced with a safety net check for
daft values for recIntSecs which examines the ride
file looking for the most frequent recording gap
and uses that.
Refactored to improve support for files created
in earlier versions of WKO/CyclingPeaks. The
changes are largely focused on parsing charts
and caches that we don't really use, but need
to be waded through to land on the data points.
This has been tested on over 1,500 WKO+ files
and found to be ok for those. Further regression
testing would be beneficial.
Better support for;
* Running / Swimming files (different chart setup)
* Where users have customised the default charts
* Earlier versions of CP/WKO+ (esp v1 and v12 format from CP v1.1/1.2)
* Latest versions (v3.0)
Specifically;
* Better support for WKO file formats v1 and v12
* Fix parsing of distribution caches and config
* Improved parsing of MeanMax caches and config
* Support for Suunto devices added
* Support for files with no time data
Fixes#457.
No functional change, but fixed up some of the coding nits
in the WKO+ ride file reader.
References to static variables removed (for thread safety)
References to global WKO_HOME variable removed (multi athlete)
WkoParser class introduced (for further code refactoring)
Updates are pending for more robust parsing when users have
customised charts or the files contain running/pace charts
since these tend to cause a crash at present.
Following changes
* added google Map and Streetview charts.
* changed the telemetryUpdate to use a const reference instead of a value.
* RealtimeData is const correct, or more const correct than it was...
* added a new resource files to support the new charts.
* changed the NullController to return a constant speed to help with development.
then the rider is able to control the controlller manually.
When the next Lap marker is hit, the workout continues.
Signed-off-by: Greg Lonnon <greg.lonnon@gmail.com>
The tile view will now layout the charts in a more efficient
manner. It still attempts to run from top to bottom and then
left to right when laying out charts, but now, if there is
any space and the chart will fit in it, it will be moved.
This means you can layout the view with smaller charts surrounding
or to the left of right of a larger one. This is particularly
useful when looking at say a large summary window with a smaller
map and a route profile etc.
It can be a little disconcerting however, since charts will
suddenly 'disappear' when you resize them -- of course they
don't disappear they just move to a space that can accomodate
them.
We could make 'smart' layouts optional if users get thrown by it.
Lastly, fixed a bug when resizing charts -- if they move position
when resizing then the delta (size change) is miscalculated. This
is avoided now by ending any resize action when a chart moves.
Fixes#453.
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.
Fixups for QStringList introduced a new bug
by referencing Time In Zones for HR zones
9 and 10, when in fact they do not go any
higher that 8.
They also were not computed because the
worklist used was updated to include any
HR metrics when the ride is dirty (e.g.
when selecting intervals on ride plot or
updating the metrics within metadata).
No functional enhancements, just adds the code
hooks for triggering a bubble 'popover' when
hovering on the ride list or calendar view.
Will be connected to the popup balloon once
the code for that is complete.
Original code had a bunch of char[] and we have
experienced problems with libc on Windows with
char array allocation in the past.
Since we have QStringList (which is threadsafe)
available to use then we should!
This may correct bug report 445. Will wait for
feedback before closing it.
The background color on the calendar now reflects
the color configration.
The color for each ride is precomputed and stored
in the metricDB (so we don't have to scan the ride
everytime we need to determine its color).
As a happy by-product the ride navigator no longer
scans the text to determine the row color and is an
order of magnitude faster when repainting (although
most users are unlikely to notice in practice).
Fixes#448.
The controls in the sidebar are inconsistent; the interval
selector has no spacing or border for a clean look.
This patch updates LTMTool and TrainTool to be more
efficient with the limited space.
A more extensive update is still required to unify all the
chart controls look and feel and get rid of the clunky
layouts with ugly wide buttons.
Fixups for a GC toolbar and the first pass at trying
to make the look and feel more professional. Whilst the
overall usefulness of the toolbar is moot, the grpahics
show the way for greater attention to detail.
Specifically;
* The sidebar should adopt a similar look/feel
* Chart title bars should adopt a similar look/feel
* Sidebar panes should be unified with the same look
* The style selector needs to move - it is cluttering
up the general clean look.
The code is a little ghetto in places, but will fix up
as the cosmetics are sorted.
The help options links to the wiki page but opens a
QT webkit window. This is so rudimentary it is almost
of no value.
This patch instead opens the wiki in a local browser
session. Thus it will use Firefox, Chrome, IE etc.
This is a perennial issue for new users. The default
action when click dragging on a chart is to Zoom -- this
was probably right when we had no span sliders or stack
view (and no facility for marking intervals either).
But now, most users will expect click and drag on a metric
chart or ride plot to mark an interval or date range.
We get regular feature requests and bug reports related to
this -- basically the mouse actions are not intuitive.
Where selection is not meaningful (e.g. histogram) then
left click will zoom. This should be reasonably intuitive
to most users.
Fixes#398.
The user can now define a value list for the metadata
fields. This means for codes like 'Sport' they can define
values like 'Bike', 'Run', 'Swim'.
The input box uses a popup Qcompleter and will only warn
if the entry is not one of the pre-defined values (i.e.
it is not a MANDATORY list).
Fixes#444.
The Alt-key combination for the Athlete and Activity
menus were both set to ALt-A. This patch changes them
to Alt-A for Athlete and Alt-C for aCtivity.
* Rides are now Activities
* Cyclists are now Athletes
This is just a first pass, no doubt many more
lurk within the codebase. Will raise a defect
to cover the remainder.
Although the codebase refers to 'cyclist' in a number
of different ways (classes, setting names, class members)
we should always use 'Athlete' when prompting the user.
Fixes broken controls on train view, so we can now start stop
with the sidebar hidden and also adjust the settings for the
realtime dials on the layout.
Will need to think about saving the properties of the controls
to use last used settings.
Fixes#439.
The metadata information is now shown within
the sidebar.
We need to implement a mechanism for the users
to configure the sidebar widgets etc pretty soon
now, since this update is useful, but the sidebar
is getting crowded out.
Minor changes to ridemetadata to allow a 'single
column' view, but mostly all the widgets were
already instantiated so there is no real cost
to this update.
If the model plot cannot be refreshed when data
is invalid, the plot needs to be hidden since the
qwtplot3d api does not redraw empty plots and does
not have any methods for clearing the canvas.
This workaround just hides the plot and shows a label
when the plot is invalidated.
Fixes#429.
View menu reinstated to allow users to show
or hide the toolbar and sidebar as well as
select layout views; home, analysis et al.
Also added a window menu option to switch
between the current open windows. This is
particularly useful if the other windows
are on another virtual screen.
Fixes#367.
Fixes#29.
Added a new signal to MainWindow to trigger
a zoom to interval. This signal has been trapped
in AllPlot (Ride Plot), but will also need to
be supported in;
* Ride Editor - highlight/zoom to interval data
* Aerolab - Same as ride plot
* Maps - Zoom in to section
depending on the style used on a given system the text in the tab bar for
selection of different charts (summary, ride plot...) may be elided on
screens with small resoulution. This overrides the use of scrollbars
which is was set explicitly in the v2.x code. this patch forces
the use of non-elided text in the the tabs so that scroll bars appear
regardless of the defaults for a selected style.
Fixes#433.
Amazingly, the stack plot does not honour the chart
controls. If you select ony a single data series it
will still display all series.
There was a //XXX 'todo' placeholder in the code for
this which has now been completed.
The header size in FitRideFile has increased from
12 to 14 bytes, but the new field is at the end of
the header, not in the middle.
Additionally, there is a new global record (79) which
we now silently ignore.
Enhanced ride plot;
* Curves can be shaded (this is particularly
useful when only selecting a single curve)
* Span slider can be hidden (this is useful
when you want a 'smaller' plot, e.g for a
single curve, but multiple plots on tile view)
* Curve selection is set/unset from properties.
There is a repeated 'meme' with regards the ride
plot checkboxes for data series (hr, cad etc). They
are to choose the series to display and NOT to show
which series are available.
If you choose to display HR and HR is not present in
the ride file it is still VALID to set the checkbox,
but of course nothing will be plotted. In this way, you
can define a chart for a specific data series and it
will display whatever is VALID as you select different
rides.
Aligning to recent patch to increase decimal
places when selecting an interval, this now
sets the decimal places to 2 for distance when
displaying the metric (e.g. summary, interval
summary)
When plotting HR on a histogram we set the x-axis
to only plot within the recorded heart rate range,
but the recent patch to fix up LogY settings meant
that values are always > 0 (1e-9), resulting in the
plots rarely being adjusted correctly. This patch
fixes that.
When you select an ergfile the axis for the workout
plot is not set, this often results in a plot with
large amounts of white space to the right of the plot.
Fit file format can now have a 12 and 14 byte header. This
patch adds support for 14 byte headers since this is required
by the latest 310xt firmware.
Fixes#430.
Update to a number of plots to align with
the flatter, less cluttered chart style
used elsewhere (Ride, Histogram, CP et al).
Changes made are purely cosmetic and apply
to:
* Aerolab
* HrPw
* Realtime, ErgFile
* Weekly Summary
The previous commit hide/show of QTabWidget caused
an errant incremental resize of the tab widget. Not
at all sure why, but this fixes it.
We may want to move to a QTabBar and manage the stack
of widgets separately as QTabWidget seems to be displaying
some weird behaviours.
For some strange reason, if you startup in tiled
view and switch to tabbed view then back to tiled
view QTabWidget didn't honour setUpdateEnabled
for the QTabBar.
There is a related QT BUG number 9010 that seems
related to this but was closed without being fixes.
We hide/show the QTabWidget in HomeWindow during
a style change and it seems to avoid the screen
flicker issue.
Weirdly, if you startup in Tabbed view the problem
does not occur. It is possibly caused by having a
QTabWidget with no tabs before calling show().
Either way this patch gets 'around' the issue.
When changing from tab to tile view the updates
are processed during the transition. This is ugly
and unneccessary.
This patch turns off updates during the transition
and then refreshes at the end. As a result it is
faster and you don't see nasty transitions to the tab
bar.
With v3 we have removed the sunken frames on
all the plots to make for a cleaner 'flat' feel
to the charts. The 3d plot has now been adjusted
to be in line with the rest of the plots.
If you attempt to download from a Macro device
and use wrong device or initial read fails then
it crashes, this patch fixes that.
It does not fix more general data errors but should
at least mean incorrect user selections do not result
in GC crashing.
Fixes#366.
When importing a ridefile we have never checked that the
same ride (date/time) does not already exist but in a
different ridefile format.
For example, importing a TCX file when a .RAW file already
exists for the same date/time causes conflicts with the
.cpx and .notes file (it is not possible to distinguish
which ridefile the notes/cpx file belong to).
Fixes#389.
A couple of members in mainwindow should have been
removed a while back (chartFoundry trying to fix
add chart crash) and getSplitter (hack for resizing
the sidebar).
This patch removes them. No functional change.
The AllPlot smoothing algorithm is coded to smooth
to a sample rate that is /higher/ than the sample
rate within the ride.
As a result, when a shorter smoothing rate (e.g. 1s)
is a applied to a ride with a greater sample rate (e.g. 5s)
the algorithm breaks down.
This patch ensures that smoothing is only performed when the
smoothing rate is greater than the ride sample rate.
Fixes#416.
Now uses a homewindow 'layout' for the Diary view.
This means you can drag and drop other charts onto
the diary view and resize the calendar etc.
Planning functions will belong here eventually but
this patch is just to tidy up the UI a little to
make all the views configurable.
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.
They're dog slow and looking through the QT bug
tracker no longer developed or supported on normal
QT widgets without QT Quick.
They also break drag and drop on Win7 64bit.
Fixes#324.
Control settings now have a text edit for renaming a chart
alongside all the other control settings. It might be more
intuitive to allow the user to click on the title to
rename it, that is for the future.
Fixes#397.
This patch removes the dialog box that pops up
when you drag a chart onto a layout and sets the
title of the chart to a default value (which is
the chart name).
This fixes the drag/drop crash on Windows 7.
However, when dragging and dropping on a 64bit
Windows 7 there is still a crash, this appears
to be in a different part of the code and will
require further investigation.
Also, since the title is now defaulted it is
important that the user has the ability to
rename charts once added. This is already
registed as bug no. 397.
The CP window tries to draw the current ride, even if it
has just been deleted (i.e. on delete event it tried to
calculate()) this fixes that.
Other widgets are fine, this is a consequence of trying to
redraw the aggregated curve and current curve when being
notified the ride has been deleted.
Bad form to delete an item and then pass a reference to it.. when
mainwindow removes the current ride it passed a pointer to the
rideitem just deleted, rather than emitting the signal before it is
deleted.
A distinction is made in mainwindow to emit the signal AFTER the
ride has been removed from disk (so metric/caches can clean up) and
removing it from memory (so charts can decide what to do).
Part of a number of fixes for bug 401. This ensures
the histogram chart is updated when a ride is added or
deleted when showing aggregated data (not a single
ride). Will set a 'stale' flag if not visible and then
refresh the data the next time it becomes visible.
The patch to support stacked charts inadvertently
broke the other chart types by adjusting 'count'
but at a different level of scope. This caused the
other styles to miss the last nth value. So, if
there is only 1 value in the date range you would
not see any data (for example).
The LTMPlot code is now getting a bit hairy, it is
almost an application in itself. Consider refactoring
in a later release.
Remarkably, using transactions even when querying
SQLITE databases improves performance. If you have
a lot of metric charts on the home window then this
patch will make startup a lot faster.
Additionally, as we refresh the charts as rides are
added and deleted this should help to reduce the
performance impact when lots of charts are open.
There is an SQLITE performance FAQ that provides
more background here;
http://web.utk.edu/~jplyon/sqlite/SQLite_optimization_FAQ.html
StressCalculator created a duplicate connection to
the metricDB, this was not needed since it could
reference and re-use the existing one from MainWindow.
This is a vestige from v2 code where the metricDB was
only refreshed/maintained within the metric tab.
No functional or real performance improvement here but
allows us to convert the metricDB to an in-core ":memory:"
database in the future.
Preliminary tests suggest there isn't a huge performance
gain from in-core but that may change as we do more with it.
FIT record type '253' occasionally causes time to go
backwards, this might be a decoding error, but for now
we force time to go forward anyway.
Looking at bad files GPS data with this patch suggests
this is the correct behaviour.
Fixes#104.
The LogY function for histograms was overlooked
when implementing intervals. The baseline and
start/end values of the interval curve needed to
be set to non-zero values to match the main curve.
[Folded in manually from commit #a562d2 in master]
An errant git rebase lost these changes, this is
to support the GTC export file support and updates
the Json parser to use the new call semantics and
gets the Import wizard to clear up temporary files
when it closes.
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.
When a large number of intervals are defined (>50 or so)
then the RideSummary window crashes.
It appears to be a bug in QTextEdit. It does a double free
when setHtml is called, after a 'large' text item was
set. It may be a QString bug.
To avoid the issue we use a QWebView instead of a QTextEdit
to display the summary and then try and set fonts to match
the application.
Fixes#299.
The metricDB columns are renamed to more friendly values
in RideNavigator, and the GcCalendarModel was looking for
a columns "Filename" when it was named "File".
This mean't the call to the model to retrieve the filename
when an entry was clicked on the table view (diary) would
return "".
Strangely, this worked fine on Linux. But it is definitely
a bug. This patch fixes that.
Fixes#330.
If you save a ride and then delete it. The re-import and save
you will end up with two copies of the ride in the ride list.
This is because when we save the first time the original file
is renamed to e.g. ride.tcx.bak and the new ride.json is then
created. All is well.
But then delete the ride and it will rename ride.json to
ride.json.bak. Again, All is well.
Now, re-import the ride. We now have; ride.tcx.bak and
ride.json.bak and ride.tcx. Again, all is well.
But now, if you make changes and save it will attempt to
rename ride.tcx to ride.tcx.bak AND FAIL. This is because
the old ride.tcx.bak file is there. It will then create
ride.json. All is NOT well, since we have two rides with
the same date and time but different extensions.
This patch fixes this by unlinking ride.ext.bak before
trying to rename the file.
Fixes#348.
Metrics are refreshed immediately now, rather than waiting
for a request for them. This approach was valid when metrics
were only used on the metrics tab -- it made sense to refresh
when the user wanted them.
With release 3, we use metrics in a number of places as a cache
and also to speed up performance (e.g. RideItem::computeMetrics
was removed a long time ago).
This also fixes a related but when deleting the last ride -- it
did not disappear from the ride list (because the refresh would
only be triggered when a new ride was selected).
Dropshadows currently kill the CPU. This is caused by the way
they are implemented in GC and not QT. More work is needed to
make them fast.
For now, this patch makes the default to NOT have drop shadows.
The ride file readers will often set metadata fields
for device specific information, or just to store data
that has nowhere else to go.
In addition, when an athlete shares a ride with their
coach they would need to keep a common metadata setup.
To get around the 'hidden' nature of metadata that is
not configured and therefore not shown, the metadata
screen will show all tags, which are not shown elsewhere
in an tab labelled 'Extras'.
It is not possible to edit this data, we may change that
later. But for now the consequences of users changing
'internal' metadata is unquantified.
The overhead of creating and destroying widgets on the
extras tab mean that scrolling up and down the ridelist
with the Extra tab shown may be slow for some users. I
have optimised the refresh as much as possible (it has
zero impact if the extras tab is not selected).
In developing this I found that the homewindow
was sending two update signals when you were in tab
mode. This is fixed and tab mode should feel a tiny
bit snappier.
Fixes#385.
This is a fix for bug 205 which is registered against v2.1 but
is also present in v3. This fix will not be relevant for v2.1
since the cpi file has been replaced with the cpx file.
The WKO+ file reader still wrote to a .notes file
rather than updating the Notes metadata tag. This
patch fixes that.
Notes files are still referenced in LTMPopup, so the
current bug request for completing the notes file
deprecation cannot be closed, yet.
The find dialog expected the between values
to be small and high, this patch will find
values between regardless of whether the
search values are lo/hi or hi/lo.
Fixes#351.
Notably when you select a color in the config appearances
the dialog will have modal focus but be hidden behind the
config pane, this is tedious as hell.
I have now checked across the codebase and there are no
dialogs which insist on being on top so the OS window
manager and user is now free to manage windows as they
see fit.
Although not directly related this fixes the only possible
problems with window focus that could be related to another
bug reported by Fernando.
Fixes#117.
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.
The ride editor does a pretty good job of finding anomalies
in the ride data, and to help it underlines the anomalies with
a wiggly red line and adds a tooltip to explain.
But, you have to scroll up and down the file to look for them
and when you are scrolling at high speed the wavy lines are
difficult to spot.
This patch updates the ride editor controls (which previously
only had the find dialog) and adds a list of anomalies at the
bottom. You can click on an anomaly to jump to it in the ride
data.
The choose cyclist dialog allows you to open
a cyclist that is already open. This is not
a great idea since the two windows will conflict.
This patch introduces a global vraiable to track
open windows (mainwindows) and MainWindow maintains
it as it opens and closes.
AthleteTool still needs to be updated to refresh
as new cyclists are created (and when its written
deleted).
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.
Following on from the recent changes to the Google Map control
to support their new v3 API, this patch introduces an alternative
map view using the Microsoft Bing v7.0 API.
Remarkably, the MS and Google APIs are extremely similar. Porting the
original code to use the MS API was relatively trivial. It would
probably make sense to combine the two charts into a single chart
with an option to select a map provider.
However, at this point to help in code maintenance they are separate
charts. It is likely that they will diverge somewhat to take advantage
of the differing features offered.
The same functionality and basic colors/lines are available in the
Bing map as the Google one. We should look at adjusting, since the
Bing map styles are more detailed and go to a much higher resolution
than Googles. As a result the current theme looks quite clumsy on
a Bing map and could be changed to use more strident colors and
take advantage of dash polylines (for example).
The Google Map view uses a Web view which by default
attempts to handle drop events. This interferes with
the adding charts via drag and drop. This patch fixes
that.
Multiple issues fixed related to automagic
resizing of columns as the sidebar is stretched
and shrunk.
* Geometry and Columns are now cyclist specific
since the metadata config is cyclist specific.
* Multiple 'dynamic' bugs related to setWidth() and
columnsChanged() calling each other or being
triggered by a signal caused conflicts
* Column widths were incorrectly calculated when
no vertical scrollbar is visible on the ride list
(typically when the user has just created a new cyclist)
* Incorrectly including the '*' virtual column in calculations
when it should always have a width of 0px
The Ride Navigator should now be relatively bug free for
column resizing. More tests are needed on the interaction
with the old context menu (i.e. delete/add/save ride). Some
preliminary tests suggest it is pretty stable.
The WKO+ file format appears to record drops in
recording of GPS data with a latlon of 180,180. We
expect this to be 0,0.
This makes the WKO+ file reader consistent with the
GoogleMapControl and removes the need to clean data
there.
If it is found that 180,180 is the standard way of
recording drops in GPS signal then we can change the
code. We use 0,0 since it is conveniently at sea off
the west coast of Africa.
When there are no rides to select in the ride list (e.g. when
just created a new user) right click for a context menu will
crash since it assumes there will always be a ride selected.
Since a large number of user 'bug' reports and
worse, coding errors, are caused by mishandling
user setup (missing CP, HR parameters, Zones, Weight)
the new cyclist dialog now prompts the user for basic
parameters when creating a new cyclist.
There is no need to warn about seasons.xml missing, it
is quite acceptable to have none set. Worse still sending
to the console log is next to useless for users that
don't launch from the command line.
the bad timestamp initialization in PowerTapDevice showed a lack of
error handling.
This patch makes the DownloadDialog handle bad timestamps more graceful.
Actually it falls back to the current time and allows for later fixing.
startDate for the rideList returned after download wasn't set properly.
Use proper method instead of static fabric funcition.
Thanks to Eric Yoo for finding and fixing this.
fixes#365
The comm port types supported by srmio may vary depending on the build
system (no ftd2xx.h, no termios, ...).
This commit keeps GoldenCheetah from using unsupported srmio port types
based on the srmio build.
reading unsupported SRM files caused assertions. This shouldn't happen, as
it's no Programming error.
Changed the checks into graceful failures.
fixes#364
if the devices have a way to identify which CommPort they support and if
CommPorts are just for this device, this is now taken into account for the
port combo box:
Unsupported ports (i.e. currently D2xx for srm) aren't shown for the
selected device type.
Serial ports that are hard-wired to a certain device type (like built in
USB2Serial adapters in PC6/7) aren't offered for other devices, as well.
As a temporary hack, this PCV claims /dev/cu.*PL2303 to be "his". Of
course this has to go, if/when we start supporting other devices with
built in prolific usb2serial adapter or native serial interface (that
might get connected to a prolific adapter).
If we find a way to gather more details for the available ports, we can
extend this quite easily. Possible ideas:
- hald (obsolete)
- libudev (linux specific)
- kdelibs solid (linux specific?)
Previous commits turned the status/"Instructions" label into a log. This
allows to show a lot more information that simplify troubleshooting
download issues.
To make it behave a bit more as expected, this change turns the label
into a readonly QTextEdit.
The new powercontrols have a lot more memory and they allow you to
selectively download the recorded "rides". Looking at srmwin, this seems
to be the suggested way of operation. (i.e. record multiple workouts,
download only the "new" ones).
Furthermore, the SRM file format has some limits (timespan, total number
of records), that make it inapropriate to store "all rides" into one file
and split it later.
So download now
- tries to get a list of rides of the device
- if it gets any, the user can get prompted to choose which to download.
- let device download (selected/all) rides, split if necessary and return
a list with tmp filename, start time, file extension.
- download dialog builds new filename based on time, prompts user for
overwriting when file exists and renames file.
The download Dialog now stays open, so user can read the status messages
and click "cleanup". This avoids many of the anoying message boxes we had
in the Srm download.
Cleanup's user interaction (confirmation, errors) was moved from the
individual device to DownloadDialog, as well.
made srmio handles attributes of the SrmDevice class and added methods to
allocate/open/close/free these handles. So download() + cleanup() can use
the same code.
As a goodie the handles stay open after download and the second
initialization on cleanup() is skipped - saving some time. Well,
assuming the caller reuses the same SrmDevice instance.
SrmDevice destructor takes care of closing/freeing the srmio handles
automagically.
right now there's just one object for each Device type througout the whole
app. This forbids keeping actual state in the Device object during
download/cleanup.
This patch puts the list of supported Devices into a seperate class.
Actual Device objects are now created dynamically.
This is necessary for the upcoming Download changes.
JsonRideFile saved with 6 and not 11 digit precision
losing a lot of precision when saving.
Additionally, the Google Map used a similar precision
and this caused jaggies on the map.
srmio changed it's API completely. Adopted SrmDevice to use new API.
As a first step, we keep using the "simple" API to save everything into a
single file.
While this works fine for PCV, this will run into limitations of the SRM
file format, quite soon. This needs to be addressed in another step.
CommPort::name used to prefix the actual device name/path with the actual
device type to make it unique. This is used in DownloadRideDialog to map
the device dropdown list to the actual device.
This patch seperates name + device type to make the hack in SrmDevice a
bit less ugly: srmio doesn't use the built in CommPort abstraction and
needs the unmodified device names. This is still ugly, but I can't come up
with anything better (... for now).
toMSecsSinceEpoch requires QT 4.7. And as the caluclation doesnt require
msec precision, toTime_t should be sufficient.
Well, this is mostly, because I'm currently too lazy to update my QT... I
guess, this doesn't have to be merged.
Adds support for the Macro X bike computer for downloading rides
and reading/writing in the native file format (sync).
For more information on this new bike computer see:
http://www.o-synce.com/en/products/bike/macro-series/macrohigh-x.html
[git cherry-picked from master into release_3.0.0dev]
The recent update for the Google Map window reduced the
precision geo-coordinates, this patch fixes that.
Additionally, the wait time was triggered after 60s which
should be 5 minutes (left in by mistake after testing).
When metrics are refreshed the ride navigator
re-reads the metric DB and loses the currently
selected ride.
This patch causes the ride to be re-selected once
the refresh completes.
seems, the assumption for "speed" in SRM7 files being unsigned was wrong.
Powercontrol/SRMWIN seem to use negative speed as "invalid".
Furthermore altitude may become negative, as well.
To address this, QDataStream now does the bit-swapping and speed +
altitude are read as signed values.
Fixes 346.
So far the FIT parser bailed out, whenever it found something
unknown/uninterested to GC. This is quite orthogonal to the FIT design, as
it's supposed to be extended.
renamed read_<foo> functions to match the FIT base_type names.
unified handling of "unavailable/invalid" values - i.e. if sensor data is
temporary unavailable. This allows easier and consistent handling -
especially for the uintXz base_types, which only differ by a different
"invalid" value. Had to change the type of the "values" list to int64 to
fit uint32/int32, as well.
added proper support for signed integer types. I'm wondering, why lon, lat
+ temperature were decoded properly...
added support for currently unsupported base types by just skipping their
bytes. This allows us to continue reading.
... on both, big and little endian machines.
Fit reader only supported little endian data on little endian machines.
All values read from FIT files are now swapped (if neccessary) according
to file and system endianess.
fixes#287
do not bail out on unknown message types. This violates the design of the
Fit format of being extensible.
As this was the last thing using the global_msg_names QMap, I've nuked
this, aswell.
Summary window and friends now set the window title (subtitle)
to the ride date and the headings have been made slightly
smaller to reduce screen real estate. Minor cosmetic update.
Update to the Google Map window:
* Uses Google Maps API v3 (v3 is deprecated)
* Users can now select intervals on map
* Icons for start, stop, loop, pause
* Resize refresh no longer needed
Features removed or changed:
* 30s segments are now 60s segments
* Tooltip doesn't work with v3 API
Some more updates will come through later to
add greater control on what is shown on the map
and the shading to use (e.g. gradient, HR zone) and
the time interval to use.
Highlight entire route to make the route stand out
more obviously when power zone colour schemes are
subtle (or white).
Changes the window bar to the metadata field 'Route' if
it is present. This is done by introducing a new 'subtitle'
property on a GcWindow that can be set programmatically. This
is equivalent to the old 'title' above each chart.
A bit more love for tabs and other minor cosmetic tweaks.
* View now remembers style used (tab, scroll, tile)
* Allow user to re-order tabs
* Google Map border reduced
* Google Map refresh delay (to make UI snappy when resizing)
* Minor calendar cosmetics
* Use utf8 encoding on config files (language support)
Removed the horrible dock widget and uses same sidebar
as windows and linux. Removed segmented button for now
since there are a few issues, but retained the code for
the future.
More work to unify the tab view with the overall
UI look-and-feel, allowing you to remove and add
tabs via mouse over rather than the close tab
icon. Also added a number of cosmetic adjustments.
Fixed up PerformanceManager and ScatterPlot to
pick up on the chart fonts and tick size etc.
Removed some erroneous static members in the
ScatterPlot that caused a SEGV when adding multiple
charts (or cancelling an add then adding again).
New charts are created in the GUI thread and
the Dialog is not deleted until after the chart
has been reparented.
This modification will need testing on Windows.
The legend wasted screen estate and was removed, this patch
colors the axis labels/ticks so no legend is required. This
approach could be adopted for other charts.
Also includes a fix to hide realtime view controls which
left a screen glitch because they should have been hidden.
I have not been able to reproduce the crash, but reading
through the code related to the chart add dialog I have spotted
an error where the chart could be destroyed when you click the
OK button, but still referenced.
This modification also appears to fix an issue with chart
controls not working when you first add a new chart.
Requires testing before the associated defect in GoldenTracker
can be closed.
QGraphicsDropShadowEffect needs Qt 4.7.3 to
be guaranteed to work correctly. This is inline
with the statement that Qt 4.6 is mandatory
whilst later releases are desirable.
After discussion on the list the utility and popularity of
the original tab view was restated. This patch reinstates
the tab view and attempts to unify the Qt tab widget with
the general look and feel of the application.
Added a dropshadow effect for window tiles and made the
title embossed for a more professional look.
Also fixed a couple more compile time nits introduced
by recent commits.
When scrolling through the ride list the ride plot will
steal focus which means navigating up and down the ride
list by keyboard is not possible.
This was caused by an errant setFocus() in LTMCanvasPicker
which this patch removes.
The heading on the homewindow pages is superfluous since the
user is well aware what page they are on by the fact they
selected it and also the contents displayed.
This also has the effect of making tiled view the standard
and only view. Will need to add options to maximise a chart
to fullscreen later.
Less jarring UI with simple use of color and
no pixmaps to make a clean look. Will need
more work to get consistent across the code
base.
A simple and clean UI is starting to emerge.
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.
The WKO ride file reader used wrong constants for the bit
field size of the sample data when decoding files from
Ergomo devices.
merged from v2 master.
The google map control creates a temporary file to load
which is not unique for each logged in user. This causes
permissions issues.
The use of a temporary file has been removed by replacing
the webView->load() call with a webView->setHtml() call. This
allows us to pass the contents as a string rather than a URL.
Fixes#331.
When you import the very first ride into V3 it will cause
a SEGV crash when attempting to freeMemory. This is because
the first entry added to a list does not cause any selection
to be made.
This means that the very first time someone tries to use GC
version 3 it will crash! Not the best of starts.
This bug was previously reported as being related to importing
json ride files, it occurs for ANY ride file type.
Fixes#328.
With realtime data there will often be samples with
timestamps like 940.002 and 940.998. This cuases an
issue on the ride plot, where it believes there is
no sample for 941 and therefore plots a zero value.
This patch rounds the timestamps to the nearest 100th
of a second, which is consistent with the mechanism
used in the ride editor.
Not generally useful but allows one to make the toolbar
menu and titlebar match for a more pleasing general effect.
Most users will not use this I imagine and use the default
window colors.
The MainWindow.{cpp,h} code was a bit messed up after a
few years of hacks from different devs. This non-functional
patch re-organises the source files, removes a couple of
unused methods and adds a few comments to help new devs
navigate through the code.
The HR zones code was broken by the previous commit to
remove asserts from the code, resulting in the numZones
method to always return 0. This caused the Histogram and
Summary windows to fail to display zones for a specific
ride.
This patch fixes this.
You can now configure the Analysis view to drag and drop
charts on the page and lay them out etc. A default setup
displays basic data such as ride summary, histograms and
ride plot.
MainWindow still needs a bit of a tidy-up as the basic
code has been edited and re-edited by a cast of thousands
and its a bit of a mess as a result.
If you have not compiled in support for a particular
chart (e.g. 3d) then the drag/drop event will just
create a blank chart (base GcWindow).
The constructor for a null chart did not initialise
properties and caused an intermittend crash because
the controls pointer was occassionally not NULL.
The DBAccess functions instantiate a local SpecialFields object in
almost every method. Profiling by Fredrik Lingvall has shown this
is rather expensive (and also unneccessary since they do not
change at runtime).
A specialFields member has been added to the MainWindow class
and is instantiated at startup and referenced in the DBAccess
methods instead.
Rough tests suggest a 10% speed improvement in metric refreshes.
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.
The SQLITE database syncs (writes) to the metricDB file after
every atomic transaction. As the size of the database grows this
becomes very expensive (suspect it is writing the entire DB).
To avoid this behaviour the Metric refresh code opens and commits
a LUW for the entire refresh. This has shown to improve the performance
of the metric refresh quite dramatically (50% reduction in overall
time to complete a metric refresh).
Big props to Fredrik Lingvall for detailed analysis and profiling
of the code to identify the inefficiencies.
The training view (aka realtime) is now configurable
allowing users to drag and drop appropriate charts
and dials onto the main view.
The controls for this view are static and comprise the
old controls with start/stop buttons, device selections etc.
I have removed deprecated code too, the following are removed
from the repository;
* ViewSelection
* RealtimeWindow
* TrainWindow
* TrainTabs
Fixes#290.
As part of the ongoing preparation for training mode to support
a more configurable layout the workout (ergfile) plot is now
a window that can be dragged and dropped onto a layout.
The realtime plot is now a chart than can be dragged and dropped
onto a window layout. This is part of the preparation to move
the training view to use be configurable, aka home window.
The home window layout will soon be extended to cover
realtime and analysis views. In preparation for that
some additional charts are being created.
This patch introduces the metadatawindow which only
contains the metadata fields (i.e. no ride summary).
RideMetadata widget in mainindow is never placed into a layout
since it is not used for user entry/display.
MetricAggregator used QWidget as a base class, this should of
course have been QObject. It uses signal/slots but has no GUI.
Been chasing this down for ages. An orphaned widget in
MainWindow caused the tick for opening the drawer on Macs
to be 'unresponsive' and on Linux made the Cyclist and Ride
menubar options similarly 'unresponsive'.
When adjusting layouts for homeWindow and others a new
widget 'central' was introduced and then not used, but the
code was left behind.
This patch removes the errant code.
I guess it is a philosophical argument. HrZones is modelled on
the original power zones code. It uses assert to crash whenever
a call is made for out of bound data (e.g. range of -1).
Given these values are returned by other functions in the same
class, it seems harsh to crash when handed them back.
I have removed some of these from the critical members and am
tempted to apply to the original Power Zones code too.
Fixes#301
As pointed out by Mark Rages, GCC/G++ support auto vectorization
optimisations with this flag (amongst others). This has quite a
significant performance impact for almost all parts of GC that
loop over ride files.
It certainly improves the mean-max routine performance dramatically.
Anecdotely it seems to improve performance on most charts when
intervals are selected and make the Metric charts particularly
snappy.
More info on auto vectorization can be found at the following
url: http://gcc.gnu.org/projects/tree-ssa/vectorization.html
Tested on intel and amd hosts running Linux and Windows.
Updates the source files to add a detailed description on the new faster mean-max algorithm and a tweak to the window size to significantly improve performance.
Mark Rages has developed a super fast and innovative
approach to identifying max-mean intervals. This
approach is 20% faster than the current approach and
importantly does not require "downsampling" of data
yielding much higher resolution for longer intervals.
The code has not been 'adjusted' to adopt QT style
containers (e.g. QVector) and uses malloc/free.
The primary innovations include:
* integrating the data series to reduce the operation
for identifying an interval sum to a single subtract
operation.
* Searching for max sum via a window-search rather
than iterating over the entire series (divide / conquer)
Interestingly, now we have retained high resolution the
xPower algorithm still yields differing results to the
existing metric code. I have contacted Sean to get some
insight into why this might be the case, but suspect it
is related to the implementation of the xPower 25s EWMA.
Tip o' the hat to Mark Rages for this -- sometimes you
just have to accept that no matter how smart you think
you are, there are some folk who /really are/ smart!
The .cpx file used unsigned long to reduce storage
requirements but lost precision. This patch migrates
to using floats, which in most cases are the same size.
One side effect of this update is that mean-max charts
for HR, Speed, Cadence no longer have a 'staircase' effect
and plot more smoothly.
The recent update to plot histograms for seasons or other
date ranges did not support displaying by zone since the
cache did not contain zoned data. This patch fixes that
with an update to RideFileCache to pre-compute and to the
PowerHist class to retrieve and plot.
There are some minor issues that need to be addressed:
* Handling aggregation with different zone schemes
* Deciding which zone scheme to use for the bar labels
when multiple differing schemes have been used within
the date range selected.
* Showing a break down of time in zone by range i.e.
how much time was spent at Threshold when CP was X
as opposed to when it was Y (hint: do it like we
currently display intervals when plotting a single
ride).
* Refreshing the Time In Zone data in the .cpx file
when CP/LTHR changes is not implemented.
The RideFileCache now checks the version of the cache to
determine if it needs to be refreshed -- so no need to
delete old .cpx files before running GC with this patch.
The recent RideFileCache patches added functions to
pre-compute mean-max and distributions. This enabled
this patch to add plotting histograms for a date
range rather than a specific ride.
It supports all the same data series as before but will
allow you to select a season from a new combo box.
I have refactored a fair amount of the code, but kept the
original code in PowerHist as close to unchanged as I could
since I did not want to disturb existing functionality.
There is no support for Zoning historic data -- this requires
an update to the RideFileCache.
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.
Couple of little tweaks to the Native ANT support. Firstly,
data channels such as watts, hr and cadence are now rounded
to an integer (lots of grid lines in ride plot looked nasty).
Secondly, basic support for calibration messages; this has been
limited to SRM messages, but will add support for other devices
as we start to debug them.
Part 3 of this work is still pending, this patch only contains
adjustments to part 2. I suspect there will be further adjustments
as we squash bugs for Quarq and PT users.
Second stage of development, refactored the quarqd sources and introduced
an ANTChannel and ANTMessage class.
This is a functional patch and should work with known ANT+ devices, but
has only been tested with a Garmin HR strap, GSC-10 dual speed/cadence
and SRM wireless cranks. It has only been tested with a first generation
Garmin ANT+ USB stick.
It *should* work with other devices (e.g. Powertap, Quarq) but this has
not been tested.
The configuration pane has not been fixed yet, so you can either add a
Native ANT+ device and leave the profile blank (it will autodiscover
whatever it can when you run) or you can copy the profile from a Quarqd
device and use that.
There are lots of bugs;
* Calibration is not supported, uses a static srm_offset
* Wheel circumference is fixed at 2100mm for speed calculations
* Timeouts are hit and miss and need to be completed
* Sensor loss / timeouts are not managed yet
* Burst data and Acks are not handled
* Device descriptions, versions and battery messages are not handled
Aside from the bugs above part 3 wil also need to include;
* Configuration screen fixups and device pairing
* Add a calibration button to the realtime window
Lastly, the refactoring of the quarqd code is incomplete, there is still
a need to use ANTMessage across the code, especially within the ANTChannel
code which still does a bit of decoding locally.
When an interval (or intervals) are selected in the
interval tree, the new window below the tree now shows
summary information for the selected interval(s). This
is beneficial for example when the Ride Plot tab is shown
and the user also wishes to see summary info about the
intervals. This fixes#77.
I think there is still room for improvement on the fields
displayed and the formatting of the summary window. For now
the fields are the same as those displayed in the Ride Summary
page.
1. Allow FIT reader to recognise the file comes from a Garmin Edge 800
This is Garmin product ID 1169 in the decodeFileId routine.
2. Ignore global_msg_type = 72
This message appeared with the introduction of the Garmin Edge 800.
There is no FIT SDK that tells us what this message is.
It appears only once and has timestamp/device serial number.
Code now recognises the msg_type as valid but we don't process it.
3. Add all decodeEvent types and work only with "timer" events
Not all event_types were present. They are now all in the function.
Previously the decodeEvent would look at all "events"
We now only decode event_types if the event is of type "timer".
Fixes: #250
SRM5 basically is the same as SRM6, but lacks "blocks". This means, it
only has the date of the exercise and no further absolute time info.
Furthermore it can't flag periods of time, where no data was collected.
Due to lack of absolute time, Exercises start at 0:00, by default.
Fixes#208
The load timer was simply being accumulated with each firing
of the timer. This resulted in inaccuracies. The fix is to
accumulate using a timer that measures the duration between loadUpdate
calls.
The speed, average speed, gradient, and distance LCDs ought to always
display 1 significant digit to avoid bouncing. This is now fixed.
This commit fixes#262 and fixes#263.
The recent fix for date range selection was not applied to the
TreeMap plot and caused a SEGV on restart (when placed on home
window). This fixes that.
It also fixes a minor cosmetic related to QFrame margins.
A previous commit stopped disk updating from working, i.e. saving
workout data to a .csv file. This patch fixes that.
Fix supplied by Greg Lonnon, Fixes#254.
The newer Racermate FTDI based USB adaptor (USB-StereoJack) failed
to receive data from the Computrainer, this was due to incorrect
flow control settings.
Fix supplied by Eric Brandt.
The newer Racermate FTDI based USB adaptor (USB-StereoJack) failed
to receive data from the Computrainer, this was due to incorrect
flow control settings.
Fix supplied by Eric Brandt.
First stage of development, folding together the
quarqd sources and creating an ANT+ worker and controller
to work with realtime window.
The basic code is folded together and compiles fine. The next
step is to address the channel management code, device discovery
channel assignment and channel event handling. This will be pushed
as part of the next commit.
The third commit will need to fixup the configuration pages to
support selection of device/baudrate, fix native discovery/pairing
in config and lastly, fix a long standing issue with the config pane
to allow editing of existing device configurations.
This is NOT a functional patch yet, but compiles and runs fine. Committed
as a checkpoint before refactoring quarqd supplied code.
This fixes issues with date range editing in the Metrics controls
and provides support for Season load planning (under development).
Creating and selecting seasons is largely managed within the
Metrics tool. This has not been changed with this patch. Athlete
seasons are now managed as a member of the MainWindow class (although
this will move to an Athlete/Cyclist class when MainWindow is
refactored).
A Season identifier (UUID) has been introduced to enable Seasons to
be referenced independently of their name or date ranges. The LTM
tool now keeps track of changes to Seasons (when new seasons are
created, changed, deleted). Additionally, the Season XML file now
supports storage of a Season Load Plan.
toMSecsSinceEpoch() is from Qt 4.7. Replaced with an implementation
based on QTime:start() and QTime.elapsed() from Qt 4.6.
There is now a theoretical upper limit on turbo sessions of 24 hrs :-)
Fixes#247.
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
Instead of adding 200ms to the elapsed time on every gui update,
this patch records the timestamp of when the Start/Pause buttons
are clicked and subtracts these from the current hardware clock time
to calculate elapsed total & lap times. Fixes bug #235.
Russian Translation from Gwelu
Czech Translation from Beeda
Updated Japanese Translation courtesy of Key
Updated German Translation courtesy of Luke
Golden Cheetah now supports 7 languages!
Fixes previous CalDAV support, as MobileMe based calendars
now work ok. Additionally, a new 'id' field has been created
to provide a persistent and immutable identifier for a ride
file (regardless of changes to date/filename).
The URL provided in the Calendar config pane can now include
'@' symbols (they are translated to %40).
The CalDAV URL should be provided for a calendar collection and
not for a principal. Examples being (trailing slash is significant):
Google : https://www.google.com/calendar/dav/xxxx@gmail.com/events/
MobileMe: https://cal.me.com:8443/calendars/users/x.xxxxxxxxxx/home/
A new menu option and associated config to integrate the
diary window (and ridefile history) with a calendar server
that supports CalDAV (iCal, Google, MobileMe).
This patch introduces an upload to calendar function and is the
first step towards adding calendar based planning functions.
It is important to note that no local calendar is maintained, we
are simply integrating with an existing calendar service.
It has been tested with Google Calendar, further testing and
enhancements are ongoing for users of Apple's MobileMe.
A couple of nits in the code were picked up by
gcc-4.5; const in a function returning non-const
and an unneccessary initialisation of a QList calling
the constructor directly.
Fixes#236.
A new menu option to export the ride metric data
as a CSV format file for manipulation in tools like
Excel.
It exports all rides (no date range) and outputs the
date in US format month/day/year, with time in 24hr format.
Additionally, a 'hack' to export all rides in GC format has
been removed since it was erroneously included in the initial
v3 branch.
If you click on a title bar to stick the controls
for a window it was getting moved to the end of the
charts (the default action for move chart).
This patch fixes this.
- German translation update
- Virtual power in realtime
Conflicts:
src/DeviceConfiguration.cpp - needed to adjust
to use appsettings for read/write of application
settings.
Virtual Power - included patch from Mark Liversedge & corrected bug
with his help.
GSC-10: Check dual sensor 4th and speed-only sensor (which is rare) as
5th.
This means that an all-Garmin setup (ANT+ stick, GSC-10 sensor) will
always work. A speed-only sensor is almost useless in GC real-time
mode anyway, because speed-only sensors tend to run off the front
wheel which will be stationary on a trainer. Fix pointer problems with
device controller/config.
Fixes#219
The previous commit enabling tile 'bumping' as
you move them around proved impractical with
charts that largely filled the screen.
This patch replaces this approach (original code
is retained though) by using a 'cursor' to show
where charts will be dropped / moved to and moving
or dropping to this position.
This means the layout code is complete, except for
potentially adding support for multiple layouts (e.g.
have saved layouts for different purposes like
LTM charts for last 6 months or 28 days or an
agenda view that shows past week next week calendar).
kJoules : take the avg power and multiple it by the number of seconds.
bikescore, xpower : added a rideFile object to calculate the bikescore, xpower on a 5 second
period. It has it's own timer.
fixed display of speed and avgSpeed:
old aglorithm would not display the tenths place if it was zero. New aglorithm
always displays the tenths place.
Signed-off-by: Greg Lonnon <greg.lonnon@gmail.com>
More work to support moving tiles on HomeWindow. This update
adds tile movement and 'pushing' other tiles out the way as
you move them around.
Tile ordering/positioning is still todo, but this introduces
the visual feedback during a move for the user.
Simple, but oh my, what a difference. This two line
patch removes the nasty line artefacts on a bar chart.
Those are the lines that get 'left behind' when a bar
is drawn next to another one.
If ICAL_INSTALL is not defined in gcconfig.pri
then diary/calendar functions are not compiled. This makes
libical an optional dependency, like libkml, libqwtplot3d et al.
blue marker = start of ride
red marker = end of ride
green markers = interval markers.
interval markers has the interval metrics displayed.
end marker has the ride summary displayed.
Fixes#169.
Provides 100% coverage of language texts*
* a couple of texts for WeeklySummary window containing html
codes (gt,lt et al) had not retained their encoding using
>, <, whilst I edited a few of them in the file, these
two were particularly complex and challenging. We can fix
them later. [Mark Liversedge]