.. 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 !
.. 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.
.. 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
.. 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.
.. 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
.. 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
.. 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.
.. from DBAccess to RideCache
.. and also SummaryMetrics::getForSymbol() now available in
RideItem to access the precomputed metrics for a single
ride.
.. 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 !
.. 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.
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
.. 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
.. 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.
.. 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 !!!!
.. 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 !
... some more AP/AM changes (hopefulyl the last ones)
... Setttings.h - the GC_DATETIMEFORMAT constant is not used anywhere
(old usages are de-activated)
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.
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.
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.
As a personal habit I tend to use the C pre-processor to
comment out code blocks I don't want to remove. This is in
case the code will be required in the future.
I think it is now safe to say the code commented out is not
required -- most of it is legacy and marks the transition from
earlier designs or legacy code.
I've done this in one big commit since in theory it has no
functional change, and in future can look in this commit for any
code we may want to reinstate.
Not sure why, but setting the text on a treewidget item seems to
cost a lot of memory. So we don't bother since it is never used.
In general the valgrind output is ok, quite surprised. There are
very few non-widget items that are alloced but never free'd in the
GC code.
The refactoring of the summary window to use metricDB and the
introduction of HR zone config in options removed (temporarily)
the table on ride summary.
This patch re-introduces it.