From 4a0674e2042d27d117f01cbdf40ef57c013ffca6 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Thu, 16 Oct 2014 18:33:25 +0100 Subject: [PATCH] Customise Colors for New Series .. Moxy smo2 and thb .. Garmin Running Dynamics .. Gear Ratio --- src/AllPlot.cpp | 58 +++++++++++++++------- src/Colors.cpp | 8 ++- src/Colors.h | 126 +++++++++++++++++++++++++---------------------- src/RideFile.cpp | 12 ++--- 4 files changed, 118 insertions(+), 86 deletions(-) diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index d323cdf87..bfd83f1f7 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -851,16 +851,24 @@ AllPlot::configChanged() QPen npPen = QPen(GColor(CNPOWER)); npPen.setWidth(width); standard->npCurve->setPen(npPen); - - // XXX XXX for now (being lazy) just reuse power for all these new ones - // can come back and add color config later !!!!!! XXX XXX - standard->rvCurve->setPen(npPen); - standard->rcadCurve->setPen(npPen); - standard->rgctCurve->setPen(npPen); - standard->gearCurve->setPen(npPen); - standard->smo2Curve->setPen(npPen); - standard->thbCurve->setPen(npPen); - // XXX XXX + QPen rvPen = QPen(GColor(CRV)); + rvPen.setWidth(width); + standard->rvCurve->setPen(rvPen); + QPen rcadPen = QPen(GColor(CRCAD)); + rcadPen.setWidth(width); + standard->rcadCurve->setPen(rcadPen); + QPen rgctPen = QPen(GColor(CRGCT)); + rgctPen.setWidth(width); + standard->rgctCurve->setPen(rgctPen); + QPen gearPen = QPen(GColor(CGEAR)); + gearPen.setWidth(width); + standard->gearCurve->setPen(gearPen); + QPen smo2Pen = QPen(GColor(CSMO2)); + smo2Pen.setWidth(width); + standard->smo2Curve->setPen(smo2Pen); + QPen thbPen = QPen(GColor(CTHB)); + thbPen.setWidth(width); + standard->thbCurve->setPen(thbPen); QPen antissPen = QPen(GColor(CANTISS)); antissPen.setWidth(width); @@ -5041,18 +5049,30 @@ AllPlot::setPaintBrush(int state) p = standard->npCurve->pen().color(); p.setAlpha(64); standard->npCurve->setBrush(QBrush(p)); - - // XXX !!! all the same - standard->rvCurve->setBrush(QBrush(p)); - standard->rgctCurve->setBrush(QBrush(p)); - standard->rcadCurve->setBrush(QBrush(p)); - standard->gearCurve->setBrush(QBrush(p)); - standard->smo2Curve->setBrush(QBrush(p)); - standard->thbCurve->setBrush(QBrush(p)); - // XXX standard->atissCurve->setBrush(QBrush(p)); standard->antissCurve->setBrush(QBrush(p)); + + p = standard->rvCurve->pen().color(); + p.setAlpha(64); + standard->rvCurve->setBrush(QBrush(p)); + p = standard->rgctCurve->pen().color(); + p.setAlpha(64); + standard->rgctCurve->setBrush(QBrush(p)); + p = standard->rcadCurve->pen().color(); + p.setAlpha(64); + standard->rcadCurve->setBrush(QBrush(p)); + p = standard->gearCurve->pen().color(); + p.setAlpha(64); + standard->gearCurve->setBrush(QBrush(p)); + p = standard->smo2Curve->pen().color(); + p.setAlpha(64); + standard->smo2Curve->setBrush(QBrush(p)); + p = standard->thbCurve->pen().color(); + p.setAlpha(64); + standard->thbCurve->setBrush(QBrush(p)); + + p = standard->xpCurve->pen().color(); p.setAlpha(64); standard->xpCurve->setBrush(QBrush(p)); diff --git a/src/Colors.cpp b/src/Colors.cpp index 2f8bb0d62..f34a403fe 100644 --- a/src/Colors.cpp +++ b/src/Colors.cpp @@ -76,6 +76,13 @@ void GCColor::setupColors() { tr("Altitude Shading"), "COLORALTITUDESHADE", QColor(Qt::lightGray) }, { tr("Wind Speed"), "COLORWINDSPEED", Qt::darkGreen }, { tr("Torque"), "COLORTORQUE", Qt::magenta }, + { tr("Slope"), "CSLOPE", Qt::green }, + { tr("Gear Ratio"), "COLORGEAR", QColor(0xff, 0x90, 0x00) }, + { 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("Load"), "COLORLOAD", Qt::yellow }, { tr("TSS"), "COLORTSS", Qt::green }, { tr("Short Term Stress"), "COLORSTS", Qt::blue }, @@ -142,7 +149,6 @@ void GCColor::setupColors() { tr("Toolbar and Sidebar"), "CCHROME", QColor(108,108,108) }, #endif #endif - { tr("Slope"), "CSLOPE", Qt::black }, { "", "", QColor(0,0,0) }, }; diff --git a/src/Colors.h b/src/Colors.h index 88ca0f152..ef7413c78 100644 --- a/src/Colors.h +++ b/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 85 +#define CNUMOFCFGCOLORS 91 #define CPLOTBACKGROUND 0 #define CRIDEPLOTBACKGROUND 1 @@ -174,64 +174,70 @@ class ColorEngine : public QObject #define CALTITUDEBRUSH 23 #define CWINDSPEED 24 #define CTORQUE 25 -#define CLOAD 26 -#define CTSS 27 -#define CSTS 28 -#define CLTS 29 -#define CSB 30 -#define CDAILYSTRESS 31 -#define CBIKESCORE 32 -#define CCALENDARTEXT 33 -#define CZONE1 34 -#define CZONE2 35 -#define CZONE3 36 -#define CZONE4 37 -#define CZONE5 38 -#define CZONE6 39 -#define CZONE7 40 -#define CZONE8 41 -#define CZONE9 42 -#define CZONE10 43 -#define CHZONE1 44 -#define CHZONE2 45 -#define CHZONE3 46 -#define CHZONE4 47 -#define CHZONE5 48 -#define CHZONE6 49 -#define CHZONE7 50 -#define CHZONE8 51 -#define CHZONE9 52 -#define CHZONE10 53 -#define CAEROVE 54 -#define CAEROEL 55 -#define CCALCELL 56 -#define CCALHEAD 57 -#define CCALCURRENT 58 -#define CCALACTUAL 59 -#define CCALPLANNED 60 -#define CCALTODAY 61 -#define CPOPUP 62 -#define CPOPUPTEXT 63 -#define CTILEBAR 64 -#define CTILEBARSELECT 65 -#define CTOOLBAR 66 -#define CRIDEGROUP 67 -#define CSPINSCANLEFT 68 -#define CSPINSCANRIGHT 69 -#define CTEMP 70 -#define CDIAL 71 -#define CALTPOWER 72 -#define CBALANCELEFT 73 -#define CBALANCERIGHT 74 -#define CWBAL 75 -#define CRIDECP 76 -#define CATISS 77 -#define CANTISS 78 -#define CLTE 79 -#define CRTE 80 -#define CLPS 81 -#define CRPS 82 -#define CCHROME 83 -#define CSLOPE 84 +#define CSLOPE 26 +#define CGEAR 27 +#define CRV 28 +#define CRCAD 29 +#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 #endif diff --git a/src/RideFile.cpp b/src/RideFile.cpp index b5eebab03..1121f5364 100644 --- a/src/RideFile.cpp +++ b/src/RideFile.cpp @@ -167,7 +167,6 @@ RideFile::colorFor(SeriesType series) { switch (series) { case RideFile::cad: return GColor(CCADENCE); - case RideFile::rcad: return GColor(CCADENCE); case RideFile::cadd: return GColor(CCADENCE); case RideFile::hr: return GColor(CHEARTRATE); case RideFile::hrd: return GColor(CHEARTRATE); @@ -195,15 +194,16 @@ RideFile::colorFor(SeriesType series) case RideFile::wprime: return GColor(CWBAL); case RideFile::smo2: return GColor(CWBAL); case RideFile::thb: return GColor(CSPEED); + case RideFile::slope: return GColor(CSLOPE); + case RideFile::rvert: return GColor(CRV); + case RideFile::rcontact: return GColor(CRGCT); + case RideFile::rcad: return GColor(CRCAD); + case RideFile::gear: return GColor(CGEAR); case RideFile::secs: case RideFile::km: case RideFile::vam: case RideFile::lon: case RideFile::lat: - case RideFile::slope: - case RideFile::rvert: - case RideFile::rcontact: - case RideFile::gear: default: return GColor(CPLOTMARKER); } } @@ -1069,7 +1069,7 @@ RideFile::maximumFor(SeriesType series) case rcad : return 500; break; case rvert : return 50; break; case rcontact : return 1000; break; - case gear : return 10; break; + case gear : return 30; break; case wprime : return 99999; break; default : case none : break;