mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
Changed cached paceZoneRange to be sport specific
And use it to compute Run and Swim metrics
This commit is contained in:
@@ -275,7 +275,7 @@ class RTP : public RideMetric {
|
||||
double height = item->ride()->getHeight();
|
||||
|
||||
const PaceZones *zones = item->context->athlete->paceZones();
|
||||
int zoneRange = item->context->athlete->paceZones()->whichRange(item->dateTime.date());
|
||||
int zoneRange = item->paceZoneRange;
|
||||
|
||||
// did user override for this ride?
|
||||
double cv = item->getText("CV","0").toInt();
|
||||
|
||||
@@ -64,7 +64,7 @@ class PaceZoneTime : public RideMetric {
|
||||
seconds = 0;
|
||||
|
||||
const PaceZones *zone = item->context->athlete->paceZones(item->isSwim);
|
||||
int zoneRange = zone ? zone->whichRange(item->dateTime.date()) : -1;
|
||||
int zoneRange = item->paceZoneRange;
|
||||
|
||||
// get zone ranges
|
||||
if (zone && zoneRange >= 0) {
|
||||
|
||||
@@ -471,8 +471,7 @@ RideItem::checkStale()
|
||||
// get the new zone configuration fingerprint that applies for the ride date
|
||||
unsigned long rfingerprint = static_cast<unsigned long>(context->athlete->zones()->getFingerprint(dateTime.date()))
|
||||
+ (appsettings->cvalue(context->athlete->cyclist, GC_USE_CP_FOR_FTP, 0).toInt() ? 1 : 0)
|
||||
+ static_cast<unsigned long>(context->athlete->paceZones(false)->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->paceZones(true)->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->paceZones(isSwim)->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->hrZones()->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->routes->getFingerprint())
|
||||
+ appsettings->cvalue(context->athlete->cyclist, GC_DISCOVERY, 57).toInt(); // 57 does not include search for PEAKS
|
||||
@@ -565,7 +564,7 @@ RideItem::refresh()
|
||||
if (context->athlete->hrZones()) hrZoneRange = context->athlete->hrZones()->whichRange(dateTime.date());
|
||||
else hrZoneRange = -1;
|
||||
|
||||
if (context->athlete->paceZones(true)) paceZoneRange = context->athlete->paceZones(true)->whichRange(dateTime.date());
|
||||
if (context->athlete->paceZones(isSwim)) paceZoneRange = context->athlete->paceZones(isSwim)->whichRange(dateTime.date());
|
||||
else paceZoneRange = -1;
|
||||
|
||||
// refresh metrics etc
|
||||
@@ -597,8 +596,7 @@ RideItem::refresh()
|
||||
// update fingerprints etc, crc done above
|
||||
fingerprint = static_cast<unsigned long>(context->athlete->zones()->getFingerprint(dateTime.date()))
|
||||
+ (appsettings->cvalue(context->athlete->cyclist, GC_USE_CP_FOR_FTP, 0).toInt() ? 1 : 0)
|
||||
+ static_cast<unsigned long>(context->athlete->paceZones(false)->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->paceZones(true)->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->paceZones(isSwim)->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->hrZones()->getFingerprint(dateTime.date()))
|
||||
+ static_cast<unsigned long>(context->athlete->routes->getFingerprint()) +
|
||||
+ appsettings->cvalue(context->athlete->cyclist, GC_DISCOVERY, 57).toInt(); // 57 does not include search for PEAKS
|
||||
|
||||
@@ -218,7 +218,7 @@ class STP : public RideMetric {
|
||||
double weight = item->getWeight();
|
||||
|
||||
const PaceZones *zones = item->context->athlete->paceZones(true);
|
||||
int zoneRange = item->context->athlete->paceZones(true)->whichRange(item->dateTime.date());
|
||||
int zoneRange = item->paceZoneRange;
|
||||
|
||||
// did user override for this ride?
|
||||
double cv = item->getText("CV","0").toInt();
|
||||
|
||||
Reference in New Issue
Block a user