mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Added heartbeats metric
.. count of heartbeats per interval
This commit is contained in:
@@ -895,6 +895,45 @@ static bool avgHeartRateAdded =
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct HeartBeats : public RideMetric {
|
||||
Q_DECLARE_TR_FUNCTIONS(HeartBeats)
|
||||
|
||||
double total;
|
||||
|
||||
public:
|
||||
|
||||
HeartBeats()
|
||||
{
|
||||
setSymbol("heartbeats");
|
||||
setInternalName("Heartbeats");
|
||||
}
|
||||
void initialize() {
|
||||
setName(tr("Heartbeats"));
|
||||
setMetricUnits(tr("beats"));
|
||||
setImperialUnits(tr("beats"));
|
||||
setType(RideMetric::Total);
|
||||
}
|
||||
void compute(const RideFile *ride, const Zones *, int,
|
||||
const HrZones *, int,
|
||||
const QHash<QString,RideMetric*> &,
|
||||
const Context *) {
|
||||
total = 0;
|
||||
foreach (const RideFilePoint *point, ride->dataPoints()) {
|
||||
total += (point->hr / 60) * ride->recIntSecs();
|
||||
}
|
||||
setValue(total);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem *ride) const { return ride->present.contains("H"); }
|
||||
|
||||
RideMetric *clone() const { return new HeartBeats(*this); }
|
||||
};
|
||||
|
||||
static bool hbAdded =
|
||||
RideMetricFactory::instance().addMetric(HeartBeats());
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class HrPw : public RideMetric {
|
||||
Q_DECLARE_TR_FUNCTIONS(HrPw)
|
||||
|
||||
|
||||
@@ -106,8 +106,9 @@
|
||||
// 100 05 Feb 2015 Ale Martinez Use duration not time moving when its 0 (rpe metrics)
|
||||
// 101 05 Feb 2015 Mark Liversedge aPower versions of Coggan metrics aNP et al
|
||||
// 102 05 Feb 2015 Mark Liversedge aPower versions of Skiba metrics aBikeScore et al
|
||||
// 103 23 Feb 2015 Mark Liversedge Added total heartbeats
|
||||
|
||||
int DBSchemaVersion = 102;
|
||||
int DBSchemaVersion = 103;
|
||||
|
||||
RideMetricFactory *RideMetricFactory::_instance;
|
||||
QVector<QString> RideMetricFactory::noDeps;
|
||||
|
||||
Reference in New Issue
Block a user