Commit Graph

13 Commits

Author SHA1 Message Date
Mark Liversedge
6fdc55528f Code Cleanup: RideFileCache remove mallocs
Mark Rage's superfast meanmax computer works like a charm but
uses stdlib malloc/free for memory allocation.
2013-02-21 13:07:00 +00:00
Mark Liversedge
05f523f3be Fix VAM on CP chart out by factor of 10
Fixes #489.
2013-02-13 22:01:43 +00:00
Mark Liversedge
626b4243cc Code Cleanup: RideFileCache
.. static const in class a GNU extension and not used anyway.
2013-02-13 09:26:19 +00:00
Mark Liversedge
2a2ef7ba08 W/KG fixup distribution/histogram
The w/kg ridefile cache was not quite right
for distribution charting.
2012-12-03 14:56:43 +00:00
Mark Liversedge
676b6ba52b UI Nits: LTM Sidebar (Part 2 of 3)
The last of a series of recent patches to address performance
degradation from the introduction of the LTMSiebar. This last
patch introduces a CPX aggregates cache to re-use aggregated
CPX data (e.g. for plotting a specific season or date range).

The cache is set to only hold 25 caches, which should be enough
for most folks list of seasons. But won't get unwieldy if they
scroll around in the diary view.

The following will be introduced in the last patch of
this series:

1. Introduce 'events' within a season and plot them on the
   LTM chart -- a form of 'annotation' but also the beginning
   of planned events in the future too.

2. Implement click functionality on LTM charts but decide if
   we use click to annotate or to define a new date range or
   both?
2012-11-27 21:03:19 +00:00
Mark Liversedge
d0b009c922 Data Filter (Part 3 of 3)
Last part of the search/filter functionality;

* SearchBox now incorporates filter and search
  with a new widget. We can update this widget
  to include more fancy UI/Interactions without
  having to change the ride list or charts etc.

* Added search/filter widget to the relevant charts
  and screens; Metrics, TreeMap, CP, Histogram,
  Activity Log, Ride list (refactored out of MainWindow)

* Added namedsearches.xml and adding/selecting them
  from a drop down menu on the search box.

* Fixed some performance bugs related to duplicate
  signals and redraw/reprocessing. Also ensured that
  CLucene remains optional -- but means no search or
  filter functionality unless it is available.
2012-11-05 15:44:01 +00:00
Damien
b116d3aac8 Add Watts/Kg in the cpx cache files and in the CP plot
modified:   src/CpintPlot.cpp
	modified:   src/CriticalPowerWindow.cpp
	modified:   src/CriticalPowerWindow.h
	modified:   src/HistogramWindow.cpp
	modified:   src/RideFile.cpp
	modified:   src/RideFile.h
	modified:   src/RideFileCache.cpp
	modified:   src/RideFileCache.h
2012-07-08 11:03:20 +01:00
Mark Liversedge
e7bcaa2b25 Add VAM to CP curve
Very basic start, this will now let you plot
VAM on the CP curve. VAM is a measure of climbing
speed and for comparative purposes should be
normalised to the slope climbed.

In this first pass of implementation the VAM metric
is not normalised in any way. It merely represents
the climbing rate, in meters per hour, that was
sustained over each time interval from 5mins to the
ride duration.

If the ride is undulating then only ascension is
included, any time on the flat or descending is
included but meters climbed will be zero. This is
akin to the way we handle power where we include time
when freewheeling.

More sophistication is needed, especially normalising
the value to a common gradient (e.g. 10%). But this
will prove challenging when VAM is comprised of
undulating elements (i.e. gradient is cumulatively
zero, but could contain segments with steep parts).

It may be more appropriate to only measure VAM for
sustained climbing i.e. ignore ride sections when
descending or on the flat.

More thought needed.

Fixes #414.
2011-08-18 19:15:20 +01:00
Mark Liversedge
0a71875d85 Mark Rages' Superfast Mean Max Computer
Mark Rages has developed a super fast and innovative
approach to identifying max-mean intervals. This
approach is 20% faster than the current approach and
importantly does not require "downsampling" of data
yielding much higher resolution for longer intervals.

The code has not been 'adjusted' to adopt QT style
containers (e.g. QVector) and uses malloc/free.

The primary innovations include:
* integrating the data series to reduce the operation
  for identifying an interval sum to a single subtract
  operation.

* Searching for max sum via a window-search rather
  than iterating over the entire series (divide / conquer)

Interestingly, now we have retained high resolution the
xPower algorithm still yields differing results to the
existing metric code. I have contacted Sean to get some
insight into why this might be the case, but suspect it
is related to the implementation of the xPower 25s EWMA.

Tip o' the hat to Mark Rages for this -- sometimes you
just have to accept that no matter how smart you think
you are, there are some folk who /really are/ smart!
2011-05-04 21:19:49 +01:00
Mark Liversedge
69e51a2dcf Store pre-computed statistics as floats not longs
The .cpx file used unsigned long to reduce storage
requirements but lost precision. This patch migrates
to using floats, which in most cases are the same size.

One side effect of this update is that mean-max charts
for HR, Speed, Cadence no longer have a 'staircase' effect
and plot more smoothly.
2011-05-03 17:04:48 +01:00
Mark Liversedge
c1a8945a11 Histogram plot by zone for seasons
The recent update to plot histograms for seasons or other
date ranges did not support displaying by zone since the
cache did not contain zoned data. This patch fixes that
with an update to RideFileCache to pre-compute and to the
PowerHist class to retrieve and plot.

There are some minor issues that need to be addressed:

* Handling aggregation with different zone schemes

* Deciding which zone scheme to use for the bar labels
  when multiple differing schemes have been used within
  the date range selected.

* Showing a break down of time in zone by range i.e.
  how much time was spent at Threshold when CP was X
  as opposed to when it was Y (hint: do it like we
  currently display intervals when plotting a single
  ride).

* Refreshing the Time In Zone data in the .cpx file
  when CP/LTHR changes is not implemented.

The RideFileCache now checks the version of the cache to
determine if it needs to be refreshed -- so no need to
delete old .cpx files before running GC with this patch.
2011-05-03 16:26:40 +01:00
Mark Liversedge
f686f2f262 Ride Statistics performance improvements
The metric code for calculating NP was sub-optimal (actually
it was pretty crap). This patch improves the performance of
the calculation quite substantially (>50% improved).

Additionally, the critical durations code has been adjusted
to reduce the amount of work for long rides (>3hrs or more).
2011-05-02 10:33:58 +01:00
Mark Liversedge
41eaaa866b Plot more data on the CP plot and use a binary cache file
This patch enables more data series to be plotted on a CP plot.
We can now show curves for heartrate, cadence, speed and torque
as well as the original power and energy.

The CP code is refactored into the plotting functions and a new
RideFileCache that precomputes the mean-max as well as distribution
data (for a later patch to show histograms across date ranges).

The code for computing mean-max values has been re-written and
significantly optimised by;
* computing 1s intervals up to 5mins only
* computing 20s intervals for the remainder of the ride
* downsampling data to 5s samples for longer durations
* using a binary file format (cpx) for faster read/aggregation
* using multiple threads

Testing on an old Athlon dual-core showed an increase in performance
over the old cpi code of approximately x20, but since new data series
are now computed it is only x4 faster. Quad/Octo core systems will
show a greater performance increase though.
2011-04-25 02:20:19 +01:00