void compute(RideItem *, Specification, const QHash<QString,RideMetric*> &deps) { RideMetric *distance = deps.value("total_distance"); // convert to meters mts = distance->value(true) * 1000.0; setValue(mts); setCount(distance->count()); }
void compute(const RideFile *, const Zones *, int, const HrZones *, int, const QHash<QString,RideMetric*> &deps, const MainWindow *) { assert(deps.contains("coggan_np")); assert(deps.contains("average_hr")); NP *np = dynamic_cast<NP*>(deps.value("coggan_np")); assert(np); RideMetric *ah = dynamic_cast<RideMetric*>(deps.value("average_hr")); assert(ah); ef = np->value(true) / ah->value(true); setValue(ef); }
void compute(const RideFile *, const Zones *, int, const HrZones *, int, const QHash<QString,RideMetric*> &deps, const MainWindow *) { assert(deps.contains("coggan_np")); assert(deps.contains("average_power")); NP *np = dynamic_cast<NP*>(deps.value("coggan_np")); assert(np); RideMetric *ap = dynamic_cast<RideMetric*>(deps.value("average_power")); assert(ap); vi = np->value(true) / ap->value(true); secs = np->count(); setValue(vi); setCount(secs); }
void compute(const RideFile *, const Zones *zones, int zoneRange, const HrZones *, int, const QHash<QString,RideMetric*> &deps, const MainWindow *) { if (!zones || zoneRange < 0) return; assert(deps.contains("coggan_np")); assert(deps.contains("coggan_if")); NP *np = dynamic_cast<NP*>(deps.value("coggan_np")); RideMetric *rif = deps.value("coggan_if"); assert(rif); double normWork = np->value(true) * np->count(); double rawTSS = normWork * rif->value(true); double workInAnHourAtCP = zones->getCP(zoneRange) * 3600; score = rawTSS / workInAnHourAtCP * 100.0; setValue(score); }