Commit Graph

95 Commits

Author SHA1 Message Date
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
Alejandro Martinez
078d4ac5ad Add support for running power zones (Stryd) part 3
Final part: use the zones according to sport in metrics and charts
2015-12-19 19:08:33 -03: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
0485c873f4 NA value and Min Temperature metric
.. allow NA to be used anywhere and skipped on
   the metric trend chart.

.. add a min temperature metric

.. add a chart for tracking temperatures
2015-12-03 14:58:38 +00:00
Alejandro Martinez
1a57e45fb6 Basic Stryd (Power Meter for Running) support
Enables power metrics for non cycling activities when power data is present.
2015-11-03 11:29:53 -03:00
Mark Liversedge
cd8c123961 Min Heartrate Metric
.. useful in formulas
2015-08-29 11:38:21 +01:00
Mark Liversedge
ca63736c46 Reinstate Withings Measures
.. bodyfat kg, lean kg, bodyfat percent
.. fixup charts.xml to use it

NOTE: RideItem changes so touch *.y or
      make clean after pulling this commit
2015-07-18 20:18:51 +01:00
Alejandro Martinez
a2e7dd8505 Added Distance Swim metric
To show distance in swimming units, useful for non-metric configurations
2015-07-13 22:07:29 -03:00
Alejandro Martinez
0176292218 Override isRelevantForRide for metrics not relevant for runs and swims 2015-07-10 21:36:45 -03:00
Alejandro Martinez
fd3ca40e8a Override toString for AvgTemp and MaxTemp metrics
To show "-" when internal value is RideFile::NoTemp
2015-07-10 19:59:14 -03:00
Mark Liversedge
00badb6cb1 Fix tHb units
.. its grams per decilitre
2015-06-27 17:40:37 +01:00
Mark Liversedge
32ae899861 Add Moxy tHb metrics
.. to match the smO2 ones.
2015-06-27 17:22:31 +01:00
Mark Liversedge
148064ed81 Add Core Temperature
.. New derived data series representing an estimate of core temperature
   on the basis of HR changes.

   * shown on AllPlot and RideSummary
   * 2 new metrics; max and avg core temperature

.. This has been based upon "Estimation of human core temperature from
   sequential heart rate observations" Mark J Buller, William J Tharion,
   Samuel N Cheuvront, Scott J Montain, Robert W Kenefick, John
   Castellani, William A Latzka, Warren S Roberts, Mark Richter,
   Odest Chadwicke Jenkins and Reed W Hoyt. (2013). Physiological
   Measurement. IOP Publishing 34 (2013) 781–798.
2015-06-18 18:41:04 +01:00
Mark Liversedge
6835e8188c Add Climb Rating metric
.. based upon Fiet-type formula elevation^2 / distance.
   From an idea on Dan Conelly's blog.

   Some examples:
      Mt Ventoux        - 121
      Alpe d'Huez climb - 83
      Galibier          - 81
      Glandon           - 66

.. so it's not perfect, but gives a good sense of hard
   versus easy !
2015-06-12 15:29:01 +01:00
Mark Liversedge
509a123989 Interval List indicate high quality
.. with a sidebar indicator

.. we may need to change when we have planned workouts
   as the intervals will need to match the plan.

.. but we can use the same concept of 'quality' when
   comparing a full activity with what was planned.
2015-05-29 19:50:47 +01:00
Mark Liversedge
008e217ec0 Add another /10 for Workbeats
.. brings it back to same scale as BikeScore
2015-04-24 10:37:21 +01:00
Mark Liversedge
cdc8857536 Workbeat Stress
.. heartbeats x joules, when unfit you may generate low watts
   but with a high hr, as opposed to the other way around.

.. an attempt to combine central and peripheral stress, can be
   used to compare with power only stress metrics
2015-04-24 10:01:47 +01:00
Mark Liversedge
c4a819db67 Added heartbeats metric
.. count of heartbeats per interval
2015-02-23 16:10:43 +00:00
Alejandro Martinez
1cfc023473 Adjust decimals for distance metric and max rows in LapsEditor 2015-02-13 22:31:03 -03:00
Mark Liversedge
87f0729d43 Revert RideMetric::imperialPrecision()
.. introduced within bae36e6b
2015-02-09 22:07:29 +00:00
Alejandro Martinez
ea5599b76e Fixed GOVSS and SwimScore estimation when there is no speed channel but distance is overriden
Distance/Duration is a better approximation for Avg Speed than 0.0
and Duration is better than Time Moving in GOVSS/SwimScore estimation
for these cases.
2015-02-03 21:32:16 -03:00
Alejandro Martinez
821542c7fe Fixed Pace and Swim Pace units setting
Pace and xPace metrics use GC_PACE units setting
Pace Swim and xPace Swim metrics use Swim GC_SWIMPACE units setting
2015-02-03 20:19:08 -03:00
Alejandro Martinez
436128f340 Fixed lower-is-best for Pace metrics
Also removed isTime since time formatting assumes seconds and they are in minutes,
it remains pending to change formating to mm:ss.
2015-02-03 15:06:10 -03:00
Mark Liversedge
54707abcd8 Time Riding renamed to Moving
.. to reflect multsport use
2015-01-30 16:51:29 +00:00
Mark Liversedge
fb994fa5e7 Rename Ride to Activity
.. across the code, except where it clearly is a ride
   e.g. importing PowerTap or SRM
