Skip to content

Commit

Permalink
Added W' Tau as a metric
Browse files Browse the repository at this point in the history
.. so we can track and see if it correlates with anthing.
  • Loading branch information
liversedge committed Jan 20, 2014
1 parent a0114b3 commit 393e4a3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/DBAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
// 53 18 Dec 2013 Mark Liversedge Added Fatigue Index (for power)
// 54 07 Jan 2014 Mark Liversedge Revised Estimated VO2MAX metric formula
// 55 20 Jan 2014 Mark Liversedge Added back Minimum W'bal metric and MaxMatch
// 56 20 Jan 2014 Mark Liversedge Added W' TAU to be able to track it

int DBSchemaVersion = 55;

Expand Down
32 changes: 32 additions & 0 deletions src/WPrime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,42 @@ class MaxMatch : public RideMetric {
RideMetric *clone() const { return new MaxMatch(*this); }
};

class WPrimeTau : public RideMetric {
Q_DECLARE_TR_FUNCTIONS(WPrimeTau);

public:

WPrimeTau()
{
setSymbol("skiba_wprime_tau");
setInternalName("W'bal TAU");
}
void initialize() {
setName(tr("W'bal TAU"));
setType(RideMetric::Low);
setMetricUnits(tr(""));
setImperialUnits(tr(""));
setPrecision(0);
}
void compute(const RideFile *r, const Zones *, int,
const HrZones *, int,
const QHash<QString,RideMetric*> &,
const Context *) {

WPrime w;
w.setRide((RideFile*)r);
setValue(w.TAU);
}

bool canAggregate() { return false; }
RideMetric *clone() const { return new WPrimeTau(*this); }
};

// add to catalogue
static bool addMetrics() {
RideMetricFactory::instance().addMetric(MinWPrime());
RideMetricFactory::instance().addMetric(MaxMatch());
RideMetricFactory::instance().addMetric(WPrimeTau());
return true;
}

Expand Down

0 comments on commit 393e4a3

Please sign in to comment.