.. 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 !
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...
.. 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
.. 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.
.. 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.
.. 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.
.. 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).
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).
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!