2015-01-30 10:59:56 +00:00
Damien
930a335855 Metrics: Add Calories based on average HR
fixes #1249
2015-01-14 22:37:20 +01:00
Joern
7b2f8f0e9b TE/PS - Average Calculation
... change calcuation of Averages for TE/PS by using the delivered
samples with valid values (> 0) and the number of delivered data samples
> 0 as the basis
2015-01-12 19:46:40 +01:00
Alejandro Martinez
0c9a02e743 Make Pace not relevant only for swims
Since Pace Swim conveys the same information in units more usual for swimming
For backward compatibility it is kept relevant for any other sport
2015-01-11 21:56:59 -03:00
Mark Liversedge
32b18da693 Hide irrelevant interval metrics
.. in the interval sidebar
2015-01-11 09:43:14 +00:00
Alejandro Martinez
cb9d9239a4 Added Swim Metrics
SwimScore, xPace and Pace for Swimming
TriScore for combined PMC
2015-01-09 21:59:27 -03:00
Damien
39d044576f RideMetrics: add isRelevantForRide for HR and cadence (avg and max) 2015-01-07 22:32:22 +01:00
Damien
3dba2c58f5 RideMetrics: add isRelevant for Aerobic Decoupling and SmO2 metrics 2015-01-07 19:36:34 +01:00
Mark Liversedge
5c54b50722 Ratios are averages not peaks
.. for Power/HR and NP/HR ratio metric aggregation
2015-01-07 17:31:38 +00:00
Damien
168a3abc69 BasicRideMetrics: Add Power Phase length 2015-01-06 22:39:04 +01:00
Damien
5ac2aa1d6a BasicRideMetrics: Avg for Power Phase only when we have a phase end 2015-01-06 21:45:25 +01:00
Damien
80790d72d6 BasicRideMetrics: Correct copy-paste error 2015-01-06 21:21:48 +01:00
Damien
7ce398a251 Garmin Cycling Dynamics : Switch on Power Phase 2015-01-06 18:44:27 +01:00
Damien
db4a4a0809 Garmin Cycling Dynamics : Switch off Power Phase 2015-01-06 00:15:08 +01:00
Damien
bae36e6b2a BasicRideMetrics: Add metrics for Garmin Cycling Dynamics - part 1 (Avg) 2015-01-05 23:00:44 +01: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
22584288ca Ridecace Measures deprecated from SQLite
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.
2014-12-08 16:48:58 +00:00
Mark Liversedge
5515467dd9 Add RideMetric::toString(bool useMetricUnits)
.. so we can now call that instead of doing the conversion
   and formatting all over the code !

NOTE: it still needs to be /called/ in the code, that change
      will need to be applied everywhere a metric is displayed
      to the user.
2014-12-03 12:36:40 +00:00
Mark Liversedge
553500596c Add Min, Max, Average SMO2
.. and add to summary
2014-11-26 22:01:46 +00:00
Mark Liversedge
2a53f30141 Added Watts:RPE ratio
.. compare average power to the rpe rating.
2014-11-21 19:33:41 +00:00
Rainer Clasen
656fb90590 fix "Time Riding" for rides without kph
"Time Riding" was only calculated when the ride had kph values - although
it's then also including time without kph but cadence. This caused it to
skip all time spent on the trainer (... if there's no sensor on the rear
wheel).

This patch makes it consistently calculate "Time Riding" if there's kph or
cad... might be worth to count time with pwr or similar running metrics,
too.
2014-11-02 16:26:43 +01:00
Mark Liversedge
47fb5068df Add HrNp Ratio
.. to echo HrPw
2014-09-09 16:11:02 +01:00
Mark Liversedge
3578c9caca Add HrPw Metric
.. as a ratio of Average Power to Average Heartrate
   hrpw = ap / ahr
2014-09-07 22:15:12 +01:00
Joern
89d03987c9 New Metrics for MTB - Bike Carrying Time/Elevation Gain
... 2 new metrics (estimates) mainly relevant for MTB or Race bike steep
passes
... a) Time Carrying = moving < 8kph, gaining height, no power, no
cadence
... b) Elevation Gain carring = same criteria, but adding up the
elevation gain

Since there is a certain level of error, the metrics is named as "Est".
2014-09-05 13:31:21 +02:00
Joern
ce5a8d8e9a Add new metric - Elevation Loss
... for rides having different start/end points (e.g. stage races) this
metric adds information
2014-08-20 19:42:47 +02:00
Mark Liversedge
c5a1888662 Below CP Work + W' Work = Total Work
.. previously we have computed below cp work as only that
   work when power was at or below CP

.. since we want to track energy from CP and W' it makes more
   sense to make below CP work include all work not from W' stores.
2014-07-13 09:38:15 +01:00