.. added an environment variable TESTVAR to see if
it can be made available during the build. Will
remove this once it is working in order to add
the API keys for twitter, dropbox etc
.. doesn't honour font sizes (long story but too complicated
to unpick all the fugly code in QtMacButton.mm)
.. but at least the chartbar is tall enough for the "standard"
size on OS X
.. and resizes as the font gets bigger so you can
at least adjust when running on a high resolution
display.
.. still need to do ScopeBar and SidebarItem too
.. videosync table version stored in TrainDB (was missing before)
.. upgrade to 3.3 fixes default entries for Workouts (e.g. due to wrong translation with missing " " in text - German)
... new Feature to Autoimport without Dialog (with same timeframe option like the Dialog version)
... in case "Dates/Time" is missing - the Dialog Window appears and waits for input -
if entered and "Save" presses no further input action is required
... malformed activity files are silently ignored
... to avoid inconsistencies closing of the Athlete for which Background Import is running
is blocked until the Import is finalized (Info on import complete is sent to UI)
.. UI is not blocked by Autoimport - but a bit less reactive as long as the import is executed
.. check for NULL.
.. this is odd, some behaviour upstream has changed
and needs to be investigated as this bug is too
significant to have only just been found.
... fix problems when dates are converted back/forth with fromString/toString to avoid Locale related mismatches
... use ISO 8601 format (YYYY-MM-DD) in such cases (Qt::ISODate)
... applied to "RideImport" and "ComparePane"
... does not recognize that Interval was added and may loose the intervals on saving
... causing inconsistency in Cache - blocking the deletion of the interval after re-starting
... add Multimedia Keys to control the train mode
... Start/Stop/Forward/Rewind/Pause working on MCE (Windows Media Center compatible remote controls) without any problems
... tested with 2 MCE remotes
... For "new Lap" none of the special media keys worked - so choose "0" since this is available even on pure remotes
Since in earlier versions of QT not all Keys are defined, just start with 5.4 as pre-requisite.
... store Videosync files in Workout Folder as well / adjust configuration description
... report non-existing Workouts/Videosyncs when scrolling through the treelist (and offer to remove them from the library)
... properly handle "imports" of files from the Workout Directory in case of "overwrite"
... add tr() in multiple places
... unify some of the texts - terminology
... add Directory to Configuration Page
... set Default similar to Workout Directory in Main
General
... start Directory Browsing on Config Page with the configured directory (if is existing/valid)
... collects all relevant Files from the Athletes directory subfolders (keeps the folder structure)
and add them to a .zip file which can be stored in a different folder
... runs automatically when closing an Athlete (window or tab)
... configurable per Athlete
-- Folder into which the .zip shall be stored
-- #of times GC shall close without backup before the backup is activated
(0 == no Auto Backup, every other number "x" means that GC closes
x-1 times without running the backup and after running, resets
the counter)
.. caused v3.2 to crash on interval discovery and
contains out of bound values for power, speed and
cadence.
.. good for testing code doesn't make assumptions about
data values.
.. thanks to Neil Jones for the test file and permission
to distribute for testing
... UTF-8 ByteOrderMarks was missing in the exported XML,... files causing problems on Windows e.g. in cyrillic
... BOM header added for PWX, Fitlog, GC and TCX format
... Fixes https://github.com/GoldenCheetah/GoldenCheetah/issues/1547
.. RideCache::addRide() deletes the prior ride, which is rather meaningless
if you are just importing a ride, but when syncing large numbers
of rides will stop memory being exhausted.
.. similarly in the FileStoreSyncDialog we now free up the memory
used to read the downloaded files before moving on to the next.
.. so we can read/write zip files that can be opened
outside of GC. For example, when working with a file
store we want to write .json.zip that could be read
using winzip et al
.. layout on athlete About row missed leaving a
gap between widgets vertically.
.. moved use CP for FTP checkbox to zone config page
and not on athlete About page.
... use an shared network drive (e.g. mounted via WebDAV) to synchronize activity data
(similar to Dropbox,...)
Open/TBD:
... where to best put the Preferences for the different FileStores
(currently add the Network folder configuration on Preferences->Passwords,
even though no PW is needed - with growing number of FileStores a
dedicated Preferences Page may be the solution)
... where to put the MainWindow Menu entries if the number of FileStores increases
.. Mac Finder creates .DS_Store in subdirectories when you
browse in them to store customisation etc. So we need to
wipe them away when deleting the athlete folders.
.. sync with a dropbox folder
This is based upon the TPDownloadDialog but refactored for
use with a FileStore (in this case Dropbox). It should be
extensible to use with any kind of FileStore object.
... first Athlete opened with new logic determines the general settings
... if configuration is already migrated (based on one of the previous commits) -
migration can be forced to happen again by removing the INI files or
just the preferences pages has to be opened and Saved with the
unit settings you want
.. basic functions working to upload a single ride
to a dropbox file store.
.. this is a safety commit before looking to resolve
issues with async updates.
NOTE: the upload completes but the dialog needs to
be cancelled manually -- this is a bug and
will be resolved in the next update.
.. so you can now choose the directory to sync
data with. Its a very basic file dialog but
will allow you to create and choose a folder.
.. Config is now completed with token a folders
now configurable by the user.
.. I cannot believe we needed to write a pesky file
chooser dialog in 2015 (!)
.. first parts of the implementation of a base class
for working with file stores and the Dropbox
API.
.. all we actually get in this commit is the abstract
classes and an implementation of readdir for Dropbox
along with a config setting which needs to browse
directories
.. in the next commit we'll add the directory chooser
dialog which will need to implement a ftw() across the
associated filestore and present a gui to choose a
directory to store athlete data in
... select only files for import which are created or changed of the last 90/180/360 days
... thus limiting the number of files which are considered for import in the source directory
(without changing/deleting the source files - and without the need to track indexes,...
of what has already been imported).
Based on TCX/GPX support
Includes laps and no-gps support for indoor activities, but not lap swimming.
Test files were contributed by forum members Frederic and Servan
Fixes#1559
... change storage format to .INI files (which is QTs cross-system format)
... differentiate between System, Global and Athlete specific settings
... store the Global Settings in the AthleteDirectory (root)
... store the Athlete specific Settings in the Athletes Names subdir /config
... migrate existing Settings from current location into new formats "on-the-fly"
.. by default no metadata is provided when you
get a ride list. So we now let you specify
via a parameter what metadata fields you
want.
e.g.
http://localhost:12021/athlete?metadata=allhttp://localhost:12021/athlete?metadata=Workout_Code,Recording_Interval
Metric overrides are ignored and all data is
fixed to never send a double quote ("), it is
converted to a single quote (') to avoid tripping
up CSV parsers.
To show it is a string field both the heading and
content are always surrounded by double quotes.
.. now we are able to manage settings with the response
to control how the response is built we don't need to
store it in the JSONContext structure - so just cleaning
it up.
.. to list rides without metrics and therefore just
traverse the activity directory and parse date from
the filename.
.. for a quick way to get a list of activities without
anything to plot etc.
.. adds overlay widgets to show telemetry on top
of video as you ride with a customisable view.
.. not tested but pulled into the repo to enable
testing to start with a view to inclusion in
the 3.3 release.
.. just the key parameters, not the zones themselves.
although we could add that possibly.
URL to get zone config:
http://localhost:12021/athlete/zones
By default will return power zones but can be
called with a 'for' parameter, which is one of;
power, hr, pace, swimpace.
The result is returned as csv data.
.. if the caller sets a content type we can provide in the
header of the http request then we honour it; e.g.
Accept: "text/csv" we will convert to CSV.
.. also updated to set the content type to match the file
format we are providing; just in case the client needs to
know what it got !
.. when retreiving an activity using the API
you can now specify the format you want the
data to be returned in.
it can be one of;
tcx - garmin training centre xml
pwx - training peaks xml
json - goldencheetah json
csv - all available data (not powertap csv)
.. along the way the file writers for the respective
formats now accept a NULL context to work standalone.
this may be useful as a file conversion tool.
.. just straight up for now, so;
http://localhost:12021/athlete/activity/2015_08_09_10_59_09.json
will just return the ride unchanged in the format
it is stored in. Some parameters will now be added
to enable the format to be selected, from those that
we can support.
.. To restrict to more recent rides the
API for list rides will now take a
parameter 'since'
localhost:12021/athlete/?since=2015/02/01
Will only list rides since 1st February 2015
and can of course be used alongside 'metrics'
to control what metrics are returned.
localhost:12021/athlete/?since=2015/02/01&metrics=NP
.. when getting the ride list its useful to be
able to get specific metrics (rather than all
260 odd).
URL can have parameter metrics that is a comma
separated list of metrics to provide e.g;
localhost:12021/athlete/?metrics=NP,Average_Power
.. will provide the metric db for an athlete as the
activity list including all metrics in CSV format
at the URL:
http://localhost:12021/Athlete Name/
The data is sent in chunks as it is parsed from the
ride cache. We do not cache or maintain state so this
call is expensive !
.. just 4 endpoints available;
- list athletes
- list rides
- get ride sample data
- get ride mmp data
.. next few commits will need to implement each of the 4
API endpoints, returning CSV data in the response.
.. GoldenCheetah --server [dir]
Will run without a GUI as a console application sending
log messages to stdout. A web server is never started
when in normal GUI mode.
The optional 'dir' parameter can be used to specify the
location of the athlete data -- you could run several
servers on different directories since the config for the
server is located in the root of the directory.
.. added the http listener, with a default handler
that just returns a 501 Not Implemented result.
.. now the basic server is available we can start to
add a request handler and build up an API that can
be called externally when GC is running.
.. the default config file is written to the gc home
directory above the athlete directories and sets the
server port to 12021.
.. 12021 was chosen as a memorable port number that does
not seem to be used by any other application that is
popular or well known.
.. see http://stefanfrings.de/qtwebapp/index-en.html
.. this is a lightweight web server to allow GC to
provide webservices.
.. we will be providing web services on localhost to
enable R integration.
.. we will use web services to standardise the
interface to provide something we can use in R
but also anything else at a later date.
.. gcconfig.pri contains $$HTPATH that points to
the location of the code, if it is not set then
the web server is not compiled in.
.. allow users to use a set command to add
an override or set metadata under certain
conditions.
e.g. set(Workout_Code, "HT", IF>0.9)
set(TSS, 65, TSS <= 0 && Route = "Fave Loop")
.. we should probably add an unset() command
to do the reverse and clear values under
conditions too.
USE WITH CAUTION -- TAKE A BACKUP BEFORE
MAKING ANY RADICAL CHANGES TO YOUR DATA
.. compare mode now works with user data
series on AllPlot.
.. probably a few minor nits to clean up
and maybe some refinements will come.
One thing is for sure, AllPlot and AllPlotWindow
have reached the limit of maintainability and we
should think carefully about how they move forward.
.. user curves now appear on the series and all plot
with axis hiding etc
Next commit will add to compare mode and then we
can start cleaning up the nits and refining how it
chooses axes and have a checkbox to hide and show
.. Edit dialogs and integration into AllPlotWindow
NOTE: AllPlot does not use the config, or even save
it to the property at this point. We just have
mostly reusable code for user maintenance of
formulas for ride series data.
.. passed to eval and symbols now recongised.
.. sample data is referenced using symbol names
in all caps to make it clear you are referencing
ride dample data.
.. the next commits will add defining formulas and plotting
the derived data series in allplot.
Tie HR warnings to Max-HR, if available, instead of hard-coded 200bpm
Speed warning changes to 9kph for swims, 36 for runs and 100 for rides
Cadence warning changes to 80 for swims, 120 for runs and 200 for rides
"Non-zero torque but zero cadence" is disabled for runs and swims
Fixes#1483
.. To select in a vector. The notation
is a selection criteria followed by
a list of values / vectors
e.g. which(x>0, TSS[date:date])
will create a vector where TSS is non
zero for the day.
"x" is replaced with the vector values
and as such is a special symbol.
.. also fixed a bug with the snip cache.
.. when running a formula it may use a vector
operation to calculate e.g. an average for the
date range.
.. these get called for every ride, but actually they
perform the same calculation over and over
.. we cache the vector operation and result to avoid
repeated calculations; these are only cached whilst
a datafilter is being evaluated, so we do not need
to worry about stale/refreshing.
.. estimate(model, duration) or to get the model
parameters estimate(model, parameter) always
for the date of the ride.
e.g. estimate(2p, cp) gets the estimated CP
for the date of the ride using the classic
2 parameter model
Models are one of;
2p - classic monod scherrer
3p - morton 3p
ext - gc extended
ws - ward-smith
velo - veloclinic
Parameters are one of;
w' - W'
cp - critical power
ftp - functional threshold power
pmax - max power
For watts per kilo just add / config(weight)
or Athlete_Weight to take into account ride
specific weight settings / overrides.
.. can now use a formula in the lts, sts
sb, rr functions.
.. e.g lts(TSS/2) evaluates to the "CTL"
value for the ride if using TSS/2 as
the input.
NOTE: you only get a value where a ride
exists. We may want to think about the
way we scope formulas; are they iterating
over rides or dates ?
.. slight fixup to use Leaf expression not the
entire data filter in PMCData and now the
series is stored in the Athlete PMC store
alongside the other series.
.. just need to adjust the parser to accept
expr rather than symbols as inputs to the
lts functions.
.. to use when e.g. using a data filter as an input
into the PMC functions. The data series is stored
against a signature for the function as opposed to
the metric symbol.
.. we need to do it for an expr not the data filter
.. add the computation of PMC stress using a
data filter as an input as opposed to a
metric.
.. part 2 will update the parser to support
sts/lts/rr/sb to use an expression.
.. part 3 will update Athlete to enable
storing PMCdata against the datafilter signature
instead of a metric name.
.. to use when e.g. using a data filter as an input
into the PMC functions. The data series is stored
against a signature for the function as opposed to
the metric symbol.
.. but do continue to highlight bad symbols etc
with a red wavy line.
.. still need to;
a) syntax highlight in the formula edit (just symbols
and literals, not parsing content)
b) add an error navigator to click on errors and have the
text highlighted that incurred that error.
Adding a comparison expression cexpr and separate productions
for each operator allows to define precedence rules to remove
all shift-reduce conflicts, except one due to the -probably
harmless- (expr) and (lexpr) ambiguity.
.. the daterange() commit broke almost every builtin
function ! (it converted them to integers due to
and if/else logic error.
.. also tidied parser to separate literals and symbols
whilst making builtin functions expr elements to
look more closely at precedence
.. oopsie on binary expression.
NOTE: it may be better to highlight tokens rather than
via the parser as errors make it impossible to
highlight the "intention" of the user
Particularly useful when working with a vector
but can be used with other things.
e.g. max(xPower, BikeScore)
Or, for getting a ride's TSS expressed as a percentage
of the average TSS for the currently selected daterange.
e.g. TSS / mean(TSS[daterange(start):daterange(stop)])
You can create a vector using the notation:
expr [ from : to ]
Where 'expr' will be evaluated for every activity
between the dates from and to.
e.g. TSS[today - 90 : today]
will evaluate to TSS for the last 90 days
e.g. Activities [ date:date ] > 1
Will find all days with more than one workout.
.. when using a vector in any arithmetic expression it
will be evaluated to a sum; this will be fixed shortly
to enable the use of sum/mean/max/min functions.
.. If needed we can add vector operations but this will
likely confuse many users (hell, they confuse developers)
so we will need a good reason to add them !
Lastly, I have also added daterange(from) and daterange(to)
literals to get access to the currently selected daterange
when working in the trends view.
.. update the editor to do some basic syntax
highlighting; literals in red, comments in
blue and so on.
.. next commit will focus on highlighting errors
with a wavy line and some form of error list.
.. updated the datafilter to handle general functions
and parse them without needing them declared in the lexer
.. makes it much easier to add new functions in the future
.. did this to add core math functions;
* sin, cos, tan, asin, acos, atan,
* sinh, cosh, tanh, asinh, acosh, atanh
* exp, log, log10, ceil, floor, round
* fabs, isinf, isnan
.. we can add more later; erf/gamma spring to mind !
.. uses the C/C++ notation:
expr ? expr2 : expr3
Where expr is the condition e.g. X>2
and expr2 is what to evaluate to if expr is true
and expr3 is what to evaluate to if expr is false
e.g.
(Workout_Code = "1L3") ? 1 : 0
Will evaluate as 1 for all workouts where the
workout code is 1L3 and 0 for all other workouts.
.. now will repeat completion beyond the very
first word on the line
.. needs to be enhanced to work when not at the
end of the text (i.e. cursor move)
.. resize event was checking menu icon, which was never
going to change due to a resize event.
.. it crashed during window exit since it dereferenced objects
that had been deleted.
.. for now, it crashes occasionally due to cross-thread
issues, and doesn't work across the text anyway.
will make it permanently associated by not active
when in search mode.
.. get rid of terrible cut and paste code, duplicating
eval for particular leafs
.. eval returns a Result() object which can be numeric
or textual (date strings are parsed to numeric)
.. can now add formulas to LTM as well as adding more
functions that may be useful (conditionals, maths
spring to mind first).
... removing tests,... from LIBKML build
... allowing building of base functionality of LIBKML on Windows with MinGW
... covering the LIBKML functional scope used by GoldenCheetah
.. NP > 200 && IF > 0.85 didn't work because the datafilter
grammar needed fixing up for precedence of the && and || operators.
.. this has been fixed by embedding into the grammar; binary expressions
and logical expressions are now declared individually.
.. the generated tree uses the same encoding so no changes required
to the code, just the grammar
In case user borked them in setup, applies to:
- Ride Date (startTime.date)
- Ride Time (startTime.time)
- Device (deviceType)
- Recording Interval (recIntSecs)
- Identifier (Id)
Since latest update for metadata now honours user configuration.
.. change LTM trend background to same as ride plot on upgrade
as by default it will be black and look different
.. remove metal look on anything other than Mac prior to the
10.10 Yosemite look. Metal looks naff these days.
.. we have been granted permission to use the TCore algorithm
and so the attributions have been added to the code and about
box.
.. Mark Buller should be added to the contributors too.
Added RPE to metadata.xml to allow data entry in the Workout tab and
PMC (Session RPE) to charts.xml
Added Equipment to Workout tab
Added GOVSS and SwimScore to Metric tab, to allow metric override
.. move use sidebar settings to basic page and
disable the other pages if its using sidebar
settings
.. when working in the sidebar, hide the basic
page since it is not shared
.. make the add chart dialog bigger if the screen
is large enough, since it needs to show a chart
and the config pane which has grown a little
over time.
.. remove all the editing/import/export functions
from the chart settings now they have their own
sidebar.
.. this also removes some of the problems with conflicts
and bugs in the code e.g. setting the first chart name
to "" by accident in the editingFinished() method (since
that is no longer supported !)
.. if you drag a chart in the LTM chart sidebar to beyond the
end of the list the move results in a QList assert abort.
.. this small fix checks for -1 and adjusts accordingly.
.. import/export charts
.. drag/drop them in the list to reorder
.. drop a 'charts.xml' (any .xml) file onto the mainwindow
to import charts exported by someone else.
.. when resetting the layouts we first go try the default
layouts from the goldencheetah website
http://www.goldencheetah.org/defaults/<release>/xxx-layout.xml
.. this means we can update the default setup independently of
the release binary; make tweaks etc
.. the same concept will shortly be introduced for resetting the
standard charts.xml presets for the trend view
.. if you select e.g. the TriScore PMC in the Library chart
in Trends, the high/low curves get left behind because they
use the same name (Best_xxx).
.. ironically this was already worked around by creating a name
that included the symbol, but this was not used when adding to
the curve mapping.
... ensures that Month is changed to month of current ride (which fixes the missing color)
... tested also for new Athlete creation (without any Ride data)
Note: Root cause may be a sequence issue of setting the calendar month, setting the ride, setting to current ride.
So there might be a better way to fix the problem.
... fill "units" field with original "units" from Metrics if new Chart is created
... store original "unit" into LTMSettings for later reference in automatic translation
... use a new version of LTMSettings to be compatible with any written version
- Code cleanup, removing deprecated code and refactoring
- Metrics translation is now done in a method for LTMSettings
- User defined metric name (uname) is translated if it matches english name
- User defined units (uunit) is only translated if it matches saved units
.. saves time, since translation not required
.. also avoids messing up the uunits when charts are customised
to have common y-axis e.g. Stress Ae and An Stress and PMC
using Stress instead of ATL, CTL, TSB etc
.. using the Holt-Winters double exponential smoothing to avoid
low on rising and high on falling data series.
.. works best with relatively noisy and contiguous data
.. added as they are handy for quick compare of changes
in the near term, without having to add temporary
date ranges
.. we should think about an "easy" way to do this for all
years and months for quick comparisons, in v4.0
.. fixes 80% of the issues with sorting 'strings'
.. we cannot just return metric values since they
need to be formatted to have the righ precision
or conversion to pace/duration etc.
.. was skipping 2p and 3p saves because it was agressively
checking W', FTP and Pmax when they didn't apply or
for values that were possibly correct (e.g. W'/kg > 100)
.. no need to pass across weight since we maintain two
models; absolute and per kg already.
NOTE: this has highlighted a bug in the code related to
estimated w/kg bests for 2 and 3 parameter models
that will be fixed shortly.
.. to augment the existing vo2max estimate using peak 5m
data in a ridefile, this now adds it as an estimate from
the PD model estimate for 5m peak power.
Implements #1432 as an option for Edit Interval, the user must
enable it via checkbox and confirm before it modifies speed and
distance for the underlying samples.
.. to speed up extracting the mean maximals.
.. we still work at 1s intervals for very short durations
but gradually increase to longer as the duration gets
over an hour.
.. for almost all usage this will not make a difference to the
values extracted since the actual values are largely rounded
to integer values (and therefore the granularity was already
being disposed after the search).
.. the exact durations are;
Duration Increment
<120 1
<600 2
<1200 5
<3600 20
<7200 120
>= 7200 300
This reverts commit 7fdedf0bfe.
.. we will come back to look at multisport FIT files in v4.0
The main problem is related to the position of the SESSION
header within the file.
.. fit file manu:76 identified as Moxy
.. support 7 field CSV, ignore session number
NOTE: support for UTC dates is not present since we
have no way of checking what TZ the ride was
recorded in !
.. show the An / Ae stress to provide context to the
changes in peak power durations.
.. or "why my anaerobic power isn't getting any better
despite spending all my time doing sweetspot"
.. since interval discovery impacts load time (reading from backing
store) and refresh time (computing metrics for intervals) we do
not search for PEAK power/pace by default.
.. if the user wants that info (which is of limited value) then they
can switch it on in preferences/options.
.. should help to reduce performance overhead for startup and refresh
especially as an experience immediately after upgrading to v3.2
.. lots of scenarios to cause the SEGV but all related
to the CurveColors::save/restore state functions that
cast QwtPlotIntervalCurves to the wrong type and BOOM!
.. thanks to Simon Brewer for the ride file that had this data.
.. select which kind of intervals we want
.. makes it faster and also reduces the size of
the rideDB.json file quite dramatically which
may be useful for some users.
.. if you filter the ride list the reset will search for
a heading "Calendar_Text" that will not exist since it
is prettified to "Calendar Text" in the constructor.
.. seems redundant, but at least reflect the type() of
metric when deciding; if the metric is defined as
being of type RideMetric::Low then return true
otherwise false.
.. the metric can override this method if needed if
is is still only an average (e.g. weight ?)
.. New derived data series representing an estimate of core temperature
on the basis of HR changes.
* shown on AllPlot and RideSummary
* 2 new metrics; max and avg core temperature
.. This has been based upon "Estimation of human core temperature from
sequential heart rate observations" Mark J Buller, William J Tharion,
Samuel N Cheuvront, Scott J Montain, Robert W Kenefick, John
Castellani, William A Latzka, Warren S Roberts, Mark Richter,
Odest Chadwicke Jenkins and Reed W Hoyt. (2013). Physiological
Measurement. IOP Publishing 34 (2013) 781–798.
.. all features now complete, bar a couple of minor
pending changes.
.. upgrade process feature complete, bar some minor
cosmetic nits for colors/metadata
.. time to validate the code changes since February
with the user community and freeze new features
.. add W'bal Zoned to Histogram
- for a ride
- for a date range
- *NOT* for a compared ride
- for a compared date range
This makes the last of the updates for W'bal
in zone, but highlights the issues related to
W'bal being held in a different structure to
the rest of the ride data.
Need to think on how that might work better
for intervals.
.. add W'bal Zoned to Histogram
- for a ride
- for a date range
- for a compared ride
- for a compared date range
.. still need to update ridesummary to show
summary of w'bal zone distribution (3c)
.. add W'bal distribution to Histogram
- for a ride
- for a date range
- for a compared ride
- for a compared date range
.. still need to revisit to do in zones (3b)
.. still need to update ridesummary to show
summary of w'bal zone distribution (3c)
In activities it depends on selected activity, bests are automatically filtered.
In range mode it can be set by sidebar or home filters for single sport
.. based upon Fiet-type formula elevation^2 / distance.
From an idea on Dan Conelly's blog.
Some examples:
Mt Ventoux - 121
Alpe d'Huez climb - 83
Galibier - 81
Glandon - 66
.. so it's not perfect, but gives a good sense of hard
versus easy !
For multi-sport files, the bike section might record vertical oscillation or
ground contact time from the HRM-RUN sensor when moving in and out of
transition.
For single ride use sport specific base metric
For date range use sport specific base metric if filtered activity
list is homogeneous or combined otherwise.
.. pops up a dialog to ask if you want to just add this
segment (the default) or add all intervals on this
segment for a season (you can select a season).
... exception "Truncated" for the "final" read call of the FIT file
reader was not catched, causing termination of the program (problem
reported with an example file being truncated at the end)
Multisport FIT files are imported as separate activities, one for each session
in the file.
The internal storage format for multisport files was also changed form TCX to
JSON, as the TCX file would not store advanced metrics, like the left-right
balance from the Garmin Vector power meter.
.. the lazy delete was a horrible hack and memory leak.
So, now the paint delegate no longer dereferences the
IntervalItem * from the QTreeWidgetItem.
Instead we use setData for UserRole+1 to store the interval
color when constructing the trees. The paint function can
get this directly and we avoid any contention when the
intervals are deleted and created.
The lazy delete can be removed and deleted once the changes
have been notified via intervalsUpdate().
.. since they are deleted in threads and affect the gui
.. to avoid the overhead of cross-thread mutex we just
delete intervals lazily; each time we refresh them
the last lot are wiped away.
.. SEGV on setting CP when no zones configured. Since
RideItem::updateIntervals() dereferenced a range
when CP is set, but none existed.
.. fixup use of Metadata field "W'" to override settings
in Metrics tab.
.. with a sidebar indicator
.. we may need to change when we have planned workouts
as the intervals will need to match the plan.
.. but we can use the same concept of 'quality' when
comparing a full activity with what was planned.
.. to indicate how far into the zone we got, so
3.1 is 10% into zone 3, whilst 7.9 is seriously
high Neuromuscular power, but below Pmax
.. we use Pmax to bound the upper value when calculating
how deep we got into the very upper zone; so it is
possible for the metric to be 8.x when only 7 zones
are defined (when the power value is > Pmax)
.. in stack mode always start from min W'bal or 0, whichever
is smaller. This makes it easier to identify when W'bal
is (or is not) being consumed across rides.
.. when looking at a ride and working with intervals it
is sometimes useful to look at the rest of the ride
exluding the intervals selected.
.. we now show the metrics for the intervals selected,
followed by for each interval then lastly for the
rest of the activity i.e. excluding the intervals
selected.
.. we now filter sustained efforts by zone rather than picking
the very best non-overlapping effort.
.. this means that a L7 sprint mid way through a L4 climb within
a L3 ride will find find 3 sustained intervals rather than just
the sprint.
.. just place TTE, EFFORTS and SPRINTS under
the EFFORTS interval type.
.. this is getting ready for handling overlapping
efforts rather than just the very best.
.. when the URL for the webservice is created it places
a slash between the host info from preferences and the
service path:
http://wbsapi.withings.net/measure?action=getmeas ..
By default, the withings server configuration has a
trailing slash, which results in a URL of the form:
http://wbsapi.withings.net//measure?action=getmeas ..
The double slash here ----^^ used to be accepted by
the Withings servers but more recently it is rejected
so this patch removes any trailing slash before
constructing the full path.
.. Route segments are found during interval refresh
.. Config/routes.xml only holds config now
.. The fingerprint for a rideitem includes the route
fingerprint now so it will refresh automatically
when the routes config changes
.. if no routes are defined then no work is done, so the
amount of work is really defined by the user
NOTE: RouteWindow, and now, RouteItem will need to
be reworked and fixed up for v4.0
.. it optimises out setRide when it is the same ride as currently
being plotted, but the intervals will have changed since they
were reloaded
.. so we always notify of intervals changed after intervalsUpdate()
just in case other charts skip refresh when the selected ride is
the same as the one they are already showing
.. by introducing a specific signal to trigger it.
.. its very specific, but its more flexible (and a lot less
work) than adopting a model for the QTreeView that would
be a better 'architecture'.
Rebuilds the interval tree when a ride is saved and
refreshes intervals as a result.
There are a number of other scenarios that will also
need to call a sidebar refresh as a result of the
intervals being updated.
* edit ride data
* change metadata
There may be others lurking. This needs a review of
the code pathways leading to RideItem::updateIntervals()
and how we keep the sidebar in sync.
.. the integrated joules and resampling to 1sec code
was not taking into account the first sample is 0 seconds
and was incrementing 1 sample early too.
As a result the integrated series was 2seconds ahead of the
recorded data, meaning the discovered efforts and sprints
would have a start time 2 seconds ahead of where they
should have been.
.. so we can keep a reference to the user interval
in a ridefile from the rideitem and not worry about
trying to match or handle index offsets into the array
.. this is required to fixup the relationship between
an IntervalItem and a RideFileInterval in RideItem
and RideFile respectively.
.. anything over 85% of the power for duration versus the configured
CP and W' between 2mins and 1hr will be flagged as a sustained
effort via the intervals for a ride.
.. they're pretty rare, but this code will find
any TTE efforts between 1hr and 2 minutes.
.. it will be extended to find sustained efforts
but this is just to get the code started
.. wrote empty METRICS array when all metrics zero in an
interval. Its pretty rare but breaks the parser
.. this means that metric were being refreshed on every run
.. was getting lost due to cut and paste error
NOTE: you will also need to delete RideDB.json to get
the problem fixed. I didn't think it was worthwhile
updating the version number since no dev releases
are out, noone except developers will be affected.
In this part we have now reinstated the sidebar interval tree
but it is refactored out of athlete and into AnalysisSidebar
where it belongs.
* you can hover and select/deselect intervals in the sidebar
Left to do;
* All the interval operations like sort, drag and drop, find
delete etc do not work at present and will require some work
* Add a color button to the tree to let the user change the color
for USER defined intervals
* Add more types of intervals to the discovery; esp routes and
sustained intervals
In this part we have updated all the charts to reference
the RideItem::intervals() members instead of the TreeWidget
and RideFile::intervals().
The code to create/change/delete intervals is not included
so selecting and editing on charts/sidebar is disabled til
part 3 of the update, but hover should work properly.
Still left todo in future updates;
* Updates to the interval sidebar to list intervals
in a tree (by interval type) with a color selector
* Code to create, edit, delete etc the intervals via
the rideitem/intervalitem and see them reflected in
the ridefile
* Update to search for all the different types of
IntervalItems including routes and sustained intervals
Computes the metrics for an interval and creates a temporary
ridefile locally so you don't have to.
.. previous design should have pushed this into the
class instead of performing it in RideItem
.. now there should be no reason to create a ridefile
during interval discovery.
In this part we have added Intervals to RideDB.json and
are refreshed within RideItem, including interval metrics.
At present the IntervalItems are loaded from the ride file
and we ignore peaks and entire laps in favour of creating
them in the discovery code.
Still left todo in future updates;
* Updates to the interval sidebar to list intervals
in a tree (by interval type) with a color selector
* Update all the interval charts and dialogs to use IntervalItem
and the updated sidebar
* Update to search for all the different types of
IntervalItems including climbs and routes
NOTE: We will not be adding an Interval view until v4.0
.. to avoid glitch related to native widgets in toolbar and
inability to switch back from fullscreen mode on a Mac.
.. see QTBUG https://bugreports.qt.io/browse/QTBUG-43299
which doesn't look like it will be fixed any time soon.
.. we are taking a different approach for v3.2
.. the auto discovery will augment rides and maintain a cache
of all intervals across all rides
.. the discovered intervals will be selectable alongside ride
intervals in the sidebar
.. new interval views will be developed in v4.0
.. heartbeats x joules, when unfit you may generate low watts
but with a high hr, as opposed to the other way around.
.. an attempt to combine central and peripheral stress, can be
used to compare with power only stress metrics
.. when selecting intervals the points on a scatter plot
are joined when they are not being framed against the
rest of the ride
.. this is to provide some context about the order the
data was generated in.
.. would be nice if we could have arrows (vectors)
.. racermate format for VELOtron and Computrainer use
a variable rate recording, mostly due to PC interrupts
and workload (e.g. 620ms, 619ms, 624ms sample rates)
.. so we resample on import to 1s samples, the 1000ms sample
rate can be changed in the code to 500ms or whatever
.. this is needed to enable resampling and merging with other
data files, most notably from Moxy.
Fixes#1359
.. this has been added to support some data handling activity
to support a blood glucose study and is not really for general
usage.
.. the libsamplerate library is being used in ridefile::resample()
which is only used by merge and export.
.. we may choose to formalise this library later but for now it
is not required for any functionality and is not used in
release builds.
.. set when on a Windows platform, but not used.
.. when testing on a QT 5.4 release the font metrics appear
to take the scaling factor into account, but adding the code
for compatibility in the future (if we need it)
I intentionally didn't add the IndendPlotMarkers to all markings,
but only to the interval markers at the top of the plot.
NOTE: the height of the spacing is actually what Qwt tells us
is the textheight.
I think this spacing is rather big.
We might want to reduce it somehow in the future.
Signed-off-by: Simon Egli (Silzo) <smn.egli@gmail.com>
This commit is adding a new class QwtIndPlotMarker that will enable us
to indend Labels. The usage is pretty much the same,
please look at the changes in LTMPlot.cpp to see what will
change for using the new class.
So far the functionality is implemented for horizontally written labels only.
This solves the issue of all Labels (e.g. Seasons and events in LTMPlot case)
being on one line and thus being unreadable.
Signed-off-by: Simon Egli (Silzo) <smn.egli@gmail.com>
There is no official proclamation that ID 260:0 is officially assigned
to Zwift; it is simply the value observed in data files downloaded from
Zwift for the author. A support request opened with Zwift requesting
confirmation has gone unanswered.
Smart recording interpolation fills the gaps in pwx files present
when the original .fit or .tcx files had them.
Test files for running: 1 activity in .fit, .tcx and .pwx formats
Lap swimming expands the sample-per-length and pause to 1-sec sampling.
Test files for lap swimming: 2 activities in .pwx format,
one from Garmin 910xt other from Finis SwimSense.
... draw Level 1 text at the end to have full contrast (not overlapped
by level 2 brush)
... dynamically choose font size for Level 2 texts from 4 options (based
on available space in rectangle) - easier readable on big screen - still
usable on small screen
... check if the "folder-upgrade" has really taken place - if not
reset, Upgrade Flag to force the new folder structure upgrade
... (allows to revert to the pre-upgrade backup of a folder structure -
which during test already had be successfully upgraded and therefore
marked as being ok).
When Sport="Other", there is no GPS data but there is distance information
it is assumed the file cames from lap swimming.
They have one Trackpoint per length, which are expanded to one point per second
in similar way to Smart Recording and laps without Trackpoints to signal pauses
which are expanded to one point per second up to 10x Smart Recording HWM.
Added contributed Garmin FR910xt pool swim file to test/rides folder
... allow resizing of Dialog Window (if using bigger fonts/translation)
to see all texts
... allow entry of Average Speed with precision (1) - like the metric is
defined
... shift plot if start date is earlier than any Power Estimates exist
... enhance grouping (calculation of averages for month/years/all
grouping)
... adjust estimates calculation
... to calculate non-overlapping weeks data
... to not create any "infinite" data for weeks before the first Power
based actitivity exists
Display and edition in Pace units, according to sport preferrences
Pace 00:00 is used to represent 0 kph
Fixed PaceZones::read to allow non-integer limits
... problems on deleting the source files (even they have have been
successfully copied to /target) are now reported as error (which require
to be cleaned up before Upgrade is marked as "successful")
... reason is that such "orphan" files may cause problems - e.g. if the
"upgrade-successful" indicator get's lost and we want to start 3.2 with
a fully cleaned file structure.
... check for valid Activity Filename format "YY_MM_DD_HH_MM_SS" (for
non-JSON files before conversion)
... check if the Activity filename contains a valid date/time
... report if File is not readable - not just "skip" it
Distance/Duration is a better approximation for Avg Speed than 0.0
and Duration is better than Time Moving in GOVSS/SwimScore estimation
for these cases.
.. metadata only flushed when ride marked dirty, but
ride won't be marked dirty until metadata focus/edit
ends.
.. because opening a menu doesn't change focus we need to
use the flush event to trigger the focus/edit end function
.. was not refreshed previously (!)
.. need to optimise this to only recompute w/kg stuff
rather than the entire cache for the ride when its
just because the athlete weight changed.
Allows to generate data points for manual activities from series of
work/rest intervas with distance/duration information and reps count.
It is enabled once sport is entered as Swim or Run and distance units
follows pace preferences for the selected sport.
Duration and Distance for the activity are calculated from laps information,
but it can be overridden by the user.
If LapsEditor is reactivated the lap information is preserved to allow corrections,
provided the sport is not changed.
Input method for duration is selected for simplicity and easy of input using
numeric pad, tab and enter.
... fix .FIT format Smart Recording (similar logic like for .TCX)
... use the GC-Preferences Settings to determine if Gaps shall be filled
(and which Gap size)
... make Upgrade Marker release independent
... adjust the texts from 3.11 to 3.2 verson id
... this will just make the Upgrade procedure run ONCE again for
Athletes which have been converted by a DEV build - but just to
check/report sucess
.. tile mode highlights on mouse over for a more
fluid feel, and better feedback
.. can customise the trend view charts background
.. fixed a SEGV on apply preset in chart setup
.. this is part of a set of updates to update the
standard setup to be more complete so the user
can pretty much run off a standard config.
... if configuration for requested feature is missing (but not in
MainWindow - initial download)
... any network errors coming back
... to simplify error analysis - since the API call may have multiple
reasons to fail (configuration, network, proxy,ssl,...)
... adds authorization required for new Google CalDAV interface
... adds CalDAV configuration variant (Generic vs. Google)
... corrects Refresh from Google to GC (as they a using a non-complient
XML-tag prefix)
... comment unused CalDAV features - which are not enhanced for Google
CalDAV as they are not used yet
.. LTM stress curves had the same symbol name and
so some were not deleted when the date range changed
leaving curves on the plot
.. we now set the best symbol for stress curves so we
have a unique name for each curve
... remove $$replace and use the latest src.pro code from QWT lib (which
allows in-source and out-of-source/shadow build)
($$replace - for unknown reasons - creates an empty string/fails if the
input string contains mixed Upper and Lower case characters - which it
happening in many file systems)
.. will break out of source builds in QT Creator
.. means everyone else's builds will still work
.. happy to apply change if it doesn't break builds for others
Fixes#1247
.. splits into words but will allow user to escape using the quote
character (") or the backslash (\).
.. so <"hello world" \"this\" t\est> will result in three strings
<hello world> <"this"> and <test>
.. use a simple free text search against the ridecache now we
have all the texts available and in memory
.. no need to maintain an index, no dependency on a horrid lib
with nasty dependencies and its faster too
.. the free text search is very simple, will need to bolster it
over time e.g. it matches text not words
... add "Up" - "Down" function for Curves Table Items in LTM Settings
(particular useful when add a curve in Stacked View and wanting to have
that curve shown at first position)
.. on windows especially, there were issues with the call to
IndexWriter::addDocument() resulting in an exception.
.. the introduction of a QMutexLocker to manage the mutex locking
seems to have fixed things, but they only seemed to manifest
on Windows.
... change calcuation of Averages for TE/PS by using the delivered
samples with valid values (> 0) and the number of delivered data samples
> 0 as the basis
... correct the path in RideItem after updating RideCache to the final
path (since RideItem has a local buffer for the path - which is e.g.
used at "Save Ride") any manual changes after the import will create a
new .JSON in /tmpActivities and not update the original .JSON in
/activities
(Problem only occurs when using the in-memory data after an Import or
Downlaod)
... for RideImport and RideDownload the created .JSON files are firstly
stored in /tempActivities and only moved to /activities after
successfull updating RideCache (with this files with "bad data" cause
RideCache calculations to crash can be identified when starting GC again
... in GC CrashDialog the /tempActivities are documented in the Crash
Log and moved to /quarantine for further analysis
... small addition - the existence of the new directory structure is
verified when opening an Athlete - missing directories are added to
ensure a consistent structure being in place at all times
.. but to avoid being too 'opinionated' about the users
training we limit to the really obvious things and
don't offer any opinion on middling values.
.. LTS > 80 is green > 100 is blue
.. SB < 40 is red -- overtraining
.. RR < -4 or > 8 is red -- detraining or overextending
.. it borders on bollocks given each athlete is different
and training is about managing the overreaching and recovery
to push at those boundaries
.. might end up removing this altogether .. but might flag
stuff up for newbies
.. value that result in nan/inf values need to be cleansed
to ensure the metric array in the rideitem is clean
.. because we load values from json we clean anyway in
PMC data since it seriously breaks the skiba PMC and
development users will have bad data.
.. was updating as you typed which created a nasty lag
but updated the metadata and metrics constantly
.. on one hand it was reassuring to see things change as
you typed, but on the other hand it was pretty tedious
.. we now catch focus change on text edits, see if they've
been changed and then trigger an update if that is the case
.. does all labels etc and integrates in with the rest
of the LTM chart and CurveColors classes.
.. underMouse() seems weird when legend is updated, might need
to find a better way to work out if/which legend was clicked.
.. if we get measures whilst the ridecache is being refreshed
it can cause a problem - and the refresh needs to be restarted
anyway.
.. download now stops and restarts any refresh.
.. headings are already adjusted in the ridecachemodel so
need to look for new name for CalendarText
.. this is a bit of a hack, but then so is the CalendarText
metadata field - it should be a first class RideItem class
member and be maintained alongside date etc
.. and also tidy up use of isPeak() etc
.. starting to wonder if we need to a) auto find intervals on import
and then b) list them in a tree c) allow user to select a 'class'
of intervals to show (i.e. select all climbs)
Especially for Vectors new metrics
- Left and Righ Platform Center Offset - eg: -8mm and -11mm
- Left and Right Top dead Center - eg: 10° and 11°
- Left and Right Bottom dead Center - eg: 203° and 210°
- Left and Right Peak Power Phase Start - eg: 83° and 76°
- Left and Right Peak Power Phase End - eg: 115° and 125°
.. will rerun as ride selection changes.
.. but will never stop until cleared so use at your
own risk, as will run EVERY time you select a
different ride.
.. remove a missed XXXREFRESH marker to get the CP bests
curve refreshed when a ride is saved in the period of
the bests curve.
.. would be nice if we showed the current in-memory version
rather than insisting on the on-disk .. need to adjust
ridefilecache to traverse the ridecache for that !
.. the "bak" directory was added during the development cycle
and will not be present for users that worked with an early
development build
.. when deleting rides the "bak" rename will fail due to the missing
directory
.. the error message has been changed to provide the details of the
directory where the failure is occurring to help signpost users
to the problem
.. we don't save the currently cached metrics etc
for rides that we discard on exit (i.e. don't save)
.. the metrics etc will then get recomputed when you
restart GoldenCheetah.
... Help Overview Window added to MainWindow - containing
.. Info on new "Shift"+"F1" Context specific Help
.. Links to Golden Cheetah Tutorials, Science, User's Guide, FAQ
.. notify if the metadata configuration has been changed
.. also snuck in a change to take hysteresis out of the
power zones fingerprint - it should not have been there
.. Needed to move about some of the color config
methods and remove the unneeded object from
mainwindow and initialise global color settings
in main() instead.
.. notify if Athlete weight or height were changed by
the user during the config dialog
.. no longer included in zones fingerprint
.. ridecache now picks up on specific config changes
... fix problem of not visible track (Windows,...)
... use "run" data series if track isRun()
... add "start" and "end" placemark
... enable translation of texts
.. ridefilecaches return incomplete flag if data not available
when aggregating (plotting during a refresh).
.. CP plot will refresh as the background update takes place.
.. this occurs even during a comparison.
.. no need to uplift this from the old metricDB as the model
now spots changes at an individual ride item basis AND
will refresh during a background refresh too.
.. no need to uplift the code that used to call for a metric
refresh after rides were imported since the addRide function
will now refresh for individual rides.
.. when downloading withings data the cache is refreshed
.. when the cache refreshes it notifies the *current* ride
changes if it is refreshed
.. ridesummary has been updated to process rideChanged() signals.
.. it is too slow. Need to think about how to implement
this with good performance.
.. if you really want it then add
DEFINES += GC_HAVE_RANKING
to gcconfig.pri
... correct Alt/Slope behavriour in FullPlot (default = inactive)
... handle Alt/Slope status properly when switching back/forth between
Compare Mode and normal Plot view
.. to let charts etc know that the *current* ride has
changed and will need to be replotted
.. the editor / dataprocessor functions have also been
integrated into the RideItem to notify the change
.. there is a qDebug() in RideCache in lieu of updating
all the charts to refresh on this signal.
.. introduce concept of configChanged(what) to
pass details of what config has been changed
.. fixed zones changes to re-read after write
to correct the save twice to get changes to
zones bug.
.. next parts need to spot changes (part 2) and
then action appropriately (part 3)
.. rather than check if lucene index contains every ride
upon startup just force a rebuild of the index is missing.
.. if the index gets out of sync its because people are copying
data and so they should delete the index when they do so
to make sure it stays in sync
.. in sidebar, we summarise for all the selected intervals.
.. we take into account if they overlap, so two intervals
of 10 and 5 mins where the 5 min interval is wholly
contained within the 10 minute interval will be summarised
as 10 minutes not 15 minutes duration.
.. the lucene index writing during RideCache updates needed
to avoid conflicts between multiple threads writing at
the same time.
.. just added a QMutex around write operations - reading is
still thread safe and can occur in parallel.
.. when using '*' for values we autocomplete based upon
previously entered values for the field, but we didn't
take into account ranking.
.. now the autocomplete list is ranked to most popular values
complete first.
.. from RideSummaryWindow as it is no longer needed since
we moved to using a specification object to manage the
filter sets and date ranges to filter on.
.. using the GPX format they add extensions to record
power, heartrate and cadence using element names
power, heartrate and cadence ! (way to simple!)
.. thanks to Wenqi Zhang for the sample.
.. to enable queries such as;
Date > "2014/02/28"
for rides since 28th February 2014
.. might be useful to allow localised dates
but using this makes it easier to document !
.. a query like today > "1900/01/01" will pass
on all rides, but user being an idiot.
.. use "Date" and "Today" which evaluate to the number
of days since 1st Jan 1900.
.. so a filter for the last 90 days would be:
(Today - Date) < 30
.. will add date strings next.
.. removes across the code base
.. need to fixup RideFileCache and Lucene refresh
within the RideItem/RideCache framework, they will
NOT be refreshed at present
.. need to look at how charts get refreshed on data
changes now RideItem provides a more granular
mechanism (look for XXXREFRESH in code)
.. New Intervals code will definitely NOT compile
and needs to be redesigned/reimplemented to fit
in with the ride cache
.. add/remove ride now works
.. fixed metric value in data()
.. need to test (especially with the diary
window and new athlete with zero rides and
then import, add, delete, change, sort
merge, split etc and push update to
fix such bugs in Part 3
.. getting the model in and integrated with the
ride list and diary
.. next steps to connect up to ridecache methods
::addRide and ::removeCurrentRide.
.. then fix up nits/bugs with diary view etc
.. this removes the dependencies on liboauth and friends
and replaces it with a single lib.
.. the library is available from http://github.com/kypeli/kQOAuth
.. the only current feature that requires OAuth is tweet
your ride, but this lib will provide the services for
future oauth services.
.. if a filter was being applied we created a local PMC
but also filtered on dates, this caused the PMC data
that was generated to only represent the activities in
the period selected !
.. thanks to Ale Martinez for pointing this out.
lts(metric), sts(metric), sb(metric) all return the PMC
value for the metric in question for the date of the ride
and therefore allow you to select rides based upon PMC data.
e.g. sb(TSS) > -5
could be considered a way of looking for rides when you were
in a well tapered state, or at least, when you should be able
to perform well.
or, e.g. lts(TSS) > 100
could be a way of looking for rides at peak form (if 100 is
a peak CTL for you).
... separated the "out-of-source" patch from yves from original pull
request
... the patch allows to use e.g. QTCreators "Shadow-Build" feature so
that GC is build not in source, but in a different directory
.. this is useful when using QTCreator and switch between different QT
versions / 32/64 bit builds - since every build resides in a separate
directory from GC source
-- since the original commit (at least from GitHub view) is shown in a
mixed pull request with other commits - this is a seperated version of
the single commit
.. so it is shared across charts when no filtering
is applied.
.. when filtering is applied then LTMPlot manages
the PMC data itself.
.. now we use the ridecache the PMC update is really
fast anyway.
.. also uses a copy to avoid delete/insert issues when adding
and deleting rides during a refresh
.. but still need to consider the delete operation and marking
items as in process or something
.. just playing with the concept, not neccessarily how
things will pan out.
.. If you delete rideDB.json and start GC then switch
to a PMC whilst the cache is being computed and look
at all dates you will see the chart refresh as data
arrives.
.. used to create a 'specification' against which we match
a rideitem when plotting etc.
.. so rather than passing an array/vector/list of data when
calling a plot, we pass the 'specification' to use instead.
.. the plots themselves should now iterate across the shared
ride cache only plotting the items that pass the specification.
.. this should reduce memory usage and increase performance.
.. moving away from passing data when working with groups of
rides to passing constraints instead.
.. so FilterSet allows us to pass a collection of filters
that can then be applied to data.
.. in this way the plots can iterate over cached data selecting
rideitems based upon constraints applied by the user.
.. these need to be embedded into LTM, TreeMap, Histogram etc
.. still a bit funky with the filtering, there is probably
some scope to simplify that, but at least now its only
a list of pointers not objects on the stack.
.. no longer uses metricDB but traverses in memory cache
and should be a lot faster.
NOTE: the line endings for DataFilter.{cpp,h} have been
changed from dos to unix format which has resulted in
the entire file being changed, apologies but needed to
clean that up anyway.
.. the clunky old way of using a 2 month rolling window has
been reworked to use a 12 week rolling window making the
code less susceptible to jumping around esp. on 1st of the month!
... adds "What's this" to (hopefully) most of the widgets (please report
on missing ones)
... defines draft "Whats' this" texts including a
context specific WikiLink
.. Help Key for all platforms is <Shift>+<F1> + in some widgets
"RightMouse - Click"
... Tested on Win and Mac (On Mac QtMacButton seems not supporting
"What's this") - so here <Shift>+<F1> has no result.
... ToDo: Create final texts and links based on the to be updated 3.11
Wiki
.. so available for current ride
.. and refreshed() when notifyDataChanged() is called
.. but not many classes call it!
.. we are moving to having the filecache read from the
RideCache rather than straight from disk so we have an
in-memory and persisted version.
.. so ONLY change version number of a refresh is going
to be needed !!!
.. I updated rideDB version to 1.1 to ensure present gets
refreshed as it is used by the PD model estimate code
.. from DBAccess to RideCache
.. and also SummaryMetrics::getForSymbol() now available in
RideItem to access the precomputed metrics for a single
ride.
.. removing any remaining references to measures in the
code. We now use withings only and that is handled
in a non-generic manner.
.. measures and equipment are likely to get put into
v3.3 once we've done planning.
.. loads the cache/rideDB.json back on startup to avoid
any refresh of metrics etc
.. uses a lex/bison JSON parser, not because of performance
since its only run one at startup, but because;
* QtJSON support is only available in QT5
* mvjson uses a DOM model that creates a memory overhead
* the existing bison/lex parser works well and is easy to
use as a template for this
We now have a good mechanism for metrics and metadata refresh,
cache and recovery so can look at using it in the charts and
the ride navigator next !
.. moved the overwrite of the withings cached response
to when we know we got something successfully.
.. previously we overwrote regardless of what we received
which means that when we have firewall/network type issues
the cache was overwritten with blank data !
.. but only refreshes the ride added rather than looking everywhere.
So, when we are importing large numbers of activities it won't
repeatedly run a full refresh (which was bonkers).
.. if we close GC during a background refresh operation
then the refresh is cancelled and cache saved in whatever
state it is in now .. the user clearly didn't want to wait !
.. when refresh() is called for a rideitem it will
now compute the metrics for the entire ride
.. when a ride is opened the cache is also updated
at the same time.
.. added to slow things down on my developer PC as its
to fast to notice when I'm testing.
.. also left in an erroneous line clearing RideItem::isstale
which is also wrong as breaks separation of concerns
This is quite a big patch with lots of nasty interdependencies
all collected together but essentially it deprecates;
* Measures are no longer stored in SQL tables
* Zeo support has been dropped (they went bust)
To achieve this there are a large number of updates;
* Withings json is now cached in /cache and in the Athlete
class. So can be traversed in memory rather than SQL
* All "measures" on LTM have been removed and the only metric
left is "Athlete Weight" that cascades from withings to ride
"Weight" metadata value to athlete settings to a 80kg default
* RideCache is now refreshed, but only for metadata. This is needed
to cache the "Weight" metadata from rides when calculating weight.
* JsonRideFile parser is now re-entrant since it will run in parallel
during RideCache refreshes (using the QtConcurrent::map()
framework).
BUT NOTE
* This is about deprecating the Measures table more than anything
else. Functionally we are in pretty much the same place; just that
data is stored in a different place.
e.g. metric/imperial handling of weight is not fixed yet, no
metrics are in the cache yet, load/save of the cache is not done
so startup is slow etc.
.. fingerprint for range should not take into account the
start/end date as its irrelevant and will change
.. RideItem now responsible for refresh and status updating
on the rideitem
.. framework seems good now; only rides that need to be refreshed
will get asked for a refresh -- but need to look more closely
at how we derive 'Weight' for each rideitem now...
.. instead of making the caller keep rideitem up to date etc
we are going to move to it looking after itself.
.. the first part of this is to make it responsible for checking
if it is stale and computing fingerprints etc
.. the next part will be making it responsible for refreshing
the cached values.
One big thing too:
.. the fingerprint is now based upon the zone config that applies
for the date of the ride -- not all zone config. So if the config
changes but not for the date of this ride (e.g. set a new CP starting
from today) then the old data does not get marked as stale.
.. needed to clean RideItem a touch
.. needed to isolate intervals code as it has some
problems and breaks metricaggregator for normal
use.
.. found a bit of Context code in MainWindow.cpp (!!)
.. subtle, thin progress bar on tabview to notify
when background updates are in progress
.. background updating code created but does not
perform a refresh yet, just sleeps for 0.2s
.. to enable 'visibility' of the code use WANT_RIDECACHE
to the defines in gcconfig.pri
.. added /BAK subdir where all actvities .BAK files are stored
.. do not delete any original files in /imports /downloads when deleting
activity
.. copy deleted activity .JSON as .BAK into /BAK subfolder
.. adjust upgrade procedure to copy .BAK files to /BAK
# By Mark Liversedge
# Via Mark Liversedge
* 'master' of https://github.com/mtbkeith/GoldenCheetah:
Added RideCache
Introduce the RideCache
Turn off interval hover on leave
.. each metric now has an index (identifier) that can is numeric
starting at 0 and going up.
.. it can be used to offset into an array when we add a cache for
storing precomputed metrics.
.. they are in Athlete::zones() et al now
.. this refactor was missed in the 3.0 mainwindow
refactoring and is part of the prep to use RideItem
as an in memory cache instead of the old metricDB
.. so we can now call that instead of doing the conversion
and formatting all over the code !
NOTE: it still needs to be /called/ in the code, that change
will need to be applied everywhere a metric is displayed
to the user.
.. to fix long standing bug with saving whilst editing
a field. But still leaves a problem if exiting whilst
editing a field (which is a bit weird tbh).
.. its been there since the beginning at the heart of the code
as a registry of the rides (RideItem) and controlling the
selection of rides.
.. in v3.0 we stopped showing it, but it was still created and
then hidden immediately. But removing the 'spine' of the code
was seen as a step too far.
.. this is the first part of moving from SQL to a NoSQL cache
for ride metrics, metadata and measures -- RideItem is now
no longer inheriting from QTreeWidgetItem with all the issues
that brings.
.. since its right at the heart there are likely to be unforeseen
bugs as we go, especially since it affects the ride navigator.
.. add/delete has been tested a fair amount and should be reliable.
... do not process the popup if no files with the correct extensions
were found / the directories were empty
... (this does not address to skip files which were already imported !)
... make Upgrade Check Window smaller (with scrollable Text)
... only allow to proceed if Text is scrolled down to end (full read)
... in Upgrade Log, only allow to proceed to athlete if Log has been
scrolled down to the end
The ride files will now be .json.gzip
Users will also now be able to add an emergency contact phone number.
Ride logger will use that number to update the contact on the riders current
location. It will also notify them if the acceleration is above 15 or m/s^2.
If so the emergency contact will get an sms with the current location.
TODO: 15m/s^2 is easy to trip. I need to research a way to minimize false positives.
Change month format in ride headder
Make sure numbers are formatted correctly ie not scientific notation
Log all current values:
Perviously it only logged values that were measured.
However, if GC doesn't see the other values it assumes they are zero.
.. Wahoo don't do that anymore.
.. now use the same channel as the device and just send plain old
ANT+ messages to set slope etc (why they didn't do that in the
first place is absolutely beyond me)
.. getting ready to implement Kickr for the THIRD time !!!
.. when not hovering over a curve, this worked ok for power
but not for anything else. Because the signal was ignored
when not showing power in pointHover.
Fixed units selection in histogram tooltip, it is independent of pace units
NB: CV chart currently doesn't obey units setting for speed, it is fixed to kph
In LTM Plot and on Summary Windows conversion
... data already converted for the curves was converted again
... for "Best" Summary the conversion was missing
Referring to issues #1067#1071 (see also comments on issue #1069
... fixed by
...... not considering Y-Axis values in the 0 to 4.993 minutes range
which are not shown for VAM anyway
... both in standard view and in compare view / intervals and date
ranges
... handle intervals below 4.993 minutes properly (since they are not
shown in CP VAM)
... but limit what individual services are build/offered based on oauth
availability (Strava, CyclingAnalytics). Load's of ifdef... making me
think about alternative solutions - especially now that the common
uploader base class allows to stuff them in a List/map/vector/whatever.
.. added Edit for all ride data processors now we
have quite a few to select from
.. shifted a few things around to make important
options more prominent (e.g. Share) and less important
ones less prominent (e.g. Heat Map)
introduced a base clase for the individual uploaders to reduce code
duplication.
This made it possible to
- default to download a ride to a service if it wasn't uploaded, yet.
- grey out checkboxes for services without credentials
tab order defaults to the order widgets are created - and not the order
they're added to the grid widget.
Reordered code to bring creation + adding of Widgets in sync.
.. and they will hang themselves !
.. seriously, the limits to the merge offsets
added no real value but would annoy a user
where the rides needed to be aligned to a
greater proportion.
.. adjust can shift the offset for the entire
length of the ride
.. line 1289 of AllPlotWindow was updated to rebuild the
plots when the ride was dirty, but it looks like there is
a strange interaction when rideItem doesn't change and
rideItem->ride() does.
NOTE: rides will not be refreshed after merge wizard completes
until this is fixed up in AllPlotWindow.
... handle Gear Ratio as part of the existing logic - just without
smoothing
... solves SEGV problem in Compare Mode (and probably other areas of
AllPlot)
.. need to save away with analyse() and combine()
now complete, and working pretty well on my data
.. now to work on the last piece, the 'adjust' page
to shift data-series left and right manually (for
cases where the calculated offsets are wrong or
need to be tweaked by the user)
.. page flow and join sorted
.. committing before resolving the merging code
- analyse() to identify offsets
- combine() to merge into a working copy
- ux for sliding offsets on a fullplot
.. next commit will complete this update to the
merge tool
NOTE: MERGE IS NOT CURRENTLY WORKING SO PLEASE
DO NOT USE IT !!!!
.. data can be sourced from file, download or list
.. next to update the mode (join or merge) and the
merge strategy and parameters.
.. will also need to update the download dialog to
allow you to specify which downloaded rides to
process -- at present the merge tool assumes that
the download dialog will only return 1 result
.. pleased with the way the download dialog is embedded
within the wizard, will use that for other things!
.. fix json writing so that user metadata no longer conflicts
with the tokens used by GoldenCheetah, e.g. a user entered
"NM" in the workout code and that conflicted with the
token used to delimit a torque value.
.. all user strings are now saved with a space " " appended to
the value and when read, if there is a trailing space it is
removed.
... in the escape &, ' and " as special XML chars where missing
....... causing that a rule for cLucene with "&&" could be stored, but
got lost on reading
... multiple pathes per Athlete (on Athlete-Preferences - AutoImport
TAB) - option per Path if Import shall be done or not (e.g. for
temporary de-activation without removig a path)
... configuration stored in XML file in /config subdir
... no "stealth" mode any more - but full log of Rides to be imported
with option to "Abort" the import process at any time
.. the download has data in a circular buffer - when you overrun
the buffer it starts back at the beginning and then downloads
that data as-is.
.. we now sort the downloaded data before extracting it into rides
and ignoring rides < 1 minute long.
.. split into separate rides when gap is greater
than 30 minutes between samples
.. discard subsequent rides that are less than a
minute long
BUT: Does not help resolve merge challenge and really
should let the user select which rides to import
regardless of how much data they contain.
.. works for download and clear
.. is pretty basic as the downloaded data
is treated as a single ride
.. need to think about how we can split into rides
and refactor the tool to create multiple rides
with the user selecting which to download.
... create folder structure for existing and new athletes
... upgrade existing athlete to new structure when opening / incl.
logging and error handling
... convert any "Downloaded" file to .JSON directly - store source file
in /downloads
... convert any "Imported" file to .JSON directly - store source file in
/imports
"Time Riding" was only calculated when the ride had kph values - although
it's then also including time without kph but cadence. This caused it to
skip all time spent on the trainer (... if there's no sensor on the rear
wheel).
This patch makes it consistently calculate "Time Riding" if there's kph or
cad... might be worth to count time with pwr or similar running metrics,
too.
.. the left/right scrolling is useful and takes very little
screen estate so always enable it
.. the full plot can still be show/hidden with the chart
controls
.. added config and page decoding for Moxy
Next steps are (2) add telemetry to realtime data structure
and display on the realtime chart and telemetry
(3) add SmO2 and tHb to file format which means moving
away from powertap csv format (!)
.. get timestamp from file not line number (to make sure
drops in recordings are not lost as they are numerous)
.. duplicate each line to get 1s recording that makes it
easier to merge manually (until the merge function is
fixed to handle these kinds of issues)
... introduce new "home" Folder structure object representing the
previous flat-folder
... adjust relevant QDir home - access to use the sub-folder method of
the new object
Note: the new structure is not yet active ! - everything is written to
the main folder still
To Do:
... add upgrade procedure for existing folder content to merge to the
new folders
... option to show the datapoints depending on a gear ratio intervall
... gear-ratio 0 to 1 -> Red
... gear ratio 1.01 to 2.49 -> Yellow
... gear ratio 2.5 to 3.99 -> Green
... gear ratio 4 to max (7.00) -> Blue
.. the Moxy can be configured as a SandC sensor, so in
readiness for ANT+ support in GC just adding code to
spot it.
.. will also need to update this for when it is paired
as a muscle oxygen monitor
.. will need to add SmO2 and tHb realtime data telemetry
.. will also need to add code to device config to notify
when SandC is spotted as a moxy
.. RideFile - add rounding approach for gear values (different roundings
depending on value) - leading to discrete GearRatio values
.. AllPlot - exclude Gear Ratio from Smoothing (to keep the discrete
value) - and change curve type to "Steps"
.. ScatterPlot - specific handling for GearRatio since values between
0.01 and 1 are relevant for GearRatio and must not be filtered out
.. RideFileChache - add Distribution Data for Gear Ratio and fix
Distribution Cache for DataSeries with > 0 decimalsFor
.. Histogram - add GearRatio to Histograms (both Rides and Trends)
.. as the scales were too high when shared with things like
power and torque and made them difficult to see
.. also now color shared axis according to what are selected;
so if only one series selected it will get that color rather
than e.g. yLeft,0 always being red
.. plotting the new running dynamics data series;
ground contact time, vertical oscillation and cadence
.. plotting the moxy data;
muscle oxygen (absolute) and haemoglobin mass (relative)
.. just added to the controls (AllPlotWindow)
.. part 2 is the slog to add to the plots (ugh)
.. metrics for time in zone
.. summary on ride summary
Still need to add to cache, histograms and allow editing
of custom zones in a sensible manner (currently edited in kph/mph)
.. in truth the code is largely a copy of Zones.{cpp,h}
written by Sean, but it seemed a bit odd to not show
that I introduced the file and the changes.
.. recognising that it doesn't /really/ matter much at all !
.. in this first part we just add the pace.zones file
and basic configuration of critical velocity history
in the configuration pane.
.. in part 2 we need to fixup custom zones and consider
how they might be adjusted for VDOT/Daniels etc etc
.. in part 3 we need to add pace zones to the ridefile
cache and then histogram and summary charts.
... import Ride Files automatically from a defined Directory per
Athlete
... runs silently/without "Import Rides" Widget if the files can be
imported/copied/... without error or warning
... Preferences->Athlete- defines
... the directory - per Athlete and- if the function is active at all
(default is OFF)
... the error handling
... report back ALL errors and warnings by opening the RideImportWizard
popup
... report back Errors and Warnings - but ignore the "File exists"
warning (so that the import directory can be continously supplied with
new files, without the need to remove the already imported ones)
Dave Waterworth has fixed my implementation of W'bal to
remove my "optimisations" and fix the math.
The W'bal is now computed in a single pass and is just
as fast as the differential form from Andy Froncioni but
has the benefit that is still uses Tau.
Many thanks to Dave, and I'll write this up shortly.
.. and interval hover on marker
.. need to also show interval on hover as gray path
but find a way of doing it without duping the code
in the webpage js.
... improved resizing by not changing other column sizes in "resizing"
... considering keeping a minimum column size of 20
... consideringkeeping all columns within the visible widget space
... the Alt/Plot settings were not in sync between standard anc compare
view (changes in compare view had not impact on standard view - when
de-activating compare)
... Alt/Plot is now also visible in "fullPlot" as this helps to find
sections to zoom in (by checking the color coding)
... add "Slope" curve based on Slope Data in Ride Files (with separate
new color)
... add "Alt/Slope" curve based on "Altitude" data series
... sections on "Alt/Slope" have 3 options - 1min/100 m OR 5min/500 m
OR 10min/1000 m
... color / slope assignments are defined in AllPlotSlopeCurve (to look
it up)
... if a plotted section is wide enough the slope % (distance) / VAM
(time) value is shown above
.. isRun is a bool, so isRun = 0 or isRun = 1
will filter for runs.
.. note isRun does more than just look at sport
it also checks if there are running data series
in the file and may extend to more over time
Problem:
... data points of "Smoothing" settings are set to Zero in result
... this cause e.g. Zero Altitude Values when Plot Smoothing is active
Solution:
... also most left values are "smoothed" now (using only the datapoint
left of them to create the average)
... 2 new metrics (estimates) mainly relevant for MTB or Race bike steep
passes
... a) Time Carrying = moving < 8kph, gaining height, no power, no
cadence
... b) Elevation Gain carring = same criteria, but adding up the
elevation gain
Since there is a certain level of error, the metrics is named as "Est".
.. if power is already present, or alt or speed are missing
then the fix derive power postProcess won't try and derive
power for the ride
.. this is so you can add it as an 'auto' tool and derive power
values for rides that don't have power but do have speed and
altitude.
.. it seems to be working ok
.. it provides too much output, even for debugging purposes
.. it isn't relavent for 99% of users now its in the master
repository and being compiled up and used
.. remove references to aerobic and anaerobic threshold as they
are not really used in the literature anymore
.. remove talk of training interventions and just point out that
power at LT2 (CP/FTP) is a good indicator of endurance performance
.. we should add a section on MU recruitment and fatigue and
training interventions with the new features in v3.2
.. the code has been updated to support the Wahoo Kickr
via an ANT+ USB stick.
.. this requires the Kickr to be running a beta firmware
of version v1.3.15. This can only be loaded via the
Wahoo utility.
.. for those that have access to the beta firmware this
patch will work, for all others they will need to wait
for the formal release by Wahoo.
.. the code contains *lots* of debug and does not yet support
calibration and slope mode is largely untested.
.. for posts to the usual websites
* bikeradar
* weight weenies
* wattage google group
* timetriallingforum.co.uk
* golden cheetah announce, users, developers
Will require formatting into the markup each site requires
but will take the effort out of formulating text
... values in the ride plot deviate from the ride data since smoothing
takes place even if the sample time is equal to the smoothing interval
(for which the expectation is that the original samples are plotted)
... on QT5 the conversion of chars > 127 did not work (ending with ???)
when loading a .JSON ride file
... by this change the implicite type cast (char to QString) when
calling "unprotect" does not take place any more, so the lexer string
must be 'Local8Bit' to what is has been converted when reading the file
... again QT has changed behavior of locale related processing in QT5
(all this worked fine in QT4)
... wrong Axis IDs causing the following problems
... X-Axis - not considered time, but high (wrong label/wrong scale)
... Y-Axis - altitude curve not properly scaled
... use similar minimum scale for altitude like AllPlot
... attach Alt-curve first (to be in background)
(used/tested at HrPw window, Split Activity Wizard, Merge Activity
Wizard)
.. Strava now works on Windows, avoiding the QScriptEngine crash
.. the same approach has been applied to RideWithGPS, Cycling Analytics
Selfloops
.. commented out Garmin as its not supported yet
.. because QScriptEngine crashes
.. because QJsonDocument isn't available till QT5 and
we still make windows builds with QT4
.. because we're just processing small response documents
from Strava (and maybe others) that are NOT complex
This code has been snaffled up from Victor Laskin's blog
and is 100% Copyright (C) 2013 Victor Laskin (victor.laskin@gmail.com)
details available here: http://vitiy.info/?p=102
The code is slightly modified to fit in with GC and also to fix
some compiler nits; no namespaces, replace() removed as caused an
unneccessary stdlib exception and size_t used in a number of places
instead of int.
Need to be able to add parameters for users to adjust their drag factors
numbers currently work out not too bad for me but needs testing with
more ride files. I have tried it with Mark's Marmotte file and it
doesn't do too bad.
Please feel free to rip it apart and tell me it is wrong - its a good
start hopefully.
... be less restrictive for 'TextEdit' and 'LineEdit' field, jus set
'Read Only' to still allow mainly scrolling (which is otherwise blocked)
... mainly for 'Change Log' and 'Calendar Text'
.. if we cannot start due to permissions / create library folder
we now output a dialog rather than a qDebug -- this is better
for Windows or those that start from a menu etc
.. if the default athlete weight is changed then all ride
metrics need to be recalculated to reflect the new default
.. any cached values need to be invalidated so interval metrics
reflect the new weight (if needed)
It would be better for users to maintain weight either against the
ride in the "Weight" field, or via Withings !
.. attempting to fix the strava upload problems, this is
a set of changes to look at that, but not able to test
if it fixes the problem
.. also fixed the vomitlist of compiler warning messages
.. only show them on power plots
.. don't show text
.. make them /really/ faint
NOTE: This is because crank based powermeters (e.g. SRM) will send
calibration messages every time you freewheel for 3 secs or more and
modern headunits (e.g. Nav2Coach) will record and adopt them.
As you can guess, I have an N2C + SRMs and get > 20 or 30 calibrations
every ride with the latest N2C firmware, so this one is for me.
... the .toUTF8() conversion used with QT5.3.x to handle special
characters (e.g. german Umlaute) in column chooser does not work for QT
4.8.6 (at least not for the Windows) - as a result (Drag&Drop from those
fields into Columns or Search Field is not working)
... following the approach other places, changed approach to
"serialization" of the info for "Drag&Drop" - so work independent on any
QT conversions (which seem to depend on other conditions - change over
time)
... second part: 2nd part ("-Layout.XML") translation
... "Mapping Table generation" provided as a new LTMTool routine (to
avoid duplicate code)
... mapping to HomeWindow::restoreState(bool useDefault) for the LTM
Window type charts added
... metricUnit considered in getting the mapping texts for "unit"
... some more tr() (LTMTool, LTMSetting)
... for Lx/Hx in Time and unit "seconds" translation not working in
constructor, therefore moved to "initialization" for both HR and Power
(similar to the translated metric names) (HrTimeInZone, TimeInZone)
... in RC2 - Windows (name with "umlaut") not displayed in official
build (adjusted to be handled like the one name with umlauts already
defined)
.. previously we have computed below cp work as only that
work when power was at or below CP
.. since we want to track energy from CP and W' it makes more
sense to make below CP work include all work not from W' stores.
.. when computing W'bal decay -- since we know the half-life
for the decay we might as well use it rather than a pretty
big constant of 1 hour !
.. it saves about 35% of time to compute metrics
.. we can now drag and move the GProgressDialog around
.. if user hits ESC we trap and ignore it (otherwise it would
triggers a close event that causes a crash)
datacnt is 16bits so it overflows easily for large files (9 hours with
0.5sec recint).
I've also seen datacnt and block sum to be inconsistent in other cases.
To handle this more graceful, we're now taking the max of both counts and
let the EOF detection do it's job when one of them is wrong.
We do have to use one of these limits as some SRM files have junk after
their last chunk (so, just reading chunks till we get EOF retunrs this
junk, too).
code was blindly trusting datacnt... and kept reading past EOF. That's bad
as datacnt occasionally isn't matching the available data (overflow,
corruption, ...)
.. remove inverse time (but add support to Model for future reference)
.. fix x labelling for plotting Work
.. remove options for best shading, its now on or off
Fixes#924
.. it was accidentally omitted and somehow got lost and
never added back.
.. we now show w'bal in compare mode and its probably one of
the most interesting comparisons !!!!
Fixes#958
.. in an attempt to avoid the QT 5.3.1 QProgressSialog
bug and also put a bit of our own styling onto this
a GC implementation of QProgressDialog
.. it has no abort button DELIBERATELY
.. not tested on OS X .. yet
... some more AP/AM changes (hopefulyl the last ones)
... Setttings.h - the GC_DATETIMEFORMAT constant is not used anywhere
(old usages are de-activated)
... treat both Time & Duration equally (don't use QTime->toString), but
convert into seconds (since duration can be above 23:59:59 - especially
in Trends view
... table widget looses columns when dynamically adding columns in
Options->Metrics (fixed by setting columnCount to (0) first before
defining the new number of columns)
... when sorting first and adding new items, table data is partly empty
and when you next click on item GC dumps (fixed by de-activating the
sorting while refreshing the QTableWidget)
... date fields did not sort due to different formats strings used in
"toString" and "fromString" conversion / added info to translators
... duration and time fields did sometimes not sort (dependent on
time/duration having hours or not)
... sync all format strings for time input/output to 'hh:mm:ss'
... remove any 'AM/PM' time formats
... remove tr() commands from time formats (since 'hh:mm:ss' is
reasonable around the globe)
... main reason: QT5 does not follow the pure formatting rules any more
(like QT4), but considers the system.locale in formatting as well (so
for system which have no AM/PM, even if the format string is set, the QT
routines ignore that - having some side effect on GC)
.. now tested on Qt4 and Qt5 with VLC and NONE without issues.
.. but did notice a double include in GcWindowRegistry that has been removed.
NOTE: Still needs testing on Mac OS X
.. you can now select what kind of video widget you
want to build.
GC_VIDEO_NONE - No media support compiled in
GC_VIDEO_VLC - Use VLC (only on Win/Linux)
GC_VIDEO_QUICKTIME - Use Apple QuickTime (only on OS X)
GC_VIDEO_QT5 - QT5 video and associated backends (O/S dependent)
NOTE: This needs testing on non-Linux platforms.
... Font-Size for Header Texts increased to 10px (since the 8px font is
very ugly - at least on Windows 7) - since the Screen can be resized,
bigger header texts can still be read after resizing.
... show also METRIC_BEST if such a curve is available
... ignore METRICs which are not ride related (Estimates, Measures) in
the Ride Table
... add Text if such a Metric was ignored (so that User do not assume
this to be a bug)
.. segv removed caused by signalling configChanged when context has been
deleted due to all the mainwindows being closed
.. check for path being reset to blank as well as being set to a different
place.
.. its complicated .. basically, if a local directory exists it will
*always* be used for application settings.
.. when you run GC for the first time with a local Library/GoldenCheetah
then the HOMEDIR_GC will not be set as there is no config in there
.. the code checks this setting for blanks (but that fails because the
value actually returned is "0") and so the local library is set to the
value returned "0"
.. but the local library doesn't exist so it falls back to opening from
the default location but using config from Library/GoldenCheetah !
.. the next time you launch all this gets resolved and you use
Library/GoldenCheetah with the settings you set the last time.
Fixes#936
.. If you build with QT 5 then we now use the QT video widgets
instead of VLC for Windows and Linux
.. We still use QuickTime for Mac OS X
NOTE: On linux Gstreamer is used and therefore all the right
codecs and backends need to be setup for this to work.
On windows its more complicated as it depends how Qt
was compiled, see:
http://qt-project.org/wiki/Qt_Multimedia_Backends
.. no longer need to append 'GoldenCheetah' to the location
since on QT 5 the executable name is used, which is GoldenCheetah
.. by sticking with this we can rename the binary to use a different
location, which may be useful for testing
.. PM chart is deprecated, so when loading an LTM chart
with skiba curves is implemented instead.
.. we cannot easily add charts to the layout without refactoring
HomeWindow so have moved that out of scope
NOTE: The upgrade processing has not been activated -- but can
be once we build and issue our first 3.1 RC.
.. update RideMetadata to remove 'Default' color
if it exists and add 'Reverse' color
.. will also add 'TSS', 'Aerobic TISS' and 'Anaerobic
TISS' to the metric tab if needed to avoid FAQ #1.
.. getting the upgrade code going, this just adds new functions
for changing colors and themes and doesn't perform an upgrade
.. Part 2 will deal with W' and power.zones changes
.. Part 3 will deal with chart setup changes
... make window "minimumSize" - so that resize in case of many columns
works
... handle LTM_TOD when called from LTM-Chart (list the rides in the
hour, considering DateRange)
... consider HomeFilter and Search/Filter in result list
... also show Rides of only 1 ride is selected (since Rides contain
Date/Time) and the Metrics (which mostly are not part of the Summary
HTML)
... do not allow MouseSelection of only 1 Ride is shown
... some more tr()
.. wow, this has been there for at least 3 or 4 years and
never bitten us.
.. for some strange reason it bites when you have a 3d plot
in one of the layouts.
.. to reflect current code requirements
NOTE: there is a 'phantom' widget with the 3d window that
covers the left side of the chart bar and makes it
impossible to click on the summary button.
... generating HTML instead of Template File (to allow translation)
... considering the same Fields, incl. User Defined Metrics as Summary
Page HTML
... aligning Vertical Scroll bars + adding a little space between the
widgest so that Scroll Bars do not touch each other
.. when aggregating metrics across rides we were being inconsistent
with regards how we handled zero values; we sometimes included them
and sometimes didn't.
.. now added a metric method bool aggregateZero() that returns true
if aggregates need to include zero values
.. this has been implemented where averages are aggregated.
.. can see the total / average or bests for the date range selected
NOTE: Data Table mode is currently a bit broken .. need to revisit it
and fix it up, not just for ALL mode but also for Estimates
.. when averaging lr balance, pedal smoothness etc we now
ignore values when cadence is zero.
.. the zero values are not meaningful and skew the average to
render them almost useless !
.. basically where data is sketchy or doesn't have enough
representative efforts the model will produce lowball numbers
which are not meaningful and should be discarded.
This reverts commit 2fdc18b2c3.
Because we should correct at source (i.e. where the PD estimates
are being computed) and the fix breaks w/kg display because it
doesn't apply different limits for absolute vs w/kg values.
... use translated Metadata terms for Tree Dimensions (via Special
Fields)
... store the Metadaten information in Home-Layout.XML in "EN/Original
Language" and convert back/forth as needed
... fixed an issue, that Rides for a Cell are not selected in case the
resp. Metadata field is empty
.. don't rely upon ZDATA metadata, instead we add
a new 'present' field that contains the Data meta value
.. navigator defaults columns when they're all messed up
.. summary isn't so noisy when providing progress updates
.. some regressions in there (setting only saved on move)
.. will check the positioning and geometry are sensible regardless
of whether they come from appsettings or defaults.
... have the same consistent handling for (TM) at all visible places
... do not allow Translation of BikeScore (since it's a TM and might
cause unexpected behavior)
... Have (TM) sign everwhere visible - only in Searches just use
"BikeScore" as Symbol
.. LTM chart now has a 'use sidebar settings' checkbox
and will display the chart that is selected in the sidebar
.. as the sidebar selection changes the window will plot it
using data for the current date range configured / selected
.. part 3 will now come later to let you manage the charts from
the sidebar menu (it is already in the LTM tool).
Add preset charts to the LTM sidebar, and allow LTM charts
to refer to sidebar for config instead of the local config.
In this way we can have a chart that changes as we select different
charts in the sidebar and remove the need to have lots and lots of
different charts on the tabs.
But it still allows for the old way of doing things -- just adds
another type of flexibility -- for instance a user could add
charts with set date ranges but no specific curve setup so they
could havethis year, this month, last month charts that change as
charts are selected in the sidebar.
This first commit just adds the sidebar item, next we will update
the LTM chart to refer to it in part 2 and then in part 3 we
will add functions on the sidebar to manage the chart presets in
the same way as in LTMTool.
... sync handling of (TM) in all places and Do Not allow translation for
these terms any more, since it's a fixed term anyway - and there are
many dependencies (which outside EN create unexpected results). - in all
Texts/Fields use (TM) in HTML use the TM (special characters).
-- more testing in language other then EN still required - but so far
working fine
... and more tr()
.. but now a new format and the old ones will need to be
removed from the athlete directory on upgrade.
.. the new default charts.xml is exactly the same as the
old one, but in the new format.
.. but the read and write functions are so far out
of date that applying a saved chart causes a crash
.. so we need to fix the read/write functions for charts.xml
.. lots of work to do to clean this up, especially
keeping the presets updated when renaming is done.
.. also need to save away after changes.
.. also need to create a much better default set of
presets taking into account the more recent additions
such as Estimates amd Bests and new metrics
... allow/use only internal field names (delivered by Column Chooser) in
Data Filter expressions
... multipe tr()
(cherry picked from commit bc4164adab74dd82c0a0307d7d0fbb736f95ef0d)
!!! please check if this right way to do it.
... column names containing special characters (here greek "average"
sign) did not work in Drag&Drop (even though they should be part of
Latin-1 (after changing in Mime to UTF-8) not only the greek characters,
but also "TM" works without special treatment)
!!! is this valid for all platforms ?!!!
(cherry picked from commit b4d1a7d3041beec686c7262cfa65bac8cf6e2179)
... more tr() changes
... added comparison for both "seconds" OR tr("seconds") to all other
occurences found
... added "Lap" text for Intervalls imported in Garmin FIT format (this
is what Garmin delivers)
(cherry picked from commit ad790f05a386e3ae5c5b9dc129a216ac451b8cfc)
... Filter/Autofilter did not consider Translation of the Filter
Criteria - using Special Fields (to translate from internal to external
names is working for me - but do special fields cover all variants?)
(cherry picked from commit 5cc4218a2a0877a1f8ff4f36d1367bee37c34d2d)
... multiple tr() added for Intervals. Compare Pane
... in Compare Pane - in time metrics check for both "seconds" and
translated tr(seconds) (following the concept for time as at most other
places where units == "seconds" are checked
(cherry picked from commit 6c78b00b65a1d794eb99038f21d6e705d119d29e)
.. delta plot but with percentage rather than absolute differences
.. particularly useful for plotting PD curve by seasons and looking
at the gains/losses in percentage terms per season
.. also the differences in short and long durations in absolute terms
often look quite different, in percentage terms there is often not
a huge difference over seasons.
NOTE: Needs to be fixed up to do percentage differences by model.
.. apply Flat styling across all the widget painting
.. only use WHITE as the flat color for now, in part 3
we will look at user customisation and updating the
toolbar and sidebar buttons to also be flat.
.. refactor linear gradients out of the widgets
such as toolbar, chartbar, sidebaritem etc
.. GCColor::linearGradient() now returns a gradient
that is reused across the codebase
.. in Part 2 we will add a colour and flat style
for the linearGradient
.. in Part 3 we will tidy up the styling for buttons
and toolbuttons to adopt flat or metal styling too
... Translation for Season Types
... Do not allow Temporary Seasons to be edited or deleted through the
main seasons menu (in right click Popup this was already blocked by not
offering the function)
(cherry picked from commit cc7a0a7f8d0b74ca4b9d64d61291206ea58d3f94)
.. TRUE/FALSE are case sensitive on Mac
.. ride2Loaded renamed ridesLoaded
.. ridesLoaded initialisation moved to constructor
Thanks to Jorn for the fix to a P0 bug !
.. when using other languages e.g German it may be
useful to make it wider if needed.
.. the pane still appears using a minimum size that
we calculate, so should affect users.
.. the headings get resized as the mainwindow is
resized, when they shouldn't -- the sidebar is
getting resized twice - once on mainwindow
being resized and then our code fixing it back.
.. we now only set those widths on the mainwindow
when we are told to by TabView::splitterMoved()
.. a regression from the mainwindow refactoring
earlier this year.
.. when the mainwindow resizes the splitter should
stay at the same size on the left.
.. and making it easier to apply globally with a new
static member of TabView to return the style sheet.
.. we may extend this to cover the application more
broadly.
.. on Non-Mac platforms. It might be just me but the scrollbar
just looks horrible.
.. should look at a custom scrollbar that 'appears' when it
is needed (when scrolling or on hover?)
... Further enablement for translation
... some typo in EN (seen during translation)
(cherry picked from commit 50b78cec0f2fae40f9a5974d98e145d9d9d55535)
.. delta compare to use first date range as a baseline to
compare other date ranges to.
.. only works for the bests curve in date range mode
.. in part 2 will add the model and also rides/intervals.
.. its too far out of date;
the UX is terrible and flickery
its a cpu hog (deletes all objects on each replot !? wtf)
it doesn't honour colour config
it doesn't integrate with the sidebar date selection
the metric selection should be via a reveal control
can't hide the legend / set grid / use chart settings
should use a tooltip
doesn't work with compare
.. all these issues are resolved using an LTM based PMC
Fixes#880
...ConfigDialog.cpp
- -Increase overall size of window (for NON Mac only so far) - this
eases the translation as in non EN languages
... Pages.CCP
- Changed 2 fixed button sizes (to allow proper translation)
- Correction: if Directoy Browsing was Aborted without selection - the
previous value was deleted
- Chooses the 2nd column to search for "New" text in case of 2 text
colums (short and long)
- All the rest Translation enablement
...DiarySidebar.cpp
- enable translation of date formats
(cherry picked from commit 3bbc68a277e743e610630795bb60dc515ced0355)
.. all the recent work on the CP chart has focused on absolute
watts and not taken into account w/kg !
.. this fixes that up, but still need to look at w/kg on the
model parameters stuff for the CP history chart
.. the last piece of the jigsaw for the CP chart refactoring was
to use the new model class and remove the calculation in CPPlot.
.. we have now removed the ridefilecache out of CP, the model calculation
and refactored to support multiple models.
.. to include power, cadence etc
.. this is particularly relevant for colors that need to change
if we have a light background (e.g. power in yellow on white
is almost impossible to see for some people)
.. needs to account for font metrics and not just default
to 50 high. Only notice this if the user has larger fonts
which can be common on high DPI screens.
.. if you have user defined colors for the ride list but don't
choose to set as background (ITS UGLY!) then we put an accent
bar on the rhs .. which looks much nicer.
.. I guess its a matter of taste .. some don't have any ;)
.. by making the text Add and Delete rather than '+' and '-'.
I /really/ hate the way Qt enforces such an arbitrary rule
for button size and styles, when Apple doesn't.
.. aggregator will collect estimates
.. LTM will plot
.. but the model needs to be updated to reflect the intervals
are in seconds not minutes and the y() function is passed
seconds not minutes.
.. added to LTM and updated the default layout on trends view
to include a new 'CP History' chart with W', CP and p-Max
on it.
.. part 3c needs to update to include Damien's model and also
once thats done we need to refactor CPPlot to use the new
PD model classes instead of the code embedded in the class.
.. Now refreshing the model parameters is done and
stored in the athlete class.
.. added the selection of a model estimate to the
LTM chart
.. in part b and c we need to update the LTM chart
to plot the estimates (createCurveData).
.. the critical power models are now refactored to have a
base class PDModel.
.. I have implemented the 2 and 3 parameter models as well as
the veloclinic models
.. the ExtendedModel needs to be aligned
.. next steps are to put these values into a store and allow
them to be plotted on the LTM charts.
.. added the code to aggregate power data when deriving
model parameter history over time.
.. need to get a class that applies the various models to
generate the parameters we need (so we can reuse) in
part 2.
.. then need to store and turn into a metric of some kind
in part 3.
.. this is largely a checkpoint commit to enable cross platform
testing with Mac and Windows.
.. to extract just the meanmax power data from a ridefile cache
so we can aggregate and derive model parameters for new metrics
to track W', CP, FTP, max-Power.
.. see src/mac/Info.plist.app, based upon the default for
Mac with clang found in mkspecs/default/Info.plist.app
from the Qt installation directories.
.. we make our own to add build version information, which
should be placed there via the qmake 'VERSION' macro but
its not supported -- you have to edit the plist file instead.
Fixes#796
.. if users want alternative ranges, it is not for us
to enforce -- e.g. ignore zero for HR is sensible since
0 suggests loss of signal, not your heart stopped !
Fixes#815
.. needed symbol name to be unique as 'Weight' clashed with the
normal ride metadata field.
.. we now add _m to the fieldname to generate a symbol name for
measures.
Fixes#862
.. looking at the briefing from Mike on Youtube it looks
like an alpha value of 0 is a compromise between -0.1
and 0.1.
.. see the video here: http://www.youtube.com/watch?v=v57NRQ-pHps
"secs" is miscalculated for gaps between blocks: It takes the delta
between last chunks *END*time and next chunks start time - and thereby is
off by RecInt. This error adds up for each block/gap - so, the n'th block
will by off by n seconds.
fixes issue #582.
This reverts commit 80fee9d.
Since actually using showAlt, showBalance to determine if an axis
should be drawn is incorrect, since although the user has selected
it to be plotted, it might not actually be in the ride !
The real fix for this axis labels was fixed in commit 18bf28.
.. via a custom menu option on the chart menu (More...)
.. which means we also now have a mechanism for each chart
to add their own menu options to the More... menu
.. will no doubt need to add this to the LTM chart
.. no doubt we will extend and refine this but at least you
can select some basic prebuilt themes.
.. will need to add more as its a limited list but the basics
are in place for now.
Fixes#855.
Strava used other slightly other tags for it's gpx files.
Added those tags to the GpxParser.
Tested and verified.
As I don't have a Power Meter I can't verify Power is correctly imported.
Signed-off-by: Simon Egli <smn.egli@gmail.com>
.. we converted from metric to imperial TWICE for the labels
which mean't they were located correctly on the y-axis but
the label was always wrong !
Fixes#827.
.. was caused by the fact the allPlot height is not set until after the
first show, so it is zero in initial state. We just use a default value
in this case.
.. forgot to remove the threaded integrator which is no longer
needed and then found it is still being used by the minForCP()
method, so tidied that up.
.. implementation of the Veloclinic model, or at least
the first of a few potential models.
.. It may not be correct at this point, but committing
a checkpoint.
.. I know its a matter of taste, but some of the formatting in there
would win the OCCC competition. I mean FFS, who puts else clauses
after a ';' !?
.. the formatting probably reflected the different people who have
updated the code over the years.
.. no functional changes whatsoever in this commit -- just cleaning
the source code to make it more maintainable (and readable)
Using Andy Froncioni's modification to the original
formula that removes the need for Tau and also lets
the exponentials drop out.
Massive speed improvement!
I had a trainer file as the second file in my history. Opening this ride, and selecting the speed histogram made GC crash.
I narrowed it down to line 905 in src/PowerHist.cpp. The code was trying to do a resize on a QVector with a negative value. count was -7.
Making sure that count is always 0 or greater fixed the crash.
Note that opening another ride file, with speed information before this one, selecting the speed histogram and only after that selecting the ride without speed information, did not crash the application. I'm suspecting that there might be some resetting of values, perhaps in the "standards" arrays, that is not done when a data series is missing.
.. when you switch tabs to ride plot having never
displayed any ride at all.
.. also fixes switching to compare mode when the currently
selected ride is blank (has no data).
.. its in the viewport, which seems a common problem across
the Qt widgets, we need to be aware of the internal implementation
details when setting styles.
Thats a bit crappy.
.. Added the torque effectiveness and pedal smoothness
data series to the RideFile structures.
.. The only file formats that support it at this stage
are Fit and GoldenCheetah JSON.
.. As more file formats support it we will add it here.
.. The charts/editor now need to be updated to support
these new data series.
.. so at least chart adding should be easier and no more
UX issues.
.. need to look to add other menu options there; add page, athlete,
chart settings.
.. code lost and reinstated, need to write the code
to show the chart menu when it is clicked.
.. just pushing this code to get it back into the repo
as it was lost accidentally with some other recent changes
.. to GcSideBarItem.cpp as the code is very difficult to
follow. Not hugely valuable comments but they will at least
help to understand the purpose of each widget.
.. now has an overlay widget that can contain multiple widgets
and is user movable and resizable etc
.. we show the model derived values for now, but could add other
things at a later date (e.g. MU distribution etc).
Fixes#811.
The context pointer was dereferenced after the context object was deleted. This is fixed by storing a pointer to the MainWindow in QTFullScreen, so context does not have to be dereferenced.
The logic in QTFullScreen::eventFilter is also simplified a bit.
.. by checking the ride file CRC before recomputing
either the metrics or the ridefilecache.
.. this means that users that routinely copy or backup
or use dropbox to keep things in sync won't see any
unneccessary metric computations.
.. I added a CR to the end of the LINUX build document
just to be able to test push/pull/fetch/cherry-pick
across a number of different repositories
.. this is just for testing git, no functional changes
were made at all.
.. fixup ride mode, interval hover crash/bugs
.. fixup interval compare mode
.. fixup rangemode
NOTE: Compare date ranges is still broken that
will be fixed in part 3.
.. basic ride, bests and model plots all working
.. Compare mode is now BROKEN !
Will fixup the rest tomorrow, needed to checkpoint
the core refactoring work.
.. the CP plot curve is a terrible mess. Mostly from
having multiple significant updates from a number
of notable developers; Sean, Dan, Mark and Damien
have all made significant contributions.
.. But the code contains lots of 'smells' and is very
difficult to follow and update
.. this update makes no functional changes but is put
in place before overhauling the code related to
"calculating" and plotting the different curves.
.. metric of the aerobic-ness of a ride based upon the
ratio of a-TISS to an-TISS.
.. bear in mind the curves for a/an TISS are being looked
at as we speak !
.. mark the center of an interval (i.e. the average aepf/cpv
for that particular interval).
.. this is in preparation for mouse over the interval causing it
to be highlighted on hover.
.. when showing the ride as a percentage of bests on the CP
chart we need to adjust the scale when its > 100%.
.. this can happen when comparing a ride with a bests chart
for a period the ride was not part of; e.g. todays really
strong ride vs my bests for the beginning of the year.
.. hover curve clear on new ride
.. fix ride plot mode so when plotting ride it always
does. This was fixed by initialising ridePlotMode in
the CpintPlot constructor.
.. last piece of the jigsaw for compare mode. This update adds a
clear button to the compare pane bar.
.. we can still add lots more to compare mode, but for v3.1 this
is probably enough now, so closing the feature request too.
Fixes#343.
Added a few new training stress metrics whilst discussing
and working on a multicomponent view of training stress.
This is all a wip falling out of discussions around stress
metrics beyond the old TSS/BikeScore models.
For now this just includes;
1. Aerobic Training Impact Scoring System on PM/PMC
2. Work (Kj) above/below CP on PM/PMC
3. Aerobic TISS on the Ride Plot
There is lots more to come; specifically around Anaerobic TISS,
looking again at polarised training and personalised training stress
based upon the individual's CP model.
.. to indicate which power-durations are getting worked hardest
.. Calculate a 'heat' score for the power duration curve.
A score that counts how many rides in the aggregate
have a power-duration best that is within 10% of the
best value calculated.
.. next step is to add it to the CP curve (when showing
power) to provide some kind of shade/heat indicator
for the area of the curve.
.. when user changes the background color for charts the
legend can be difficult to read as it is always in black.
.. we now update the legend and it's widgets to change the text
color when the chart is refreshed.
.. Further updates to the charts to honour the background
color preferences:
* Google Maps
* Ride Summary
* Scatter
* Details (Metadata)
* LTM Data View
* Editor
.. still a few left to do and not entirely happy with how
things look on the editor but we can fix this up over
time.
.. Only tested on Linux
.. Now going to check on Mac and Qt5
.. Also does not yet support re-ordering tabs
nor scrolling when there are too many to show.
This will come in future updates.
.. not because it was a bad idea, it is a great idea.
.. we need to replace the tabbar with a scopebar and
customise it for the view menu and support scrolling
left and right.
.. will sort this weekend
.. The UI spacing is a bit 'old hat' and not really in line
with modern UI's -- so reducing the amount of unneeded
spacing between widgets.
.. There is more to come on this, but for now this means there
is a little more screen estate for the charts.
.. need to think about what we're trying to achieve with this
but for assessing TT efforts we can see how far away from
a constant load the ride was.
Its just computed as average power as a percentage of max power.
.. When interval tree is rebuilt it can cause an issue in the
ride editor when clearing the selection model.
.. still trying to get to the botton of a SEGV on Mac.
.. simplified acceleration calculation to convert to m/s before calculation
.. removed distribution for deltas as they were HUGE and introduced a
terrible performance degradation where aggregation took >30s for a
ride set that previously took <5s.
.. Following on from the recent update to add acceleration
this update adds other derived data series based upon the
rate of change.
.. Added to the ride plot and the CP plot.
Not sure of the overall utility of these updates but bear in
mind that they are targetting sprinting and track users and
analysis.
As well as the positive side of this (development of power
cadence etc) we also want to think about and collect data
on fatigue rate (possibly only power and torque)
- fatigue over time
- fatigue over pedal stroke
.. slider removed as it was ugly
.. handles are placed on the same side as the axis
being manipulated, since its irritating to click
on an axis then have to move mouse to the other
side of the chart
.. When you click on the axis to isolate it a spanslider
appears to let you manually adjust the axis.
.. it looks naff .. but we can tidy that up separately
.. Fix polarised zones being ZERO when recIntSecs is
sub-second (e.g. 0.5s with an SRM).
.. the polarised zones were being updated to hold time
rather than a count of samples. This was fine when
recIntSecs is 1s but a problem when it was 0.5
.. because is is an integer!
.. if you are building with QT5.2.1 or higher we are no
longer going to use VLC for video playback.
.. the QT Multimedia module seems to finally have made
the grade and works as advertised on Linux and Windows
.. FOR NOW we will continue to use QTKit on Mac but that
may also change soon.
This is to enable overlays -- placing the video behind the
charts etc.
.. when plotting in zones its helpful to have
data labels to show the percentage or
absolute values each bar represents rather
than having to hover over it.
.. the calculation assumed 1s recording (or was just wrong)
joules are now calculated properly, this is especially
important for SRM recordings of 0.5s samples
.. the with zero option didn't work with polarised zones
and there was a silly bug with the settings being applied
after the setData() call which mean't they were ignored!
.. now can show in zones but using the polarised zones
rather than user defined zones.
.. we may need to revisit this since it uses zone 2 rather
than estimate LT1 from CP.
NOTE: The compare mode needs updating to support this option.
.. if you build with qt 5.2.1 then the unified title and toolbar
is back, but its a hack to just change the gradient and use a
standard toolbar .. so we do that, but make the colours match.
.. the series plot has no yLeft axis yet the plot picker
is always attached to it.
.. Since we do ALWAYS have a yLeft,2 axis for the highlighter
I've attached the picker to that instead.
.. This should hopefully stop the SEGV in qwtplotpicker::updateDisplay()
.. Will watch and monitor
Rather than skip over the 'standard' interval markers because they
have such verbose names we now plot the vertical marker only.
This is to indicate there is an interval at a particular point to
signpost to the user that they can hover over this point to get an
interval summary.
When hovering over a ride if there is an interval that defines
the entire ride (typical if coming in from WKO+) then don't
hover highlight it, since it is distracting and adds no value.
.. As you mouse over the ride plot it will now highlight
the shortest interval that that point is within.
.. If an interval has been selected in the sidebar it will
refrain from hover highlighting as it is distracting
.. Also fixed up the way the highlight curve works so it
has its own axis and works regardless of the data series
selected.
.. reset isolation when resetting curves etc
.. added a visual cue by dulling the axis scales to grey
when isolation is active -- to let the user see what
happened when they moused over an axis.
.. we SEGV when they are removed and we use the new
'isolate' curve mechanism to hide/show curves
.. also now keep a track of the reference lines in the
CurveColors class
.. we now isolate a curve temporarily with a click on the axis
so you can mouse over / look at the curve on its own
.. it would be good to also 'dull' the other curves and their
axis labels so we have a little context .. will look at that
next .. it might not be so 'clean' though.
.. show event and season markers on the compare plot
helps to provide context against the week/month offsets
.. also fixed up how bars are lined up and that each plot
in the compare stack has the same x-axis
.. always hide the meaningless legends for trend, outlier
and best curves since they are the same color as the
curves already listed in the legend.
We should apply this to the normal view too.
.. the trend view layout default has been updated to reflect
recent updates to the capabilities of the charts, notably;
* Data Table to summarise recent key markers / indicators
* Data Labels on charts where appropriate
* Color scheme slightly altered to plot more appropriately
when in compare mode (less contrast, less vibrant palette).
You can now compare seasons / date ranges across or between
athletes on the LTM charts.
This is only shown on the stack chart as we need one chart
per data series - in a similar vein to the AllPlot chart.
There are some tidy ups left to do over the next few days;
- Data table needs updating to support compare mode
- Event markers need to be shown and in the right color
- PMC curve data is slow, needs some kind of optimisation
- The tooltip is missing and needs to be put back
- Ensure the new stack frame looks correct when using a
dark plot background (or anything other than white)
- Consider how to handle zooming when there is only one
data series and hence only one chart for compare
.. mostly in preparation for compatre date ranges
on an LTM chart, but also for plotting lots of
values at once without having too busy a chart.
NOTE: Need to sort out tooltips and optimising the
refresh as well as making it possible for the
user to set the plot height like in AllPlot.
.. to use uname not name and also to avoid duplicating units
when they are the same as the metric name (e.g. the metric
'Relative Intensity' has units 'Relative Intensity').
.. show the metric data as a table as well as a chart, its quite
useful to configure a summary table of metrics.
Ironically, the ability to configure the summary page in WKO+ was
one of the things that pissed me off and started me down the road
of extracting data from .wko files. I then found the data I wanted
wasn't even in the files and started developing for GoldenCheetah
.. the rest, as they say, is history.
.. No more cutoff of the decay. Since we use threads its
not such a big deal as before.
.. We now get a full, smooth decay till the end of the ride
which was much more noticeable when predicting W'bal for
a workout, than it was for a ride.
.. to save on computing cost the W'bal decay was only
calculated to 20mins and also bounds checked to a
decay of 0.1w, but of course, the decay is more like
25 minutes and 0.1w * 1500 samples is a lot... so
I've removed them.
.. the key optimisation is the way the decay is integrated
and that is skipped for samples where W' exp is zero ..
that optimisation reduces the amount of computing cost
to 25% of doing it for all samples.
For maximum W' capacity expended i.e. Min W'bal
expressed as a percentage of W'.
So if W' is 20 kJ and W'bal is 2kJ then 18 kJ
have been expended, which when expressed as a
percentage of W' (18/20 %) would be;
Max W' Exp of 90%
I also cleaned up a few extra instances of WPrime
being created when calculatinf metrics which was
not a big deal for the Metric refresh but would make
interval metrics painful.
.. if duration is overly large we don't want to get some
massive array, it will exhaust heap and cause a crash ..
and it is likely to just be bad data.
.. don't be so keen to add zero values interpolating gaps
in recording when the gap is less than 2 samples wide.
.. previously we were adding way too may zero values at
subsecond intervals that caused an interpolated value
returned by the spline to be /practically/ zero.
.. offset needed to be a double not an int to ensure
we handle recording gaps from powertap etc where
it is not an whole number of seconds
.. Thanks for Armando Mastracci for highlighting this
and providing a test file to recreate
Fixes#773
This reverts commit c0b38a193c.
It has introduced errors on Mac and Windows -- we need to better
understand why this is not the case on Linux and whay /exactly/
it is doing that helps on the other platforms.
.. just speeding up the autosolve by only looking in increments
of 3w, should speed up by a factor of 3 but will mean the result
is correct to +/- 3w .. which given the W' is usually only right
to +/- 2kJ should be about right.
.. don't rely on WPrime to compute it, its pretty simple
to compute as long as CP is set
.. add to the summary totals so always there to compare
against the total work
.. the optimisation was a little eager and took out
the integration step !
.. access to PCP is now hidden behind a function so
it is only computed when neccessary.
.. the calculation is still significantly faster than
the old one but not as instant as the non-integrating
version (but then it wasn't working either!).
.. on ride plot, when W'bal is plotted we put a mesage to say
that CP is wrong, and autosolve for W'bal to zero.
.. this patch also optimises WPrime to make it a member of the
ridefile class and this always available (even for intervals).
.. fixed a SEGV when computing metrics for intervals by shifting
the timestamps to always start from zero.
Instead of just reimplementing the spreadsheet we now
implement according to the original formulas as defined
in the W'bal paper.
This means there is no longer a 1200s limit to the decay
which was not part of the original paper.
We should be able to add some W'bal metrics now.
.. SEGV caused by referencing data->isChecked when
not in range mode
.. Speed plotting broken because line setting the
array length in setData was accidentally deleted
.. on the histogram charts when comparing multiple
intervals we group using a golden ratio to make
it easier to read.
.. this is less about the histogram and more about
establishing the aesthetic in time for the LTM
updates for compare date ranges.
.. remember we can plot for a season and recognise that
when checking for isCompareIntervals in PowerHist.
.. fixes a SEGV when looking at a histogram in the trends
view whilst compare intervals is active in ride view.
.. still needs tidying up for some combinations of show/hide
tab switch and adjusting chart parameters but is 99% there
.. still need to apply the same compare update for when comparing
seasons not intervals
When an interval is added to the compare pane we now
compute the RideFileCache so it can be re-used in the
Histogram and CP charts without computing it each time.
The 4 views have been shown to be confusing -- it is not clear
to new users what their purpose is, and hence how or why they
are different.
So in an effort to reduce the confusion I've renamed a few
things to be much more explicit and specific.
.. We embrace the fact we are a cycling program and use the term
RIDES not ACTIVITIES for all files
.. HOME is confusing, renamed to TRENDS
.. the ANALYSIS view name is confusing, its all about ANALYSIS
to renamed to RIDES
There will no doubt be areas that are not renamed properly we
can fix those when the arise.
.. don't signal when adding a ride, which kicks off
all manner of updates across the code, instead
we let the metric refresh kick in at the end.
.. this is great for an initial load and mass import
of large numbers of rides, but sucks for a small number
of rides when maybe downloading
.. we could make the signalling dependent on the number of
rides being imported, so small number still updates the
CP charts etc.
THIS IS A TEMPORARY FIX TO THE MORE SIGNIFICANT PERFORMANCE
ISSUE -- BUT WE DO NEED TO CONSIDER THE ISSUE OF CHART UPDATES
.. amazingly there are still some constant values we have
not seen before. This time from files provided by
Patrick McNally.
.. optpad values we have seen now range from 0x8007 through
0x801a and crucially with only one value missing 0x8008
.. its just a matter of time before we see one of those :)
.. we should actually paint a zoned background if
power shade zones is selected, when in compare mode.
.. but /only/ for charts that have power on them!
.. tweaked color sequencing in compare to avoid using
red/green as it should be avoided -- red/green color
blindness is relatively common.
.. this is just a hack in the absence of a good algorithm
to generate distinct hues automatically.
.. silly typo mean't allplot was being used as a refrence
when generating plots instead of fullplot
.. this manifests itself as using the wrong plot for the
'bydist' boolean -- this is fine, unless you switch
between by time and by distance whilst in compare mode.
.. I deleted the lines that actually call the data
processor when I was refactoring MainWindow.
.. this must have been an accident as there is no
possible reason for just deleting the code!
Fixes#747
RPMs needed libsrmio installed which is not available.
Change to compile against a static build of libsrmio.
Changed install instructions to use "yum" so dependencies are installed.
.. if you selected a ride and viewed on allplot then
changed tabs, entered compare mode then switched back
to allplot the display didn't get refreshed.
Array bounds checking used a double which is susceptible
to rounding issues, or at least returning values a tiny
fraction over an integer that when converted add 1.
e.g. 10.000000001 -> 11 when converted to int.
When comparing it is possible to compare across
athletes; e.g. their 2013 season vs my 2013 season --
which means we need to use the sourceContext for any
items when aggregating / fetching the data.
Basically to distinguish between the four modes
and only show what you are asking for;
* rangemode + normal - the currently highlighted season only
* rangemode + compare - the compare pane seasons only
* ridemode + normal - the current ride and left pane intervals only
* ridemode + compare - the compare pane intervals only
.. same as the normal interval display glitch.
That was caused by appending to an array that was
already resized .. making it double the size and
prepended with lot of zeroes!
Fixed a few nits that have come to light over the last
few days as lots of new features were developed.
* Fixed interval glitch where first point is zero, caused by
an off by one error in the original code
* Fixed interval creation which also had an off by one error
that mean't 5s curve was only 4s long
* Made the shading under an interval optional, as it is a bit
nasty and was there to hide the glitch in point 1 above
* Made the interval line solid, not dotted, as it looks much
better that way -- especially now its used for compare mode
* Made the title red by implementing isCompare() when in
compare mode.
* Fixed a crash on hover in season compare mode
.. if the user sorts the compare pane contents by clicking
the header the order they are stored is changed too.
NOTE: The table sort is broken since it is alpha not numeric!
This needs to be fixed too.
.. if intervals or date ranges are not checked in the
compare pane then we shouldn't summarise them
.. also fixed up compare pane so first entry ie. what we
are comparing to is always checked.
.. Connected the compare mode on/off switch in the
compare pane to Context to notify charts
.. the scope bar and chart painting now highlight in
red when compare more is active and supported by
a particular chart.
.. each chart must implement isCompare() to return
true or false if it is supporting compare mode.
We /still/ do not have a mechanism for clearing or
reordering items in the compare pane, nor a mechanism
for choosing 'delta' compare (i.e. baseline all compares
to first item in the list).
Fixed up to make the toolbar on a build on QT5 look a little
more like one on QT4 where they still have unified toolbar
and title support.
We should look at managing via the native NSToolbar in the
near future since Digia have made it clear that they are not
keen to reintroduce unified toolbars in QT5.
.. now can drag and drop any date range onto the
home view compare pane to compatre different
seasons, and even across athletes.
.. we setup the metrics and measures in the context
so the charts don't have to, but we still need to
reference the source context for bests and ridefilecache
data
NOTE: We need a mechanism for 'locking' source tabs/athletes
when they are part of a compare to avoid crashing when
a context is deleted whilst we are comparing
NOTE: We till need a way to remove entries from the compare
pane, possibly call it when an athlete is closed too
(see note above).
.. should be ok to drag and drop a standard
date range as well as a season definition
.. pass across the start, end etc to avoid having
to dereference from the source context
Now allows you to add intervals and select them and
change colors they will use.
It will maintain the data as a CompareInterval which
also includes a RideFile representation of the interval.
This is stored in Context in a QList as compareIntervals
and can therefore be re-used across all charts.
We now need to think about putting some widgets onto the
Compare 'bar' for turning compare mode on and off and
deleting / reordering / clearing items.
.. this allows us to drag and drop between athletes or
to switch athlete if dropping from outside of GC.
.. also added context to the mime data so the compare pane
will know where the dragged object has come from (ie. it
may be from a different athlete).
.. to give a visual cue as to what is happening, since it
can feel like GC has 'hung' as it loads.
.. this is especially important now we open tabs in an
existing mainwindow.
The delay between clicking open and the tab appearring
needs to have a visual indicator that something is
actually happenning.
.. the save dialogs all assumed the current tab
and current context were relevant when checking
for unsaved files etc, but this was INCORRECT.
.. when window is closed each tab is checked IN TURN
so the context should have been passed (because the
current tab/context is just one of the many to save)
.. only needed when we have >1 tabs so lets hide and
show it automatically.
.. also added a setting for remembering setting but it
doesn't do anything as we auto hide/show.
The final part (and one of the reasons) for the mainwindow
refactoring -- we now support tabbed athletes rather than
having a new mainwindow for each athlete opened.
Context is saved/restored and there are new functions for
opening and closing tabs and windows of tabs.
The tabbar itself is fugly -- the next few days will spend
some time looking at making it prettier on Linux/Win and
more native on Mac (see MMTabBar).
Gareth's build system baulked at the stackZoomWidth
class member defined as const in the class declaration.
Moved to a static member of AllPlotWindow.cpp instead.
We have two new mime data types;
application/x-gc-intervals
application/x-gc-seasons
With packing routines into QMimeData declared
in IntervalTreeView and SeasonTreeView.
To get around an issue with overwrite mode on
drag and drop from the seasons / interval trees
we DO NOT ACCEPT the drop (even though we do
actually process the data).
All we need to do now is unpack the QMimeData in
ComparePane and then add the GUI elements to it etc.
.. it was a bit shit with controls you couldn't
use, and when you did nothing happened.
.. now has a slider and 7 distinct settings for
stacks from ok to large and 5-60 mins sections.
.. should be good enough for most users.
Finish off the nits and missing pieces for the recent
update to enable plotting in a stack by data series;
* Now plots W' bal, LR Balance and headwind
* Stacks are now redrawn when settings change
* Interval marking is fixed
* Baseline is now set correctly for each plot
* Reference lines are plotted (on power plots only)
* Reference lines can be dragged
* Interval markers are not redrawn with the text
only shown on first plot
Extending the stack display to have a single plot for each
data series. This will be useful when comparing activities
and also makes it a bit easier to see the data when there
are lots of data series.
This is a checkpoint commit as I need to fixup some of the
series that have multiple curves and also reference lines
are not currently working.
But you can zoom using the fullplot and highlight intervals
etc.
This reverts commit 20739ebb29.
Qt5 has a number of issues that cannot easily be resolved.
An alternative strategy of developing a custom cocoa control
for the mac toolbar is probably a better way forward.
.. let the user choose metadata texts to filter
by value in the sidebar.
Note there are issues;
1. the value lists are not updated automatically when
rides are updated or imported and values are added
or removed.
2. it only works with shorttext metadata fields, we might
choose to add numeric etc later.
3. it would be nice to get an indication of how many
activities contain the value and maybe even sort
by count.
.. now allows the user to select the type of trend
line for a curve, only two options at present;
* linear (linear regress)
* quadratic (quadratic lsm)
..was experimenting with fewer and more points on the trend
line and accidentally committed it alongside the changes
to fix the LTM axis scale setting.
Added a quadratic least squares trend line for the LTMplot
as the linear regression was generally too blunt.
This is a hack to get the code into the repo -- will know work
on refining the LTMPlot settings to enable users to specify
the kind of trend line they want.
The new trend line might also be useful for other curve fitting
functions (e.g. realtime virtual power curve, a peak power chart
by cadence/pedal speed).
Looks at the max and min (non-zero) power values and
uses the difference between them to calculate a fatigue
index as a percentage.
i.e.
FI = (maxP - minP) / maxP * 100.00;
This is really only useful for targetted intervals as for
most riding there will always be a period of time where
the rider coasts or takes it easy.
We may look to improve it by smoothing or comparing to the
average power instead of minimum power.
.. broken on All Dates selections.
It must be time to introduce a polynomial fit or somesuch
as the linear regress is a little simplistic for most cases.
Similar to fixups to CP plot for user defined plot backgrounds
this update updates the PfPv plot to also re-use the user prefs
when setting axis / canvas and marker colors.
The recent filter bar in home view was coded without taking
into account the fact that LUCENE is an optional build component.
This caused builds to fail when LUCENE wasn't installed.
Reverted the update to the QWT 6.1 code to make QwtPlot::canvas()
return a QwtPlotCanvas -- it now returns QWidget.
This means our local copy of Qwt is the same as the published version
so we should be able to stop maintaining our own copy when Uwe pushes
the multiaxis stuff with 6.2.
Also fixed the LTM tooltip - the zoomer has been removed.
Now hide/show appropriately and are painted correctly.
There is still a problem with the x-axis disappearing
but this should be straight forward to resolve.
This is a regression to remove the metric translation
functionality from LTMPlot.
WE WILL REINTRODUCE BEFORE RELEASE!
It has been regressed because;
1. It crashes on QT5 with Win32
2. It has significant performance penalties;
It really should not instantiate an LTMTool object
(Ale did discuss this with me and I gave it the go
ahead, so my bad).
3. It should be executed on applySettings() not on
each refreshPlot().
4. It has a bug regarding uunits being lost and breaking
sharing of a common axis.
New strategy to enable build on QT5 or QT4.8 is quite
simple to enact as most of the fixes for QT5 can be
applied to earlier releases.
This patch fixes up some of the special cases for QT5 so
they will continue to build on earlier releases.
Fixup crashes and major issues created by porting
to QT5. These have included;
* Fix CP plot log scale
* AllPlot axes and tooltip
* DBAccess prepare/bind bug
* LTMSettings crash
* LTMWindow zoomer/picker crash
* LTMPlot axes hack
There are still issues remaining but we can start
working through them at leisure -- the product now
builds and runs.
Fixup all the GC code to use the QWT 6.1 code.
It needed canvas() to be patched to return a
QwtPlotCanvas and not a QWidget.
We could probably get round that with a cast.
When we switch to QWT 6.2 with the multiaxis
support formally baked in we can fix the code
as needed.
Now compiles and links without issues.
Porting the codebase to QT 5 (5.2) to get the
latest bug fixes, performance and improved platform
support.
This first part is to fixup the codebase to compile
on Qt 5, but some aspects have been broken (video).
The second part is to migrate from Qwt 6.0.1 to the
latest Qwt for multiaxis support.
The third part will be to fixup any platform specific
issues or issues identified at runtime.
If you change the plot background to black then the
CP curve is always in black too so becomes invisible.
Added a customisable color for the CP curve and fixed
up a few redraw issues in CP and Ride plot when you
change the colors.
Still need to fixup the other charts, but will do over
time. I suspect almost noone changes the plot colors from
the default values.
Let the user define the lowpoint for stress balance -- this is
so we can highlight or alert when they go below.
From a post-hoc perspective it is useful for identifying where
they went too low, but also for planning it helps to stop
planning to fail.
Will update the LTM chart to highlight it alongside SB metrics.
A bit of a compromise since really we should move the
stress calculators to the Athlete class and reuse when
no filtering is applied.
This code fix just means the SC is not recalculated for
each of the individual curves (LTS, STS etc) and pretty
much halves (or better) the time taken to refresh the
LTMPlot.
For those with very few rides (<500) this isn't much of
an issue, but for some with lots (2000 or more) it can
be quite tedious.
.. part of the refactor of mainwindow saw the sidebar
sizes independently set and therefore using different
settings.
.. we now use the old setting if first time through, or
if first time run for athlete set a sensible default.
.. if the compare pane is automatically shown or hidden
due to the user dragging and dropping the menu and toolbar
got out of sync with the status of the widget.
.. compare pane now appears and disappears on both
the analysis view and home view
.. it also is notified of drag/drop events and can
accept the objects dropped
.. it is now time to write the widget for collecting
and managing compare sets
.. when building a debug build of GC with CONFIG += debug
then we define a macros GC_DEBUG.
.. main no longer redirects to goldencheetah.log if you have
GC_DEBUG set, so developers will continue to see debug
messages on the terminal output (for mac/linux only).
.. we could use the GC_DEBUG macros to allow debug messages
to be switched on / off in the code in future
.. now the compare pane will appear and disapear
when the user drags and interval / season into
the view.
By fixing the way we handle QDragLeaveEvents in the
code in TabView.h ViewSplitter.
Introduce an hpos property on TabView::mainSplitter so we can use
an animation to make the compare pane slide up and down when
arriving and leaving.
Will add the animation shortly, just pushing to save updates.
Recent update to change the way the LTM configuration dialog
worked accidentally lost the events setting.
Show events is not being stored in the LTMsettings 'datastream'
but as a separate chart property -- but *is* stored internally in
the LTMSettings class.
it was being lost when the datastream is appled. This fix makes
sure the value is remembered and reapplied after the settings are
applied.
.. we should make it possible to display interval
data aligned via the altitude or gps data as well
as via time/distance. This really only applies to
the ride plot.
.. set to 3600 not 360 (!)
.. updated intervals causing warnings when using values
that were half baked. Now delays recalc() till all
the parameter intervals are set.
Jusst jotted down thoughts about implementing compare in v3.1
and added to the documentation folder. Will try and get some
mockups sorted too in the near future.
.. don't use toLatin1() and fopen, use QFile and full QStrings
so we can support directory names with unicode characters.
.. add unistd.h for dup() and close()
Now accepts --debug to disable redirection of stderr to
goldencheetah.log, which is handy for developers.
Also refined the way the command line is processed to enable
new arguments to be added in the future.
In the home directory of GC (platform specific or configured
by the user). This is only relevant for OpenBSD, Linux and Mac.
Windows does not support applications that are GUI and console.
The CP chart model defaults are set before the spin box step
min and max values are set, which means that the value is always
reset to 100.
Since the vast majority of users will not be aware of the settings
and/or will never think of setting them to their own 'preferences'
it is vital the default is applied correctly.
Now allows:
$ GoldenCheetah [[directory] athlete]
$ GoldenCheetah [--version|--help]
$ GoldenCheetah
Passing the athlete on its own is as before, but you can
now also pass the folder name in as well.
I've also added the option to get a help message if you
pass --version or --help.
Lastly, as before, with no command line paramaters you
open the last athlete worked on.
Since we now output the version and build info I have uplifted
the build and version numbers in GcUpgrade.h to reflect the fact
we are now developing v3.1.
When closing down we left the training database open
and this caused problems when looking to implement
a restart function.
The problems stemmed from the way the QSqlDatabase
code was implemented in TrainDB which was modelled on
code in DBAccess that was cleaned up subsequently.
TrainDB code now mirrors the approach taken in DBAccess
and relinquishes resources correctly. The TrainDB is now
closed as well as being opened in main.cpp at startup.
Also, removed reference to obsolete dbconn member in the
DBAccess class definition since it is no longer used.
Allow the user to select a directory to use for the
athlete libary. Leaving it blank will continue to use
the default location (dependent on platform).
If it is changed the user will be asked to confirm
and then GC shuts down.
Restart wouldn't work due to issues with the DBAccess
QSqlDatabase connection (which is really annoying). I
will look into this as a restart option would be much
cleaner.
Its only taken 4 years to implement this feature! (ouch).
Fixes#282.
.. accidentally left at 0s now corrected back
to truncate at tau for the 2 parameter model
and set to 25s for the 3 parameter mode where
it seems to breakdown.
Let the user define whether to use a 2 point or
3 point model (Morton et al).
In addition, let the user define the interval durations
to use; by default we set to 3 and 30 mins.
For estimating CP against good, recent data both of these
models are more than adequate for the purpose.
We'll just keep kicking the can down the road whilst we
can rely on published, verified science.
DJ Connel implemented a 3 point model, after Morton,
which was erroneously removed in a prior commit.
Our thanks to Andy Coggan for pointing this out in a
recent webinar. Nice to know he is following us closely.
.. don't refresh when not visible!
This is a side effect of the code updates added
to handle filtering in chart settings or the global
search/datafilter box.
.. another method for find intervals to find the ascents
in a ride. Uses the hysteresis as defined in options
which means a climb ends if there is a descent of that
or more (by default only 3m).
.. you can now choose to remove reference lines in the
allplot when you double click on the axis.
.. we might want to put the table and buttons for deleting
references into the chart settings too (?)
Too much going on and gets noisy, especially in stack mode.
Might extend this to the other plots, but need to live with
it for a while to see if the ticks were actually useful (!)
So you can unzoom in ride plot when you've zoomed in
to an interval -- avoiding having to show fullplot to
do the same thing manually.
There are probably other places to add functionality
for zooming out, will deal with those as they arise.
Added auto finding matches in Wprime, but there are
two areas to develop further;
1. Use the W'bal data to find matches instead of the
power above CP (which is really being used as a proxy
for the better approach).
2. Update the 'find intervals' dialog to allow you to
find matches and add them as normal intervals.
Pushing to repo as a version checkpoint, this function
will definitely need refining before 3.1 is released.
You can now plot NP, xPower and aPower on the
ride plot.
This has been done to provide transparency &
insight into the relationship between the derived
values and the recorded power values,
Peak aPower durations now computed and cached;
* updated RideFileCache to work with aPower
* CP curve now allows you to plot aPower
* LTM plot allows you to plot aPower peaks
* DataFilter allows 'best(apower, duration)' function
Added comment in ridefile.cpp to reference the book
and research paper that aPower is based upon:
// Calculate derived data series, including a new metric aPower
// aPower is based upon the models and research presented in
// "Altitude training and Athletic Performance" by Randall L. Wilber
// and Peronnet et al. (1991): Peronnet, F., G. Thibault, and D.L. Cousineau 1991.
// "A theoretical analisys of the effect of altitude on running
// performance." Journal of Applied Physiology 70:399-404
Added an average aPower metric.
I also and found and fixed a couple of bugs along the way;
* intervals create a ridefile and need to explicitly call
recalculateDerivedMetrics()
* the aPower calculation was using the calculated vo2max
percentage the wrong way around (!)
Introduce altitude adjusted power 'aPower'.
This is a new ride data series that takes into account
the effect of altitude on power output.
At present we are only adding this as a derived data series
with the intention of making it possible to plot it on
the ride chart.
We will also introduce alternate metrics for average power,
bikescore etc that are based upon the aPower value.
Calculate NP and xPower as a data series so we can
plot on the ride plot.
Have also added 'aPower' which will be coming in the
next few days - altitude adjusted power, which will also
have some associated metrics (a-xPower, a-NP, a-TSS etc).
In preferences->athlete->power you can now set
your W' in joules alongside your CP.
This is also available in the new cyclist dialog
which also defaults to 20Kj.
Fix 1s smoothing to ensure time doesn't go backwards
as when the same timestamp is used more than once the
QwtSpline used to interpolate returns all zeroes.
The implementation set tau to a constant when it
should be derived from the recovery power across
the ride.
I've also added tau to the chart so you can see
what value has been derived.
It TREBLES the amount of time required to refresh the
metrics, so will need to be optmised before 3.1 is released.
But it should only need to run once.
I've also added a 'RideMetric::Low' type which we could
also apply to weight.
Calculates the W' expenditure and reconstition during a ride.
The implementation is sub-optimal and will need to be optimised
and probably re-written to improve performance before v3.1 is
released.
This is based upon research conducted at the University of Exeter
by Philip Skiba, Weerapong Chidnok, Anni Vanhatalo, and Andrew Jones
and is used with permission.
For more information on the research please see: ""Modeling the
Expenditure and Reconstitution of Work Capacity above Critical
Power." Med Sci Sports Exerc 2012;:1.
Intervals are off by 1 sample because when the temporary
ride is created it stops short of the last sample in both
the ride and interval summary window code.
Fixes#623.
The current TIZ metrics only allow you to chart the
absolute time in zone. Over longer periods it can be
helpful to look at the overall ratio of intensities
trained at.
Updated RideFileCache and LTMWindow/Plot to
plot the user defined durations for peak power.
Actually we support all the different meanmax
measures available in the CP chart, so you can
now track peaks for user defined durations of;
* Power
* Watts per Kg
* xPower
* NP
* Heartrate
* Speed
* Cadence
* Torque
* VAM
I have not spent much time optimising for performance
but reusing the same 'seek' approach used by the recent
update for best() and tiz() functions in the datafilter.
Fixes#322.
.. to make sure the v2 LTMSettings
uses the bestSymbol.
Just pushing this (WIP) to make sure
we don't get half baked LTM settings
from people building against the previous
commit.
Update to let users specify a custom duration
to plot on LTM for peak power, vam, wpk etc.
This update is to the LTM chart settings and
the reading/writing of chart settings.
Next update will update LTMWindow/LTMPlot to
retrieve and plot the values from the CPX files.
Note: the values will not plot yet, the next
commit in this series is required.
When showing / hiding the toolbar we also show / hide
the scope bar. This is so when in train mode and you go
full screen it is possible to hide all ornamentation.
This will become a moot point when the scope bar is
replaced with 'appstore style icons' in the toolbar
to switch between home, analysis, train etc.
We know the highesst point on Earth, so any activity that
contains an altitude greater than that is definitely incorrect.
This patch truncates the altitude to the maximum possible, this
has the happy by product of curing a major mem alloc crash in QWT
when trying to plot altitudes with very large values.
Fixes#700
But saving is an issue !
The presets need to move to the athlete object as they
are in the athlete directory -- we currently have one
per LTM chart, which means they get overwritten on exit.
The definition of curves is rationalised to match the
new design mockups in readiness for introducing user
defined peak durations for power et al.
For now this patch cleans the UX and makes it much
easier to add/edit/remove curves.
Fixes#548
Kernel 3.11 exposes the Suunto ANT+ stick as a USB serial device,
this prevents GC from opening it in training mode unless the
kernel driver is detached first.
In training mode, calculations of speed using wheel size and RPM from
a speed sensor used integer division. This truncated all wheel
circumferences to an integral number of meters. 2100mm wheels were
treated as 2 meters and 1960mm wheels were treated as 1 meter,
effectively reducing calculated speeds by roughly 5% and 50%
respectively.
Fixes#585Fixes#651Fixes#669
as current tcx writer currently doesn't support laps (and tcx doesn't
allow non-linear/overlapping intervals, at all) this patch makes GC upload
exercises as pwx.
Pwx does support for arbitrary sample lengths. No need to chop off
timestamp precision and introduce bad data + jitter.
Instead we should look at fixing data import and consider resampling on
read.
Distance is defined as double, aswell - so, let's keep the precision,
aswell.
As I got it pwx by itself has no concept of recording intervals. "smart
recording" and other strange data require variable recoring intervals.
On the other hand it's not recording the duration of a sample explicitly.
This means the duration needs to be derived from the previous samples
timestamp (assuming the sample timestamps are referring to the end of the
sampled period).
This diff writes an empty timestamp at the end of each gap so that the
next real sample/ridepoint can calculate the correct duration.
Please note that this may unhide some deficiencies in GCs file reading in
exports.
Simplified selecting and managing preset charts
in the LTM chart settings.
Need to now move the 'Add' button to the custom
tab, but that is the next pending update.
When exporting files to Tcx, it's writing an ActivityExtension to the end
of the file with calculated AvgSpeed and MaxSpeed. Unfortunatly it's using
the km/h values - while Tcx is using m/sec. Schema is a bit unclear about
this, as the ActivityExtension uses "double" as type for both values, but
original Tcx v2 Schema only uses m/sec, GTC exports as m/sec and some
other software is expecting m/sec, aswell.
.. casting the sidebar in TrainView was wrong because the
controls are in the sidebar, not the trainTool. Thus
it would crash on exit .. but strangely only on Mac!
.. the code now correctly calls trainTool->Stop(), quite
why it fails on Mac only is a bit of a mystery.
.. forgot that the values are converted to
zero decimals when stored.
This fixes strange results when filtering by
wpk or speed, or any series that has decimal
places.
Added static functions to ridefilecache
to get best and tiz values for series and duration
or zones and glued them in to the datafilter code
recently added.
It uses seek (via QDataStream::skipRawData) and is
quite fast on my Linux development PC.
We now need to update the LTM settings dialogs to
the new mockups so we can plot custom durations for
peak power / NP etc too.
NOTE: Not tried on Windows / Mac, so may not be quite
so fast there, will need to check.
To try this out, in the search filter box type:
best(power, 3600) > 250
to filter only those rides where the best hour
power is greater than 250 watts. It should
return almost instantly.
Fixes the crash but the eval code is a bit of a
fuck up. It was evaluating children instead of
using recursion, and now we have lots more types
and expressions its all a bit of a mess.
Will need to rewrite to use recursion and it will
be a lot simpler!
There still some assert left in the code, but removed
a fair number of the examples where, its just as easy
to handle the condition gracefully, without crashing.
By 3.1 we will have eradicated assert from the code.
Will now allow users to specify a formula using
the * / + - ^ operators. This can be used to specify
values (e.g. TSS > 100*2) or to calculate a totally
new user metric (e.g. Average_Heart_Rate / RPE).
Also added two functions as well;
1. best (series, duration) which returns the best value
for the series of the given
duration in seconds.
Where series is one of; power,
hr, cadence, speed, torque,
xpower, np.
2. tiz (series, zone) which returns the time spent
in the given series and zone
Where series is either power
or hr and zone is 1-10.
NOTE:
We know need to add the functions for retrieving the best and
tiz values from the ridefilecache without having to read the
entire file (ie. read the header and use lseek).
.. it was not possibe to resize the window because
the blankstate page was too big.
.. blankstatepage is hidden for now until we fix the
logic for it in TabView
Split the views in MainWindow into separate classes;
* Tab is a collection of the 4 main views
* TabView is a base class for all of the 4 view types
* {Analysis,Train,Diary,Home}View are all derived from
TabView and deal with specifics of those views (e.g.
Diary/Home worry about date ranges).
We should be ready to move to tabbed athletes soon.
There are a few nits left for this part of the refactor
that will need to be resolved in some fixups over the
next few days;
* tile mode segment selector has wrong segment selected
when the view is in tile mode.
* Minimum height/width of MainWindow is large for some
reason
* the Train view controls (play, ffwd etc) have nowhere
to go at present -- need to fix that !!!
* When you resize the mainwindow width the sidebars expand
and should remain a fixed width
* not sure if it will build on Windows or Mac!
Part 4 of the MainWindow refactor is moving the code for the
4 views (Analysis, Train, Home, Diary) out of MainWindow and
into a separate set of classes.
TabView is the base class for the 4 views and the basic code
is in this commit, but now need to work on the 4 derived
classes for Analysis, Home etc and the controller class 'Tab'.
A bit of a mix of stuff, but basically the Athlete
class has sql stuff in it, that DBAccess used but
also referenced a session number in MainWindow.
Removed the interdependency and moved all code to do
with DB to DBAccess and out of MainWindow and Athlete.
At the same time needed to clean up a bit of memory
management and so introduced a MainWindow and Athlete
destructor.
We are now ready to do refactor part 4 to split MainWindow
into a new View class (that will be in each tab).
.. add some sample files with calibration messages to the
test/rides directory
.. remove the calibration marker color config (we can add it
back if needed, but was in the wrong 'sequence' and is
probably just a little bit *too* fine grained).
Further MainWindow updates, this time moving the code
for working with intervals to the AnalysisSidebar and the
associate menus.
Ultimately, the functions for working with Activities and
their Intervals will move from MainWindow and Sidebars to
the ActivityCollection classes.
This is a step as we strip out MainWindow to just GUI
aspects.
Moving the code intertwined into MainWindow for
the analysis view sidebar; activity list, intervals
and calendar into a new AnalysisSidebar class.
WARNING!
This is a work in progress checkpoint commit
as the sidebar menus and context menus have
not yet been migrated out -- this will be done
in the next commit or two.
Including:
* Fixed a type with slope mode updating the wrong byte array
* Transposed bytes in the definition of the erg and slope messages
* Added power smoothing
Note:
It appears the Fortius is supplying torque not power, some more
testing is being performed but expect to see an update shortly
once this has been fully tested.
Slowly migrating code and data from the MainWindow
class to Athlete and Context classes.
This update moves the ride and interval lists and
data structures from MainWindow to Athlete.
.. Minor oopsie with references to context->mainWindow->athlete
instead of simply context->athlete.
The MainWindow refactor will be complete when references to
the mainWindow class is for gui reasons only.
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).
We no longer pass around a MainWindow pointer to children
but pass a context instead.
There are still a few pieces left in MainWindow that need
to move to a better place;
* Setting/clearing filter selection
* Working with Intervals
* Adding/Deleting Rides
* Save on Exit
As mentioned previously there are lots of other parts to
this refactor left to do;
* break MainWindow Gui elements into Toolbar and Views
* migrate from RideItem and Ridelist to ActivityCollection
and Activity classes that are not tied into gui elements.
* introduce Application Context and AthleteCollection
Breaking the MainWindow 'god object' into
separate classes for Athlete and Context.
Further updates will need to;
- break MainWindow Gui elements into Toolbar and Views
- migrate from RideItem and Ridelist to ActivityCollection
and Activity classes that are not tied into gui elements.
- introduce Application Context and AthleteCollection
Once these are done we will be in a position to decouple
most classes from mainwindow and also introduce tabbed
athletes.
2 bugs:
- interval offset of -1 causes a crash in htmlSummary
- interval offset of form nnn e+0n parses incorrectly
Also remove silly -wreorder warning in ridefile.h
fopen() was missing 'b' flag, so that mingw and other platforms doing
LF/CR translation screwed data.
This is fixing the astronomic values of direct SRM downloads.
Playing with some ideas about how the UI will change
to support new UX features for viewing multiple athletes
in a single mainwindow and also having multiple pages
of charts in a single view.
2 Options on the drawing:
.. Having tabbed Athletes and scope bar for view pages
.. Having a source list and tabbed view pages
Can't decide which is best -or- if there are better options
we could look at.
Because the chart settings are modal its a really bad
idea to open up a column chooser from there. So, by
default, we don't have a column chooser option on the
search/filter box -- it must be explicitly requested.
We therefore explicity set the column chooser from the
mainwindow and also from the ride navigator window.
At first it seemed this was caused by setting the time to
a value greater than the length if the ridefile.
It was actually a constructor error, since the settings
class didn't initialise the ride variable.
Ridesummarywindow was using rideitem to get zones to use when
summarising for a date range which was bad because a) the ride
might not be for the date range selected and b) it might have
been deleted.
This fixes that and means we get a summary that is more accurate
and no crashing when rides are deleted.
If you delete and readd an activity after showing it on
the diary view you get a SEGV.
This is an edge case related to deleting the last activity
and going back to the blank state before importing another.
Actually there are 3 technical issues;
1. GcCalendar doesn't get notified by MainWindow when
there are no rides -- so it crashes on refresh
2. RideSummaryWindow doesn't get notified by home window
if its not visible
3. RideSummaryWindow should check rideItem isn't NULL before
trying to plot zones (but only for date range summaries)
Fixes#622
Its RC6 and we only just caught this bug!!! It was not
possible to delete or edit date ranges of type 'Cycle' due
to a cockup with the type() values.
Thanks to Martin Wifling for finding this one!
.. by only plotting the stack view if its actually
needed (i.e. user has selected stack view).
.. this performance degradation was introduced by the
axisscaling update (which is a nice update)
Fixes#616.
<stringname="emergency_contact_dialog_note">Should a text messesage be sent on ride start and periodically to let your emergency contact know you are alright?</string>
public void onNewPedalPowerBalance(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final boolean rightPedalIndicator, final int pedalPowerPercentage)
public void onNewRawWheelTorqueData(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final long wheelTorqueUpdateEventCount, final long accumulatedWheelTicks, final BigDecimal accumulatedWheelPeriod, final BigDecimal accumulatedWheelTorque)
public void onNewRawCrankTorqueData(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final long crankTorqueUpdateEventCount, final long accumulatedCrankTicks, final BigDecimal accumulatedCrankPeriod, final BigDecimal accumulatedCrankTorque)
public void onNewTorqueEffectiveness(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final long powerOnlyUpdateEventCount, final BigDecimal leftTorqueEffectiveness, final BigDecimal rightTorqueEffectiveness)
public void onNewPedalSmoothness(final long estTimestamp, final EnumSet<EventFlag> eventFlags, final long powerOnlyUpdateEventCount, final boolean separatePedalSmoothnessSupport, final BigDecimal leftOrCombinedPedalSmoothness, final BigDecimal rightPedalSmoothness)
We are proud to announce that GoldenCheetah v3.1 was released today.
It can be downloaded from our new website[http://www.goldencheetah.org/index.html#section-download]
We have recorded a video[https://vimeo.com/99817526] to explain the main changes, and the user guide[https://github.com/GoldenCheetah/GoldenCheetah/wiki/Main-Page_Users-Guide] has been overhauled to cover all the main features along with an updated FAQ[https://github.com/GoldenCheetah/GoldenCheetah/wiki/FAQ].
We have also added a section on the science of GoldenCheetah[http://www.goldencheetah.org/index.html#section-science] to help users new to power training and analysis.
MAJOR NEW FEATURES
1. Compare Mode
* Across Summary, Ride, QA, CP, Histogram, Metric charts
* Compare Athletes, Seasons, Rides, Intervals
* Easy and intuitive user interface
2. Additional Power Duration Models
* Multiple PD models now available
* Track changes in model estimates for W', CP, P-Max, FTP over time
* Track changes in model estimates for any duration over time
2. Merge data from multiple rides into a single ride
3. Share Dialog to upload to multiple services in one click
OTHER SELECTED HIGHLIGHTS
* Open Athletes in Tabs
* Redesign Tabbed mode with a ChartBar
* Themes and better support for color customisation
* Improved Interactivity (axes, interval hover)
Device enhancements
* Fixed up Tacx Fortius Support
* Pedal Smoothness / Torque Effectiveness support
Metrics and new science
* Plot best x power
* Plot estimated W', CP, FTP et al
* W'bal implemented with metrics
Charts
* Improved UX for chart configuration and setup
* Export data for MMP curves, trends data
* Over 50 new charting options (heat, stack, labels etc etc)
Work on 3.11 starts today, focusing on indoor training.
<li><a href="https://github.com/GoldenCheetah/GoldenCheetah/releases/download/v3.0-SP2/GoldenCheetah_3.0.2_Windows_Installer.exe">Windows 32-bit (runs on 64bit as well)</a>
<li><a href="https://github.com/GoldenCheetah/GoldenCheetah/releases/download/v3.0-SP2/GoldenCheetah_3.0.2_Mac_Universal.dmg">Mac OS X Intel Universal (10.6+)</a><br>
<a href="https://github.com/GoldenCheetah/GoldenCheetah/releases/download/v3.0-SP1/GoldenCheetah_3.0.1_Mac_Universal.dmg">Mac OS X Intel Universal (10.6+)</a><br>
<li>See the <a href="https://github.com/GoldenCheetah/GoldenCheetah/blob/master/doc/user/GC3-Release.pdf?raw=true">Release Notes</a> PDF on GitHub.</li>
<li>A PDF <a href="https://github.com/GoldenCheetah/GoldenCheetah/blob/master/doc/user/GC3-Manual.pdf?raw=true">User's Manual</a></li>
<li>A PDF <a href="https://github.com/GoldenCheetah/GoldenCheetah/blob/master/doc/user/GC3-FAQ.pdf?raw=true">Frequently Asked Questions (FAQ)</a></li>
<li>Welcome Screens to help setup the program.</li>
</ul>
</p>
<p>
Internationalisation
<ul>
<li>German (Tilman Schmiedeberg)</li>
<li>Italian (Marco Piccirilli)</li>
<li>Japanese (Okano Takayoshi)</li>
<li>Spanish (Alejandro Martinez)</li>
</ul>
</p>
<p>
Development Builds
<ul>
<li>Gareth Coco</li>
<li>Jamie Kimberley</li>
</ul>
</p>
<p>
<a href="release-notes_3.0.0.html">Full Version 3.0.0 change log.</a><br>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.