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