mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
isRelevantForRide for Coggan/Skiba metrics
.. so not shown on runs and swims
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "RideMetric.h"
|
||||
#include "RideItem.h"
|
||||
#include "Zones.h"
|
||||
#include <cmath>
|
||||
#include <QApplication>
|
||||
@@ -90,6 +91,7 @@ class XPower : public RideMetric {
|
||||
setValue(xpower);
|
||||
setCount(secs);
|
||||
}
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new XPower(*this); }
|
||||
};
|
||||
|
||||
@@ -128,6 +130,7 @@ class VariabilityIndex : public RideMetric {
|
||||
|
||||
setValue(vi);
|
||||
}
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new VariabilityIndex(*this); }
|
||||
};
|
||||
|
||||
@@ -178,6 +181,7 @@ class RelativeIntensity : public RideMetric {
|
||||
}
|
||||
// end added djconnel
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new RelativeIntensity(*this); }
|
||||
};
|
||||
|
||||
@@ -220,6 +224,7 @@ class CriticalPower : public RideMetric {
|
||||
setValue(other.value(true) > value(true) ? other.value(true) : value(true));
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new CriticalPower(*this); }
|
||||
};
|
||||
|
||||
@@ -266,6 +271,7 @@ class aTISS : public RideMetric {
|
||||
setValue(aTISS);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new aTISS(*this); }
|
||||
};
|
||||
|
||||
@@ -313,6 +319,8 @@ class anTISS : public RideMetric {
|
||||
setValue(anTISS);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
|
||||
RideMetric *clone() const { return new anTISS(*this); }
|
||||
};
|
||||
|
||||
@@ -351,6 +359,7 @@ class dTISS : public RideMetric {
|
||||
else setValue((atscore/(atscore+antscore)) * 100.00f);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new dTISS(*this); }
|
||||
};
|
||||
class BikeScore : public RideMetric {
|
||||
@@ -391,6 +400,7 @@ class BikeScore : public RideMetric {
|
||||
setValue(score);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new BikeScore(*this); }
|
||||
};
|
||||
|
||||
@@ -427,6 +437,7 @@ class ResponseIndex : public RideMetric {
|
||||
|
||||
setValue(ri);
|
||||
}
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new ResponseIndex(*this); }
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "RideMetric.h"
|
||||
#include "RideItem.h"
|
||||
#include "Zones.h"
|
||||
#include <cmath>
|
||||
#include <QApplication>
|
||||
@@ -87,6 +88,7 @@ class NP : public RideMetric {
|
||||
setValue(np);
|
||||
setCount(secs);
|
||||
}
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new NP(*this); }
|
||||
};
|
||||
|
||||
@@ -124,6 +126,7 @@ class VI : public RideMetric {
|
||||
setCount(secs);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new VI(*this); }
|
||||
};
|
||||
|
||||
@@ -161,6 +164,7 @@ class IntensityFactor : public RideMetric {
|
||||
}
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new IntensityFactor(*this); }
|
||||
};
|
||||
|
||||
@@ -199,6 +203,7 @@ class TSS : public RideMetric {
|
||||
setValue(score);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new TSS(*this); }
|
||||
};
|
||||
|
||||
@@ -243,6 +248,7 @@ class TSSPerHour : public RideMetric {
|
||||
setCount(hours);
|
||||
}
|
||||
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new TSSPerHour(*this); }
|
||||
};
|
||||
|
||||
@@ -279,6 +285,7 @@ class EfficiencyFactor : public RideMetric {
|
||||
|
||||
setValue(ef);
|
||||
}
|
||||
bool isRelevantForRide(const RideItem*ride) const { return (!ride->isRun && !ride->isSwim); }
|
||||
RideMetric *clone() const { return new EfficiencyFactor(*this); }
|
||||
};
|
||||
|
||||
|
||||
@@ -1091,7 +1091,7 @@ void NavigatorCellDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||
bool hover = option.state & QStyle::State_MouseOver;
|
||||
bool selected = option.state & QStyle::State_Selected;
|
||||
bool focus = option.state & QStyle::State_HasFocus;
|
||||
bool isRun = rideNavigator->tableView->model()->data(index, Qt::UserRole+2).toBool();
|
||||
//bool isRun = rideNavigator->tableView->model()->data(index, Qt::UserRole+2).toBool();
|
||||
|
||||
// format the cell depending upon what it is...
|
||||
QString columnName = rideNavigator->tableView->model()->headerData(index.column(), Qt::Horizontal).toString();
|
||||
@@ -1152,10 +1152,10 @@ void NavigatorCellDelegate::paint(QPainter *painter, const QStyleOptionViewItem
|
||||
QBrush background = QBrush(GColor(CPLOTBACKGROUND));
|
||||
|
||||
// runs are darker
|
||||
if (isRun) {
|
||||
background.setColor(background.color().darker(150));
|
||||
userColor = userColor.darker(150);
|
||||
}
|
||||
//if (isRun) {
|
||||
//background.setColor(background.color().darker(150));
|
||||
//userColor = userColor.darker(150);
|
||||
//}
|
||||
|
||||
if (columnName != "*") {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user