mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
Add HHb and O2Hb derived series
.. to split oxy/deoxy haemoglobin .. need to add to ride chart too
This commit is contained in:
@@ -81,8 +81,10 @@ void GCColor::setupColors()
|
||||
{ tr("Run Vertical Oscillation"), "COLORRVERT", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors
|
||||
{ tr("Run Cadence"), "COLORRCAD", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors
|
||||
{ tr("Run Ground Contact"), "COLORGCT", QColor(0xff, 0x90, 0x00) }, // same as garmin connect colors
|
||||
{ tr("Muscle Oxygen (SmO2)"), "COLORSMO2", QColor(0x33, 0x99, 0xff) }, // same as moxy monitor
|
||||
{ tr("Hameoglobin Mass (tHb)"), "COLORTHB", QColor(0xff,0xcc,0x33) },
|
||||
{ tr("Muscle Oxygen (SmO2)"), "COLORSMO2", QColor(0x00, 0x89, 0x77) }, // green same as moxy monitor
|
||||
{ tr("Haemoglobin Mass (tHb)"), "COLORTHB", QColor(0xa3,0x44,0x02) }, // brown same as moxy monitor
|
||||
{ tr("Oxygenated Haemoglobin (O2Hb)"), "CO2HB", QColor(0xd1,0x05,0x72) },
|
||||
{ tr("Deoxygenated Haemoglobin (HHb)"), "CHHB", QColor(0x00,0x7f,0xcc) },
|
||||
{ tr("Load"), "COLORLOAD", Qt::yellow },
|
||||
{ tr("TSS"), "COLORTSS", Qt::green },
|
||||
{ tr("Short Term Stress"), "COLORSTS", Qt::blue },
|
||||
|
||||
120
src/Colors.h
120
src/Colors.h
@@ -146,7 +146,7 @@ class ColorEngine : public QObject
|
||||
#define GColor(x) GCColor::getColor(x)
|
||||
|
||||
// Define how many cconfigurable metric colors are available
|
||||
#define CNUMOFCFGCOLORS 91
|
||||
#define CNUMOFCFGCOLORS 93
|
||||
|
||||
#define CPLOTBACKGROUND 0
|
||||
#define CRIDEPLOTBACKGROUND 1
|
||||
@@ -181,63 +181,65 @@ class ColorEngine : public QObject
|
||||
#define CRGCT 30
|
||||
#define CSMO2 31
|
||||
#define CTHB 32
|
||||
#define CLOAD 33
|
||||
#define CTSS 34
|
||||
#define CSTS 35
|
||||
#define CLTS 36
|
||||
#define CSB 37
|
||||
#define CDAILYSTRESS 38
|
||||
#define CBIKESCORE 39
|
||||
#define CCALENDARTEXT 40
|
||||
#define CZONE1 41
|
||||
#define CZONE2 42
|
||||
#define CZONE3 43
|
||||
#define CZONE4 44
|
||||
#define CZONE5 45
|
||||
#define CZONE6 46
|
||||
#define CZONE7 47
|
||||
#define CZONE8 48
|
||||
#define CZONE9 49
|
||||
#define CZONE10 50
|
||||
#define CHZONE1 51
|
||||
#define CHZONE2 52
|
||||
#define CHZONE3 53
|
||||
#define CHZONE4 54
|
||||
#define CHZONE5 55
|
||||
#define CHZONE6 56
|
||||
#define CHZONE7 57
|
||||
#define CHZONE8 58
|
||||
#define CHZONE9 59
|
||||
#define CHZONE10 60
|
||||
#define CAEROVE 61
|
||||
#define CAEROEL 62
|
||||
#define CCALCELL 63
|
||||
#define CCALHEAD 64
|
||||
#define CCALCURRENT 65
|
||||
#define CCALACTUAL 66
|
||||
#define CCALPLANNED 67
|
||||
#define CCALTODAY 68
|
||||
#define CPOPUP 69
|
||||
#define CPOPUPTEXT 70
|
||||
#define CTILEBAR 71
|
||||
#define CTILEBARSELECT 72
|
||||
#define CTOOLBAR 73
|
||||
#define CRIDEGROUP 74
|
||||
#define CSPINSCANLEFT 75
|
||||
#define CSPINSCANRIGHT 76
|
||||
#define CTEMP 77
|
||||
#define CDIAL 78
|
||||
#define CALTPOWER 79
|
||||
#define CBALANCELEFT 80
|
||||
#define CBALANCERIGHT 81
|
||||
#define CWBAL 82
|
||||
#define CRIDECP 83
|
||||
#define CATISS 84
|
||||
#define CANTISS 85
|
||||
#define CLTE 86
|
||||
#define CRTE 87
|
||||
#define CLPS 88
|
||||
#define CRPS 89
|
||||
#define CCHROME 90
|
||||
#define CO2HB 33
|
||||
#define CHHB 34
|
||||
#define CLOAD 35
|
||||
#define CTSS 36
|
||||
#define CSTS 37
|
||||
#define CLTS 38
|
||||
#define CSB 39
|
||||
#define CDAILYSTRESS 40
|
||||
#define CBIKESCORE 41
|
||||
#define CCALENDARTEXT 42
|
||||
#define CZONE1 43
|
||||
#define CZONE2 44
|
||||
#define CZONE3 45
|
||||
#define CZONE4 46
|
||||
#define CZONE5 47
|
||||
#define CZONE6 48
|
||||
#define CZONE7 49
|
||||
#define CZONE8 50
|
||||
#define CZONE9 51
|
||||
#define CZONE10 52
|
||||
#define CHZONE1 53
|
||||
#define CHZONE2 54
|
||||
#define CHZONE3 55
|
||||
#define CHZONE4 56
|
||||
#define CHZONE5 57
|
||||
#define CHZONE6 58
|
||||
#define CHZONE7 59
|
||||
#define CHZONE8 60
|
||||
#define CHZONE9 61
|
||||
#define CHZONE10 62
|
||||
#define CAEROVE 63
|
||||
#define CAEROEL 64
|
||||
#define CCALCELL 65
|
||||
#define CCALHEAD 66
|
||||
#define CCALCURRENT 67
|
||||
#define CCALACTUAL 68
|
||||
#define CCALPLANNED 69
|
||||
#define CCALTODAY 70
|
||||
#define CPOPUP 71
|
||||
#define CPOPUPTEXT 72
|
||||
#define CTILEBAR 73
|
||||
#define CTILEBARSELECT 74
|
||||
#define CTOOLBAR 75
|
||||
#define CRIDEGROUP 76
|
||||
#define CSPINSCANLEFT 77
|
||||
#define CSPINSCANRIGHT 78
|
||||
#define CTEMP 79
|
||||
#define CDIAL 80
|
||||
#define CALTPOWER 81
|
||||
#define CBALANCELEFT 82
|
||||
#define CBALANCERIGHT 83
|
||||
#define CWBAL 84
|
||||
#define CRIDECP 85
|
||||
#define CATISS 86
|
||||
#define CANTISS 87
|
||||
#define CLTE 88
|
||||
#define CRTE 89
|
||||
#define CLPS 90
|
||||
#define CRPS 91
|
||||
#define CCHROME 92
|
||||
|
||||
#endif
|
||||
|
||||
@@ -155,6 +155,8 @@ RideFile::seriesName(SeriesType series)
|
||||
case RideFile::wprime: return QString(tr("W' balance"));
|
||||
case RideFile::smo2: return QString(tr("SmO2"));
|
||||
case RideFile::thb: return QString(tr("THb"));
|
||||
case RideFile::o2hb: return QString(tr("O2Hb"));
|
||||
case RideFile::hhb: return QString(tr("HHb"));
|
||||
case RideFile::rvert: return QString(tr("Vertical Oscillation"));
|
||||
case RideFile::rcad: return QString(tr("Run Cadence"));
|
||||
case RideFile::rcontact: return QString(tr("GCT"));
|
||||
@@ -193,8 +195,10 @@ RideFile::colorFor(SeriesType series)
|
||||
case RideFile::interval: return QColor(Qt::white);
|
||||
case RideFile::wattsKg: return GColor(CPOWER);
|
||||
case RideFile::wprime: return GColor(CWBAL);
|
||||
case RideFile::smo2: return GColor(CWBAL);
|
||||
case RideFile::thb: return GColor(CSPEED);
|
||||
case RideFile::smo2: return GColor(CSMO2);
|
||||
case RideFile::thb: return GColor(CTHB);
|
||||
case RideFile::o2hb: return GColor(CO2HB);
|
||||
case RideFile::hhb: return GColor(CHHB);
|
||||
case RideFile::slope: return GColor(CSLOPE);
|
||||
case RideFile::rvert: return GColor(CRV);
|
||||
case RideFile::rcontact: return GColor(CRGCT);
|
||||
@@ -249,6 +253,8 @@ RideFile::unitName(SeriesType series, Context *context)
|
||||
case RideFile::wprime: return QString(useMetricUnits ? tr("joules") : tr("joules"));
|
||||
case RideFile::smo2: return QString(tr("%"));
|
||||
case RideFile::thb: return QString(tr("g/dL"));
|
||||
case RideFile::o2hb: return QString(tr(""));
|
||||
case RideFile::hhb: return QString(tr(""));
|
||||
case RideFile::rcad: return QString(tr("spm"));
|
||||
case RideFile::rvert: return QString(tr("cm"));
|
||||
case RideFile::rcontact: return QString(tr("ms"));
|
||||
@@ -935,6 +941,8 @@ RideFilePoint::value(RideFile::SeriesType series) const
|
||||
case RideFile::rps : return rps; break;
|
||||
case RideFile::thb : return thb; break;
|
||||
case RideFile::smo2 : return smo2; break;
|
||||
case RideFile::o2hb : return o2hb; break;
|
||||
case RideFile::hhb : return hhb; break;
|
||||
case RideFile::rcad : return rcad; break;
|
||||
case RideFile::rvert : return rvert; break;
|
||||
case RideFile::rcontact : return rcontact; break;
|
||||
@@ -1527,6 +1535,14 @@ RideFile::recalculateDerivedSeries()
|
||||
p->gear = 0.0f;
|
||||
}
|
||||
|
||||
// split out O2Hb and HHb when we have SmO2 and tHb
|
||||
// O2Hb is oxygenated haemoglobin and HHb is deoxygenated haemoglobin
|
||||
if (dataPresent.smo2 && dataPresent.thb && p->thb && p->smo2) {
|
||||
|
||||
p->o2hb = p->thb * p->smo2 / 100;
|
||||
p->hhb = p->thb - p->o2hb;
|
||||
}
|
||||
|
||||
// last point
|
||||
lastP = p;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ struct RideFileDataPresent
|
||||
bool lrbalance, lte, rte, lps, rps, smo2, thb, interval;
|
||||
|
||||
// derived
|
||||
bool np,xp,apower,wprime,atiss,antiss,gear;
|
||||
bool np,xp,apower,wprime,atiss,antiss,gear,hhb,o2hb;
|
||||
|
||||
// running
|
||||
bool rvert, rcad, rcontact;
|
||||
@@ -73,7 +73,7 @@ struct RideFileDataPresent
|
||||
kph(false), nm(false), watts(false), alt(false), lon(false), lat(false),
|
||||
headwind(false), slope(false), temp(false),
|
||||
lrbalance(false), lte(false), rte(false), lps(false), rps(false), smo2(false), thb(false), interval(false),
|
||||
np(false), xp(false), apower(false), wprime(false), atiss(false), antiss(false),gear(false),
|
||||
np(false), xp(false), apower(false), wprime(false), atiss(false), antiss(false),gear(false),hhb(false),o2hb(false),
|
||||
rvert(false), rcad(false), rcontact(false) {}
|
||||
|
||||
};
|
||||
@@ -128,7 +128,7 @@ class RideFile : public QObject // QObject to emit signals
|
||||
alt, lon, lat, headwind, slope, temp, interval, NP, xPower,
|
||||
vam, wattsKg, lrbalance, lte, rte, lps, rps,
|
||||
aPower, wprime, aTISS, anTISS, smo2, thb,
|
||||
rvert, rcad, rcontact, gear, none };
|
||||
rvert, rcad, rcontact, gear, o2hb, hhb, none };
|
||||
|
||||
enum specialValues { NoTemp = -255 };
|
||||
|
||||
@@ -309,7 +309,7 @@ struct RideFilePoint
|
||||
|
||||
// derived data (we calculate it)
|
||||
// xPower, normalised power, aPower
|
||||
double xp, np, apower, atiss, antiss, gear;
|
||||
double xp, np, apower, atiss, antiss, gear, hhb, o2hb;
|
||||
|
||||
// create blank point
|
||||
RideFilePoint() : secs(0.0), cad(0.0), hr(0.0), km(0.0), kph(0.0), nm(0.0),
|
||||
@@ -320,7 +320,7 @@ struct RideFilePoint
|
||||
hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0),
|
||||
rvert(0.0), rcad(0.0), rcontact(0.0),
|
||||
interval(0), xp(0), np(0),
|
||||
apower(0), atiss(0.0), antiss(0.0), gear(0.0) {}
|
||||
apower(0), atiss(0.0), antiss(0.0), gear(0.0), hhb(0.0), o2hb(0.0) {}
|
||||
|
||||
// create point supplying all values
|
||||
RideFilePoint(double secs, double cad, double hr, double km, double kph,
|
||||
@@ -337,7 +337,7 @@ struct RideFilePoint
|
||||
smo2(smo2), thb(thb),
|
||||
hrd(0.0), cadd(0.0), kphd(0.0), nmd(0.0), wattsd(0.0),
|
||||
rvert(rvert), rcad(rcad), rcontact(rcontact), interval(interval),
|
||||
xp(0), np(0), apower(0), atiss(0.0), antiss(0.0), gear(0.0) {}
|
||||
xp(0), np(0), apower(0), atiss(0.0), antiss(0.0), gear(0.0),hhb(0.0),o2hb(0.0) {}
|
||||
|
||||
// get the value via the series type rather than access direct to the values
|
||||
double value(RideFile::SeriesType series) const;
|
||||
|
||||
Reference in New Issue
Block a user