.. ensure duplicate points survive the round-trip
from points -> qwkcode -> points to enable editing
of qwkcode and mixing with undo/redo.
.. point data now stored as ints not doubles and use
integer arithmetic etc. Makes things more consistent
and a hell of a lot faster.
.. QT code supplied was QT5 only, fixed up to compile
on QT4 by including relevant headers
.. moved the responsibility for code highlighting back
to the editor as it is the sensible place to do it.
.. add a text edit to edit the workout quickly
without having to use a gui or work with the
ERG file format.
.. need to make it round-trip, hover highlight
and generally make it easier on the eye.
.. when updating an ergfile after edit if the duration of
the workout has changed the "Duration" member needs to be
updated to reflect the change since it is used by
wattsAt() to decide if at the last section of the erg file.
.. so other plots see changes we made (without saving).
.. the reason we don't insist on saving the erg file is
because we often increase intensity or repeat sections
just for a one off run.
.. the changes made within the editor are applied to the in-memory
representation when the workout is started -- that way the edits
are executed.
.. the workout changes are not saved (yet).
.. will now plot telemetry as you are recording so can be
used as a drop in replacement for ErgFilePlot.
.. bear in mind it does not support slope mode yet, so
cannot be used for CRS, MRC and PGMF workouts.
.. will adjust what is shown when resized to a small size
.. will hide toolbar whilst recording
.. getting ready to plot telemetry when recording so we
can replace the workout plot.
.. using the sustained interval algorithm we can now
find sections of a ride that are impossible to
complete according to the 2 parameter model.
.. only looks at durations > 2 mins.
.. this pastes a 'block' that has been copy/cut
but needs to be updated to work in an expected
way -- it pastes points, not blocks which leads
to situations that will confuse users.
.. one fix would be to be paste intelligently to
avoid duplicate points and "join" the pasted
blocks to the existing blocks.
.. to cut and copy the block selection to the clipboard.
this is very different to delete points since it will
shift the remaining points to fill the gap.
.. from a UX perspective the cut/copy/paste functions will
work with BLOCKS not POINTS. This may cause a bit of
confusion.... not sure how to deal with that.
.. when you create a block (by pressing and holding the mouse
button) it now enters dragging mode (dragblock state) to allow
the user to move it around before releasing the mouse button
to create.
.. we DESPERATELY need guides to appear whilst dragging (!)
.. press and hold a mouse button to create a block
whilst in draw mode (or shifted in select mode).
.. will add a block in the middle or at the end of
the workout depending on where you click.
.. refactor as paint based approach was awful
from a utility and performance perspective.
Even though it was just a UX experiment it
bombed to CPU on Linux and Windows.
.. the toolbar draw/select buttons now set the mode.
.. in select mode you can select points (same as holding
shift whilst in draw mode).
.. this is just to make the UX less complex for casual users.
.. when using a rectangle selection we clear all
the currently selected points. More often than
not this behaviour is preferred, we could add a
keyboard modifier in the future.
.. added a static fastSearch() function to the
RideFileCache class to perform a search on a
single series of data without any data prep.
.. its super quick and will work with the workout
editor recompute() function, but need to think
about how we can display the MMP curve as we
edit.
.. for now pressing SHIFT and CLICK will enable
selecting points.
shift-click when hovering on a point will toggle
selection of that point
shift-click in space will start a rectangle select
tool; as it drags it will select points within it.
hitting the ESC key will clear all selections.
.. the toolbar button "Select" needs to be integrated
into this scheme so users don't need to know about
the ability to select with the shift key (as we had
this before with intervals and it wasn't intuitive
to casual users).
.. resampling is the WRONG approach for the erg points
they need to be INTERPOLATED!
.. e.g. a ramp from 0w to 100w over 10 minutes was previously
resampled as 10 minutes of 0w followed by a jump to 100w
and thus W'bal was way off !!
.. we calculate for ourselves since its probably
quite expensive to calculate every metric.
.. could look to use the metric factory in the future
if we want to make these metrics more configurable