mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
TRIMP fallback to workout time if time riding 0
This commit is contained in:
@@ -59,8 +59,9 @@
|
||||
// 40 20 Oct 2012 Mark Liversedge Lucene search/filter and checkbox metadata field
|
||||
// 41 27 Oct 2012 Mark Liversedge Lucene switched to StandardAnalyzer and search all texts by default
|
||||
// 42 03 Dec 2012 Mark Liversedge W/KG ridefilecache changes - force a rebuild.
|
||||
// 43 24 Jan 2012 Mark Liversedge TRIMP update
|
||||
|
||||
static int DBSchemaVersion = 42;
|
||||
static int DBSchemaVersion = 43;
|
||||
|
||||
DBAccess::DBAccess(MainWindow* main, QDir home) : main(main), home(home)
|
||||
{
|
||||
|
||||
@@ -70,14 +70,18 @@ class TRIMPPoints : public RideMetric {
|
||||
restHr = rideFile->getTag("Rest HR", QString("%1").arg(restHr)).toDouble();
|
||||
|
||||
assert(deps.contains("time_riding"));
|
||||
assert(deps.contains("workout_time"));
|
||||
assert(deps.contains("average_hr"));
|
||||
//const RideMetric *workoutTimeMetric = deps.value("workout_time");
|
||||
const RideMetric *timeRidingMetric = deps.value("time_riding");
|
||||
const RideMetric *averageHrMetric = deps.value("average_hr");
|
||||
const RideMetric *durationMetric = deps.value("workout_time");
|
||||
assert(timeRidingMetric);
|
||||
assert(durationMetric);
|
||||
assert(averageHrMetric);
|
||||
|
||||
double secs = timeRidingMetric->value(true);
|
||||
double secs = timeRidingMetric->value(true) ? timeRidingMetric->value(true) :
|
||||
durationMetric->value(true);;
|
||||
double hr = averageHrMetric->value(true);
|
||||
|
||||
//TRIMP: = t x %HRR x 0.64e1,92(%HRR)
|
||||
|
||||
Reference in New Issue
Block a user