From 469f49af1df49c1bf093feefec628d7d52c75cd3 Mon Sep 17 00:00:00 2001 From: Mark Liversedge Date: Fri, 12 Feb 2016 17:08:09 +0000 Subject: [PATCH] Target Power Color (CTPOWER) .. so you can customise the color of target power when plotting in train view --- src/Colors.cpp | 1 + src/Colors.h | 149 +++++++++++++++++++------------------ src/ErgFilePlot.cpp | 10 +-- src/WorkoutWidgetItems.cpp | 6 +- 4 files changed, 84 insertions(+), 82 deletions(-) diff --git a/src/Colors.cpp b/src/Colors.cpp index 818f9d724..44a4660b4 100644 --- a/src/Colors.cpp +++ b/src/Colors.cpp @@ -99,6 +99,7 @@ void GCColor::setupColors() { tr("Normalised Power"), "CNPOWER", Qt::magenta }, { tr("Skiba xPower"), "CXPOWER", Qt::magenta }, { tr("Altitude Power"), "CAPOWER", Qt::magenta }, + { tr("Train Target Power"), "CTPOWER", Qt::blue }, { tr("Critical Power"), "COLORCP", Qt::cyan }, { tr("Cadence"), "COLORCADENCE", QColor(0,204,204) }, { tr("Altitude"), "COLORALTITUTDE", QColor(Qt::gray) }, diff --git a/src/Colors.h b/src/Colors.h index ef271dfa0..230502c5a 100644 --- a/src/Colors.h +++ b/src/Colors.h @@ -149,7 +149,7 @@ class ColorEngine : public QObject #define GColor(x) GCColor::getColor(x) // Define how many cconfigurable metric colors are available -#define CNUMOFCFGCOLORS 95 +#define CNUMOFCFGCOLORS 96 #define CPLOTBACKGROUND 0 #define CRIDEPLOTBACKGROUND 1 @@ -173,78 +173,79 @@ class ColorEngine : public QObject #define CNPOWER 19 #define CXPOWER 20 #define CAPOWER 21 -#define CCP 22 -#define CCADENCE 23 -#define CALTITUDE 24 -#define CALTITUDEBRUSH 25 -#define CWINDSPEED 26 -#define CTORQUE 27 -#define CSLOPE 28 -#define CGEAR 29 -#define CRV 30 -#define CRCAD 31 -#define CRGCT 32 -#define CSMO2 33 -#define CTHB 34 -#define CO2HB 35 -#define CHHB 36 -#define CLOAD 37 -#define CTSS 38 -#define CSTS 39 -#define CLTS 40 -#define CSB 41 -#define CDAILYSTRESS 42 -#define CBIKESCORE 43 -#define CCALENDARTEXT 44 -#define CZONE1 45 -#define CZONE2 46 -#define CZONE3 47 -#define CZONE4 48 -#define CZONE5 49 -#define CZONE6 50 -#define CZONE7 51 -#define CZONE8 52 -#define CZONE9 53 -#define CZONE10 54 -#define CHZONE1 55 -#define CHZONE2 56 -#define CHZONE3 57 -#define CHZONE4 58 -#define CHZONE5 59 -#define CHZONE6 60 -#define CHZONE7 61 -#define CHZONE8 62 -#define CHZONE9 63 -#define CHZONE10 64 -#define CAEROVE 65 -#define CAEROEL 66 -#define CCALCELL 67 -#define CCALHEAD 68 -#define CCALCURRENT 69 -#define CCALACTUAL 70 -#define CCALPLANNED 71 -#define CCALTODAY 72 -#define CPOPUP 73 -#define CPOPUPTEXT 74 -#define CTILEBAR 75 -#define CTILEBARSELECT 76 -#define CTOOLBAR 77 -#define CRIDEGROUP 78 -#define CSPINSCANLEFT 79 -#define CSPINSCANRIGHT 80 -#define CTEMP 81 -#define CDIAL 82 -#define CALTPOWER 83 -#define CBALANCELEFT 84 -#define CBALANCERIGHT 85 -#define CWBAL 86 -#define CRIDECP 87 -#define CATISS 88 -#define CANTISS 89 -#define CLTE 90 -#define CRTE 91 -#define CLPS 92 -#define CRPS 93 -#define CCHROME 94 +#define CTPOWER 22 +#define CCP 23 +#define CCADENCE 24 +#define CALTITUDE 25 +#define CALTITUDEBRUSH 26 +#define CWINDSPEED 27 +#define CTORQUE 28 +#define CSLOPE 29 +#define CGEAR 30 +#define CRV 31 +#define CRCAD 32 +#define CRGCT 33 +#define CSMO2 34 +#define CTHB 35 +#define CO2HB 36 +#define CHHB 37 +#define CLOAD 38 +#define CTSS 39 +#define CSTS 40 +#define CLTS 41 +#define CSB 42 +#define CDAILYSTRESS 43 +#define CBIKESCORE 44 +#define CCALENDARTEXT 45 +#define CZONE1 46 +#define CZONE2 47 +#define CZONE3 48 +#define CZONE4 49 +#define CZONE5 50 +#define CZONE6 51 +#define CZONE7 52 +#define CZONE8 53 +#define CZONE9 54 +#define CZONE10 55 +#define CHZONE1 56 +#define CHZONE2 57 +#define CHZONE3 58 +#define CHZONE4 59 +#define CHZONE5 60 +#define CHZONE6 61 +#define CHZONE7 62 +#define CHZONE8 63 +#define CHZONE9 64 +#define CHZONE10 65 +#define CAEROVE 66 +#define CAEROEL 67 +#define CCALCELL 68 +#define CCALHEAD 69 +#define CCALCURRENT 70 +#define CCALACTUAL 71 +#define CCALPLANNED 72 +#define CCALTODAY 73 +#define CPOPUP 74 +#define CPOPUPTEXT 75 +#define CTILEBAR 76 +#define CTILEBARSELECT 77 +#define CTOOLBAR 78 +#define CRIDEGROUP 79 +#define CSPINSCANLEFT 80 +#define CSPINSCANRIGHT 81 +#define CTEMP 82 +#define CDIAL 83 +#define CALTPOWER 84 +#define CBALANCELEFT 85 +#define CBALANCERIGHT 86 +#define CWBAL 87 +#define CRIDECP 88 +#define CATISS 89 +#define CANTISS 90 +#define CLTE 91 +#define CRTE 92 +#define CLPS 93 +#define CRPS 94 +#define CCHROME 95 #endif diff --git a/src/ErgFilePlot.cpp b/src/ErgFilePlot.cpp index 52de02030..8de86d2aa 100644 --- a/src/ErgFilePlot.cpp +++ b/src/ErgFilePlot.cpp @@ -159,10 +159,10 @@ ErgFilePlot::ErgFilePlot(Context *context) : context(context) LodCurve->setYAxis(QwtPlot::yLeft); // load curve is blue for time and grey for gradient - QColor brush_color = QColor(Qt::blue); + QColor brush_color = QColor(GColor(CTPOWER)); brush_color.setAlpha(64); LodCurve->setBrush(brush_color); // fill below the line - QPen Lodpen = QPen(Qt::blue, 1.0); + QPen Lodpen = QPen(GColor(CTPOWER), 1.0); LodCurve->setPen(Lodpen); wbalCurvePredict = new QwtPlotCurve("W'bal Predict"); @@ -330,9 +330,9 @@ ErgFilePlot::setData(ErgFile *ergfile) } else { - QColor brush_color1 = QColor(Qt::blue); + QColor brush_color1 = QColor(GColor(CTPOWER)); brush_color1.setAlpha(200); - QColor brush_color2 = QColor(Qt::blue); + QColor brush_color2 = QColor(GColor(CTPOWER)); brush_color2.setAlpha(64); QLinearGradient linearGradient(0, 0, 0, height()); @@ -341,7 +341,7 @@ ErgFilePlot::setData(ErgFile *ergfile) linearGradient.setSpread(QGradient::PadSpread); LodCurve->setBrush(linearGradient); // fill below the line - QPen Lodpen = QPen(Qt::blue, 1.0); + QPen Lodpen = QPen(GColor(CTPOWER), 1.0); LodCurve->setPen(Lodpen); } diff --git a/src/WorkoutWidgetItems.cpp b/src/WorkoutWidgetItems.cpp index c02794b88..c9d14d47f 100644 --- a/src/WorkoutWidgetItems.cpp +++ b/src/WorkoutWidgetItems.cpp @@ -316,7 +316,7 @@ void WWLine::paint(QPainter *painter) { // thin ? - QPen linePen(workoutWidget()->recording() ? QColor(Qt::blue) : GColor(CPOWER)); + QPen linePen(workoutWidget()->recording() ? GColor(CTPOWER) : GColor(CPOWER)); linePen.setWidth(1); painter->setPen(linePen); @@ -350,9 +350,9 @@ WWLine::paint(QPainter *painter) // now fill painter->setPen(Qt::NoPen); - QColor brush_color1 = QColor(Qt::blue); + QColor brush_color1 = QColor(GColor(CTPOWER)); brush_color1.setAlpha(200); - QColor brush_color2 = QColor(Qt::blue); + QColor brush_color2 = QColor(GColor(CTPOWER)); brush_color2.setAlpha(64); QLinearGradient linearGradient(0, 0, 0, workoutWidget()->transform(0,0).y());