Commit Graph

20 Commits

Author SHA1 Message Date
Brian Bergstrand
1fcc94c7f4 Fix various 'unused variable' warnings 2016-01-07 21:18:50 -06:00
Mark Liversedge
d743fdd3ec No Assert in RideMetric.h
.. gets rid of an iritating compiler warning when
   compiling with VS2015 and MSVC

.. is good because user metrics aren't fixed so the
   assert assumption is wrong now

.. means we have to add assert.h to all the source
   files that had it from including RideMetric.h
   and want to use it.
2015-12-24 15:26:29 +00:00
Mark Liversedge
d6c8949355 Major RideMetric compute() refactor
Update of all metrics to work with a RideItem
not directly with a RideFile.

When iterating over the activity samples we now
use a Specification and RideFileIterator to bound
the set of samples used. This means that we can
compute metrics for intervals without having to
create a temporary ridefile.

RideItem now has first class members for zoneRange,
hrZoneRange and paceZoneRange to avoid calculating
for every metric which are stored in RideDB.json.

Compare pane continues to construct a ride file
when working with intervals since it is used lots
of charts, this is unlikely to ever change.

A SEGV in compare intervals has been fixed where
interval items were repointed to temporary compare
pane objects that are deleted - see RideItem::setFrom.

THIS COMMIT CONTAINS 3 REGRESSIONS:
1. TcxRideFile no longer computes metrics
2. FitlogRideFile no longer computes metrics
3. WorkoutWizard no longer computes metrics

-- The workout wizard will be replaced with a new
   Workout editor, whilst the RideFile metrics
   may be deprecated (but considering options)
2015-12-16 11:36:02 +00:00
Mark Liversedge
587f4523a7 Fix compare allplot short distance
.. was using an int instead of a double for KM, so any interval
   less than a KM long was rounded to zero length.
2015-07-11 20:49:57 +01:00
Mark Liversedge
9ca99bbe50 Withings Download Message
.. simpler and more user friendly

.. old message made little sense grammatically too !
2015-07-10 09:25:33 +01:00
grauser
8223a20b77 Route Search: verify Min-Max Lat-Lon before searching 2015-05-26 23:27:25 +02:00
Mark Liversedge
98720f099e Use C++ <cmath> not C <math.h>
.. it clashes, and also its deprecated for C++ sources
2014-12-25 20:38:18 +00:00
Mark Liversedge
44aea09d97 Deprecate SQL metricDB
.. 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
2014-12-24 20:24:34 +00:00
Claus Assmann
35eb416bd2 Fix comment spelling errors
.. lots of them !
2014-11-24 15:37:56 +00:00
Mark Liversedge
bd7893ce9c Estimated vo2max should be a peak
.. Fixes #988
2014-07-27 15:39:43 +01:00
Mark Liversedge
0fce4b27e8 Use w/kg units always, not wpk
.. and also allow lrbalance in data filter
2014-06-15 09:26:45 +01:00
Mark Liversedge
65f77bafa4 WPK metrics need 2 decimals not 1 2014-05-20 21:05:03 +01:00
Mark Liversedge
ce7e881957 Fixed Estimated VO2MAX metric
.. to use latest ACSM formula.

.. see: http://blue.utb.edu/mbailey/handouts/pdf/MetCalnew.pdf
2014-01-07 16:20:23 +00:00
Mark Liversedge
05f1d577db Refactor MainWindow Part 2 of 5
Decoupled classes from MainWindow to reference Context
and Athlete (and introduced a couple of new headers).

We no longer pass around a MainWindow pointer to children
but pass a context instead.

There are still a few pieces left in MainWindow that need
to move to a better place;
    * Setting/clearing filter selection
    * Working with Intervals
    * Adding/Deleting Rides
    * Save on Exit

As mentioned previously there are lots of other parts to
this refactor left to do;
    * break MainWindow Gui elements into Toolbar and Views

    * migrate from RideItem and Ridelist to ActivityCollection
      and Activity classes that are not tied into gui elements.

    * introduce Application Context and AthleteCollection
2013-07-11 14:02:02 +01:00
Mark Liversedge
1aadc19f36 Fix RideFileCache threaded db access
The call to RideFile::getWeight() in RideFileCache
computation ends up with a call the read the measures
table in the DB. This is BAD since it is called from
a thread.

We now call getWeight() in the metric aggregator before
launching the ridefilecache computation -- this will cache
the weight and avoid db access.

I've also removed the duplicate code in the w/kg metric code
too and it should be marginally faster at computing metrics
now.

BIG THANKS TO ILJA BOOIJ FOR HIGHLIGHTING THIS, DESPITE MY
INITIAL SCEPTICISM. I OWE HIM A PINT (OR TWO) :)

Fixes #604
2013-05-19 19:06:28 +01:00
Alejandro Martinez
2db48cc1a4 Enable metrics translations
The code setting metric names and units was moved from constructors to
an initialize method, to be called after translator initialization.
English Name is preserved as InternalName for metadata.xlm compatibility
in metric override.
Q_DECLARE_TR_FUNCTIONS(class-name) macro is used to set tr() context
when class-name is not QObject sub-class.
2012-12-04 13:59:49 -03:00
Damien
4420c5b185 Enable withings weight for Watts per Kilogram metric 2012-11-18 16:13:15 +00:00
Mark Liversedge
2e248c3e26 Manual entries compute metrics
A few months ago I commented out the calculation of metrics
for manual ride files. This was a hack to avoid fixing the code
to handle metric calculations from overrides where there are no
data points.

This annoyingly meant that the 'rides' metric was zero for manual
ride files, and any derived metrics similarly were zero.

This patch fixes that.
2012-07-08 16:22:40 +01:00
Mark Liversedge
4f5e047780 Add a Watts per kilogram metric
All the existing wpk metrics concentrate
on the wpk for a fixed period, which is great
but we should also support it for an interval
(where it is arguably most interesting).

This patch fixes that.

Fixes #467.
2011-11-22 20:28:18 +00:00
Mark Liversedge
3aba7dd788 Inital V3 Branch 2010-12-30 17:35:23 +00:00