QA/2d customise symbol color

Let the user define the color used for the symbols on the PfPv
and Scatter plot when framing intervals.
This commit is contained in:
Mark Liversedge
2013-02-24 17:30:58 +00:00
parent f2aaba888c
commit f2d9b42ff1
4 changed files with 72 additions and 70 deletions

View File

@@ -40,6 +40,7 @@ void GCColor::setupColors()
Colors init[CNUMOFCFGCOLORS+1] = { Colors init[CNUMOFCFGCOLORS+1] = {
{ tr("Plot Background"), "COLORPLOTBACKGROUND", Qt::white }, { tr("Plot Background"), "COLORPLOTBACKGROUND", Qt::white },
{ tr("Ride Plot Background"), "COLORRIDEPLOTBACKGROUND", Qt::black }, { tr("Ride Plot Background"), "COLORRIDEPLOTBACKGROUND", Qt::black },
{ tr("Plot Symbols"), "COLORRIDEPLOTSYMBOLS", Qt::gray },
{ tr("Ride Plot X Axis"), "COLORRIDEPLOTXAXIS", Qt::blue }, { tr("Ride Plot X Axis"), "COLORRIDEPLOTXAXIS", Qt::blue },
{ tr("Ride Plot Y Axis"), "COLORRIDEPLOTYAXIS", Qt::red }, { tr("Ride Plot Y Axis"), "COLORRIDEPLOTYAXIS", Qt::red },
{ tr("Plot Thumbnail Background"), "COLORPLOTTHUMBNAIL", Qt::gray }, { tr("Plot Thumbnail Background"), "COLORPLOTTHUMBNAIL", Qt::gray },

View File

@@ -99,76 +99,77 @@ class ColorEngine : public QObject
#define GColor(x) GCColor::getColor(x) #define GColor(x) GCColor::getColor(x)
// Define how many cconfigurable metric colors are available // Define how many cconfigurable metric colors are available
#define CNUMOFCFGCOLORS 69 #define CNUMOFCFGCOLORS 70
#define CPLOTBACKGROUND 0 #define CPLOTBACKGROUND 0
#define CRIDEPLOTBACKGROUND 1 #define CRIDEPLOTBACKGROUND 1
#define CRIDEPLOTXAXIS 2 #define CPLOTSYMBOL 2
#define CRIDEPLOTYAXIS 3 #define CRIDEPLOTXAXIS 3
#define CPLOTTHUMBNAIL 4 #define CRIDEPLOTYAXIS 4
#define CPLOTTITLE 5 #define CPLOTTHUMBNAIL 5
#define CPLOTSELECT 6 #define CPLOTTITLE 6
#define CPLOTTRACKER 7 #define CPLOTSELECT 7
#define CPLOTMARKER 8 #define CPLOTTRACKER 8
#define CPLOTGRID 9 #define CPLOTMARKER 9
#define CINTERVALHIGHLIGHTER 10 #define CPLOTGRID 10
#define CHEARTRATE 11 #define CINTERVALHIGHLIGHTER 11
#define CSPEED 12 #define CHEARTRATE 12
#define CPOWER 13 #define CSPEED 13
#define CCP 14 #define CPOWER 14
#define CCADENCE 15 #define CCP 15
#define CALTITUDE 16 #define CCADENCE 16
#define CALTITUDEBRUSH 17 #define CALTITUDE 17
#define CWINDSPEED 18 #define CALTITUDEBRUSH 18
#define CTORQUE 19 #define CWINDSPEED 19
#define CLOAD 20 #define CTORQUE 20
#define CTSS 21 #define CLOAD 21
#define CSTS 22 #define CTSS 22
#define CLTS 23 #define CSTS 23
#define CSB 24 #define CLTS 24
#define CDAILYSTRESS 25 #define CSB 25
#define CBIKESCORE 26 #define CDAILYSTRESS 26
#define CCALENDARTEXT 27 #define CBIKESCORE 27
#define CZONE1 28 #define CCALENDARTEXT 28
#define CZONE2 29 #define CZONE1 29
#define CZONE3 30 #define CZONE2 30
#define CZONE4 31 #define CZONE3 31
#define CZONE5 32 #define CZONE4 32
#define CZONE6 33 #define CZONE5 33
#define CZONE7 34 #define CZONE6 34
#define CZONE8 35 #define CZONE7 35
#define CZONE9 36 #define CZONE8 36
#define CZONE10 37 #define CZONE9 37
#define CHZONE1 38 #define CZONE10 38
#define CHZONE2 39 #define CHZONE1 39
#define CHZONE3 40 #define CHZONE2 40
#define CHZONE4 41 #define CHZONE3 41
#define CHZONE5 42 #define CHZONE4 42
#define CHZONE6 43 #define CHZONE5 43
#define CHZONE7 44 #define CHZONE6 44
#define CHZONE8 45 #define CHZONE7 45
#define CHZONE9 46 #define CHZONE8 46
#define CHZONE10 47 #define CHZONE9 47
#define CAEROVE 48 #define CHZONE10 48
#define CAEROEL 49 #define CAEROVE 49
#define CCALCELL 50 #define CAEROEL 50
#define CCALHEAD 51 #define CCALCELL 51
#define CCALCURRENT 52 #define CCALHEAD 52
#define CCALACTUAL 53 #define CCALCURRENT 53
#define CCALPLANNED 54 #define CCALACTUAL 54
#define CCALTODAY 55 #define CCALPLANNED 55
#define CPOPUP 56 #define CCALTODAY 56
#define CPOPUPTEXT 57 #define CPOPUP 57
#define CTILEBAR 58 #define CPOPUPTEXT 58
#define CTILEBARSELECT 59 #define CTILEBAR 59
#define CTOOLBAR 60 #define CTILEBARSELECT 60
#define CRIDEGROUP 61 #define CTOOLBAR 61
#define CSPINSCANLEFT 62 #define CRIDEGROUP 62
#define CSPINSCANRIGHT 63 #define CSPINSCANLEFT 63
#define CTEMP 64 #define CSPINSCANRIGHT 64
#define CDIAL 65 #define CTEMP 65
#define CALTPOWER 66 #define CDIAL 66
#define CBALANCELEFT 67 #define CALTPOWER 67
#define CBALANCERIGHT 68 #define CBALANCELEFT 68
#define CBALANCERIGHT 69
#endif #endif

View File

@@ -193,7 +193,7 @@ PfPvPlot::configChanged()
QwtSymbol sym; QwtSymbol sym;
sym.setStyle(QwtSymbol::Ellipse); sym.setStyle(QwtSymbol::Ellipse);
sym.setSize(6); sym.setSize(6);
sym.setPen(QPen(Qt::gray)); sym.setPen(QPen(GColor(CPLOTSYMBOL)));
sym.setBrush(QBrush(Qt::NoBrush)); sym.setBrush(QBrush(Qt::NoBrush));
curve->setSymbol(new QwtSymbol(sym)); curve->setSymbol(new QwtSymbol(sym));
curve->setStyle(QwtPlotCurve::Dots); curve->setStyle(QwtPlotCurve::Dots);

View File

@@ -218,7 +218,7 @@ void ScatterPlot::setData (ScatterSettings *settings)
sym.setPen(GCColor::invert(GColor(CPLOTBACKGROUND))); sym.setPen(GCColor::invert(GColor(CPLOTBACKGROUND)));
sym.setBrush(QBrush(Qt::NoBrush)); sym.setBrush(QBrush(Qt::NoBrush));
QPen p; QPen p;
p.setColor(Qt::gray); p.setColor(GColor(CPLOTSYMBOL));
sym.setPen(p); sym.setPen(p);
// wipe away existing // wipe away existing