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