diff --git a/Graphs/gFlagsLine.cpp b/Graphs/gFlagsLine.cpp index 886274e9..d2f04dd7 100644 --- a/Graphs/gFlagsLine.cpp +++ b/Graphs/gFlagsLine.cpp @@ -12,8 +12,6 @@ gFlagsGroup::gFlagsGroup() { - //static QColor col=Qt::black; - addVertexBuffer(quads=new gVertexBuffer(512,GL_QUADS)); addVertexBuffer(lines=new gVertexBuffer(20,GL_LINE_LOOP)); quads->setAntiAlias(true); @@ -72,13 +70,11 @@ void gFlagsGroup::paint(gGraph &w, int left, int top, int width, int height) m_barh=float(height)/float(vis); float linetop=top; - static QColor col1=QColor(0xd0,0xff,0xd0,0xff); - static QColor col2=QColor(0xff,0xff,0xff,0xff); - QColor * barcol; + QColor barcol; for (int i=0;iadd(left, linetop, left, linetop+m_barh, left+width-1, linetop+m_barh, left+width-1, linetop, barcol->rgba()); + if (i & 1) barcol=COLOR_ALT_BG1; else barcol=COLOR_ALT_BG2; + quads->add(left, linetop, left, linetop+m_barh, left+width-1, linetop+m_barh, left+width-1, linetop, barcol.rgba()); // Paint the actual flags lvisible[i]->paint(w,left,linetop,width,m_barh); @@ -86,11 +82,10 @@ void gFlagsGroup::paint(gGraph &w, int left, int top, int width, int height) } gVertexBuffer *outlines=w.lines(); - QColor blk=Qt::black; - outlines->add(left-1, top, left-1, top+height, blk.rgba()); - outlines->add(left-1, top+height, left+width,top+height, blk.rgba()); - outlines->add(left+width,top+height, left+width, top,blk.rgba()); - outlines->add(left+width, top, left-1, top, blk.rgba()); + outlines->add(left-1, top, left-1, top+height, COLOR_Outline.rgba()); + outlines->add(left-1, top+height, left+width,top+height, COLOR_Outline.rgba()); + outlines->add(left+width,top+height, left+width, top,COLOR_Outline.rgba()); + outlines->add(left+width, top, left-1, top, COLOR_Outline.rgba()); //lines->add(left-1, top, left-1, top+height); //lines->add(left+width, top+height, left+width, top); diff --git a/Graphs/gFooBar.h b/Graphs/gFooBar.h index 9e0a7d2c..d46bfee6 100644 --- a/Graphs/gFooBar.h +++ b/Graphs/gFooBar.h @@ -15,7 +15,7 @@ class gShadowArea:public Layer { public: - gShadowArea(QColor shadow_color=QColor(40,40,40,40),QColor line_color=QColor("blue")); + gShadowArea(QColor shadow_color=QColor(40,40,40,40),QColor line_color=Qt::blue); virtual ~gShadowArea(); virtual void paint(gGraph & w,int left, int top, int width, int height); protected: diff --git a/Graphs/gLineChart.cpp b/Graphs/gLineChart.cpp index 1634c992..bef67ed5 100644 --- a/Graphs/gLineChart.cpp +++ b/Graphs/gLineChart.cpp @@ -630,7 +630,7 @@ void gLineChart::paint(gGraph & w,int left, int top, int width, int height) } -AHIChart::AHIChart(const QColor col) +AHIChart::AHIChart(QColor col) :Layer(NoChannel),m_color(col) { m_miny=m_maxy=0; diff --git a/Graphs/gLineChart.h b/Graphs/gLineChart.h index 28832d86..fdcee3bb 100644 --- a/Graphs/gLineChart.h +++ b/Graphs/gLineChart.h @@ -20,7 +20,7 @@ class AHIChart:public Layer { public: //! \brief Constructs an AHIChart object, with QColor col for the line plots. - AHIChart(const QColor col=QColor("black")); + AHIChart(QColor col=QColor("black")); ~AHIChart(); //! \brief Draws the precalculated data to the Vertex buffers diff --git a/Graphs/gXAxis.h b/Graphs/gXAxis.h index d0e21abf..66bc5126 100644 --- a/Graphs/gXAxis.h +++ b/Graphs/gXAxis.h @@ -13,7 +13,7 @@ class gXAxis:public Layer { public: - gXAxis(QColor col=QColor("black"),bool fadeout=true); + gXAxis(QColor col=Qt::black,bool fadeout=true); virtual ~gXAxis(); virtual void paint(gGraph & w,int left,int top, int width, int height); static const int Margin=20; // How much room does this take up. (Bottom margin) diff --git a/Graphs/gYAxis.h b/Graphs/gYAxis.h index 0e482125..5631828b 100644 --- a/Graphs/gYAxis.h +++ b/Graphs/gYAxis.h @@ -65,7 +65,7 @@ class gYAxis:public Layer { public: //! \brief Construct a gYAxis object, with QColor col for tickers & text - gYAxis(QColor col=QColor("black")); + gYAxis(QColor col=Qt::black); virtual ~gYAxis(); //! \brief Draw the horizontal tickers display diff --git a/Graphs/glcommon.h b/Graphs/glcommon.h index 509e3dc8..b3d6481d 100644 --- a/Graphs/glcommon.h +++ b/Graphs/glcommon.h @@ -10,6 +10,39 @@ #include #include +const QColor COLOR_Black=Qt::black; +const QColor COLOR_LightGreen=QColor("light green"); +const QColor COLOR_DarkGreen=Qt::darkGreen; +const QColor COLOR_Purple=QColor("purple"); +const QColor COLOR_Aqua=QColor("#40c0ff"); +const QColor COLOR_Magenta=Qt::magenta; +const QColor COLOR_Blue=Qt::blue; +const QColor COLOR_LightBlue=QColor("light blue"); +const QColor COLOR_Gray=Qt::gray; +const QColor COLOR_LightGray=Qt::lightGray; +const QColor COLOR_DarkGray=Qt::darkGray; +const QColor COLOR_Cyan=Qt::cyan; +const QColor COLOR_DarkCyan=Qt::darkCyan; +const QColor COLOR_DarkBlue=Qt::darkBlue; +const QColor COLOR_DarkMagenta=Qt::darkMagenta; +const QColor COLOR_Gold=QColor("gold"); +const QColor COLOR_White=Qt::white; +const QColor COLOR_Red=Qt::red; +const QColor COLOR_Pink=QColor("pink"); +const QColor COLOR_DarkRed=Qt::darkRed; +const QColor COLOR_Yellow=Qt::yellow; +const QColor COLOR_DarkYellow=Qt::darkYellow; +const QColor COLOR_Orange=QColor("orange"); +const QColor COLOR_Green=Qt::green; +const QColor COLOR_Brown=QColor("brown"); + +const QColor COLOR_Text=Qt::black; +const QColor COLOR_Outline=Qt::black; + +const QColor COLOR_ALT_BG1=QColor(0xd8,0xff,0xd8,0xff); // Alternating Background Color 1 (Event Flags) +const QColor COLOR_ALT_BG2=COLOR_White; // Alternating Background Color 2 (Event Flags) + + /*! \brief Draw an outline of a rounded rectangle \param radius Radius of corner rounding \param lw Line Width diff --git a/SleepLib/common.h b/SleepLib/common.h index 45f46e67..82080b25 100644 --- a/SleepLib/common.h +++ b/SleepLib/common.h @@ -2,6 +2,7 @@ #define COMMON_H #include +#include #include #include "version.h" @@ -133,10 +134,15 @@ const QString STR_TR_VS=QObject::tr("VS"); // Short form of Vibratory Snore const QString STR_TR_VS2=QObject::tr("VS2"); // Short form of Secondary Vibratory Snore (Some Philips Respironics Machines have two sources) const QString STR_TR_RERA=QObject::tr("RERA"); // Acronym for Respiratory Effort Related Arousal const QString STR_TR_PP=QObject::tr("PP"); // Short form for Pressure Pulse +const QString STR_TR_P=QObject::tr("P"); // Short form for Pressure Event const QString STR_TR_RE=QObject::tr("RE"); // Short form of Respiratory Effort Related Arousal +const QString STR_TR_NR=QObject::tr("NR"); // Short form of Non Responding event? (forgot sorry) const QString STR_TR_NRI=QObject::tr("NRI"); // Sorry I Forgot.. it's a flag on Intellipap machines const QString STR_TR_O2=QObject::tr("O2"); // SpO2 Desaturation const QString STR_TR_PC=QObject::tr("PC"); // Short form for Pulse Change +const QString STR_TR_UF1=QObject::tr("UF1"); // Short form for User Flag 1 +const QString STR_TR_UF2=QObject::tr("UF2"); // Short form for User Flag 2 +const QString STR_TR_UF3=QObject::tr("UF3"); // Short form for User Flag 3 @@ -205,6 +211,7 @@ const QString STR_TR_WakeUp=QObject::tr("Wake-up"); const QString STR_TR_MaskTime=QObject::tr("Mask Time"); const QString STR_TR_Unknown=QObject::tr("Unknown"); const QString STR_TR_None=QObject::tr("None"); +const QString STR_TR_Ready=QObject::tr("Ready"); const QString STR_TR_First=QObject::tr("First"); const QString STR_TR_Last=QObject::tr("Last"); @@ -221,6 +228,4 @@ const QString STR_TR_Median=QObject::tr("Median"); const QString STR_TR_Avg=QObject::tr("Avg"); // Average const QString STR_TR_WAvg=QObject::tr("W-Avg"); // Weighted Average - - #endif // COMMON_H diff --git a/common_gui.cpp b/common_gui.cpp index 78450932..5f90a4ad 100644 --- a/common_gui.cpp +++ b/common_gui.cpp @@ -25,6 +25,7 @@ void sh_delay(int ms) #endif + #if (QT_VERSION >= QT_VERSION_CHECK(4,8,0)) // Qt 4.8 makes this a whole lot easier Qt::DayOfWeek firstDayOfWeekFromLocale() @@ -80,6 +81,54 @@ Qt::DayOfWeek firstDayOfWeekFromLocale() #endif return firstDay; } - #endif + +// Flag Colors +QColor COLOR_Hypopnea=Qt::blue; +QColor COLOR_Obstructive=COLOR_Aqua; +QColor COLOR_Apnea=Qt::darkGreen; +QColor COLOR_CSR=COLOR_LightGreen; +QColor COLOR_ClearAirway=QColor("#b254cd"); +QColor COLOR_RERA=COLOR_Gold; +QColor COLOR_VibratorySnore=QColor("#ff4040"); +QColor COLOR_FlowLimit=QColor("#404040"); +QColor COLOR_LeakFlag=QColor("#40c0c0"); //Qt::darkBlue; +QColor COLOR_NRI=Qt::darkMagenta; +QColor COLOR_ExP=Qt::darkCyan; +QColor COLOR_PressurePulse=Qt::red; +QColor COLOR_PulseChange=COLOR_LightGray; +QColor COLOR_SPO2Drop=COLOR_LightBlue; +QColor COLOR_UserFlag1=QColor("#e0e0e0"); + +// Chart Colors +QColor COLOR_EPAP=Qt::blue; +QColor COLOR_IPAP=Qt::red; +QColor COLOR_IPAPLo=Qt::darkRed; +QColor COLOR_IPAPHi=Qt::darkRed; +QColor COLOR_Plethy=Qt::darkBlue; +QColor COLOR_Pulse=Qt::red; +QColor COLOR_SPO2=Qt::blue; +QColor COLOR_FlowRate=Qt::black; +QColor COLOR_Pressure=Qt::darkGreen; +QColor COLOR_RDI=COLOR_LightGreen; +QColor COLOR_AHI=COLOR_LightGreen; +QColor COLOR_Leak=COLOR_DarkMagenta; +QColor COLOR_LeakTotal=COLOR_DarkYellow; +QColor COLOR_MaxLeak=COLOR_DarkRed; +QColor COLOR_Snore=COLOR_DarkGray; +QColor COLOR_RespRate=COLOR_DarkBlue; +QColor COLOR_MaskPressure=COLOR_Blue; +QColor COLOR_PTB=COLOR_Gray; //Patient Triggered Breathing +QColor COLOR_MinuteVent=COLOR_Cyan; +QColor COLOR_TgMV=COLOR_DarkCyan; +QColor COLOR_TidalVolume=COLOR_Magenta; +QColor COLOR_FLG=COLOR_DarkBlue; // Flow Limitation Graph +QColor COLOR_IE=COLOR_DarkRed; // Inspiratory Expiratory Ratio +QColor COLOR_Te=COLOR_DarkGreen; +QColor COLOR_Ti=COLOR_DarkBlue; +QColor COLOR_SleepStage=COLOR_Gray; + + + + diff --git a/common_gui.h b/common_gui.h index 3fe2e4c1..190bae11 100644 --- a/common_gui.h +++ b/common_gui.h @@ -8,6 +8,7 @@ #define COMMON_GUI_H #include +#include "Graphs/glcommon.h" //! \brief Gets the first day of week from the system locale, to show in the calendars. Qt::DayOfWeek firstDayOfWeekFromLocale(); @@ -15,4 +16,51 @@ Qt::DayOfWeek firstDayOfWeekFromLocale(); //! \brief Delay of ms milliseconds void sh_delay(int ms); + +// Flag Colors +extern QColor COLOR_Hypopnea; +extern QColor COLOR_Obstructive; +extern QColor COLOR_Apnea; +extern QColor COLOR_CSR; +extern QColor COLOR_ClearAirway; +extern QColor COLOR_RERA; +extern QColor COLOR_VibratorySnore; +extern QColor COLOR_FlowLimit; +extern QColor COLOR_LeakFlag; +extern QColor COLOR_NRI; +extern QColor COLOR_ExP; +extern QColor COLOR_PressurePulse; +extern QColor COLOR_PulseChange; +extern QColor COLOR_SPO2Drop; +extern QColor COLOR_UserFlag1; + +// Chart Colors +extern QColor COLOR_EPAP; +extern QColor COLOR_IPAP; +extern QColor COLOR_IPAPLo; +extern QColor COLOR_IPAPHi; +extern QColor COLOR_Plethy; +extern QColor COLOR_Pulse; +extern QColor COLOR_SPO2; +extern QColor COLOR_FlowRate; +extern QColor COLOR_Pressure; +extern QColor COLOR_RDI; +extern QColor COLOR_AHI; +extern QColor COLOR_Leak; +extern QColor COLOR_LeakTotal; +extern QColor COLOR_MaxLeak; +extern QColor COLOR_Snore; +extern QColor COLOR_RespRate; +extern QColor COLOR_MaskPressure; +extern QColor COLOR_PTB; //Patient Triggered Breathing +extern QColor COLOR_MinuteVent; +extern QColor COLOR_TgMV; +extern QColor COLOR_TidalVolume; +extern QColor COLOR_FLG; // Flow Limitation Graph +extern QColor COLOR_IE; // Inspiratory Expiratory Ratio +extern QColor COLOR_Te; +extern QColor COLOR_Ti; +extern QColor COLOR_SleepStage; + + #endif diff --git a/daily.cpp b/daily.cpp index 6c56fc3a..4357a467 100644 --- a/daily.cpp +++ b/daily.cpp @@ -106,7 +106,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared) TV=new gGraph(GraphView,STR_TR_TidalVolume,schema::channel[CPAP_TidalVolume].description()+"\n("+schema::channel[CPAP_TidalVolume].units()+")",default_height); MV=new gGraph(GraphView,STR_TR_MinuteVent,schema::channel[CPAP_MinuteVent].description()+"\n("+schema::channel[CPAP_MinuteVent].units()+")",default_height); //TgMV=new gGraph(GraphView,STR_TR_TgtMinVent,schema::channel[CPAP_TgMV].description()+"\n("+schema::channel[CPAP_TgMV].units()+")",default_height); - FLG=new gGraph(GraphView,STR_TR_FlowLimitation,schema::channel[CPAP_FLG].description()+"\n("+schema::channel[CPAP_FLG].units()+")",default_height); + FLG=new gGraph(GraphView,STR_TR_FlowLimit,schema::channel[CPAP_FLG].description()+"\n("+schema::channel[CPAP_FLG].units()+")",default_height); PTB=new gGraph(GraphView,STR_TR_PatTrigBreath,schema::channel[CPAP_PTB].description()+"\n("+schema::channel[CPAP_PTB].units()+")",default_height); RE=new gGraph(GraphView,STR_TR_RespEvent,schema::channel[CPAP_RespEvent].description()+"\n("+schema::channel[CPAP_RespEvent].units()+")",default_height); TI=new gGraph(GraphView,STR_TR_InspTime,schema::channel[CPAP_Ti].description()+"\n("+schema::channel[CPAP_Ti].units()+")",default_height); @@ -130,13 +130,13 @@ Daily::Daily(QWidget *parent,gGraphView * shared) GAHI=new gGraph(snapGV,tr("Breakdown"),tr("events"),172); gSegmentChart * evseg=new gSegmentChart(GST_Pie); - evseg->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),tr("H")); - evseg->AddSlice(CPAP_Apnea,QColor(0x20,0x80,0x20,0xff),tr("A")); - evseg->AddSlice(CPAP_Obstructive,QColor(0x40,0xaf,0xbf,0xff),tr("OA")); - evseg->AddSlice(CPAP_ClearAirway,QColor(0xb2,0x54,0xcd,0xff),tr("CA")); - evseg->AddSlice(CPAP_RERA,QColor(0xff,0xff,0x80,0xff),tr("RE")); - evseg->AddSlice(CPAP_NRI,QColor(0x00,0x80,0x40,0xff),tr("NR")); - evseg->AddSlice(CPAP_FlowLimit,QColor(0x40,0x40,0x40,0xff),tr("FL")); + evseg->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),STR_TR_H); + evseg->AddSlice(CPAP_Apnea,QColor(0x20,0x80,0x20,0xff),STR_TR_UA); + evseg->AddSlice(CPAP_Obstructive,QColor(0x40,0xaf,0xbf,0xff),STR_TR_OA); + evseg->AddSlice(CPAP_ClearAirway,QColor(0xb2,0x54,0xcd,0xff),STR_TR_CA); + evseg->AddSlice(CPAP_RERA,QColor(0xff,0xff,0x80,0xff),STR_TR_RE); + evseg->AddSlice(CPAP_NRI,QColor(0x00,0x80,0x40,0xff),STR_TR_NR); + evseg->AddSlice(CPAP_FlowLimit,QColor(0x40,0x40,0x40,0xff),STR_TR_FL); //evseg->AddSlice(CPAP_UserFlag1,QColor(0x40,0x40,0x40,0xff),tr("UF")); GAHI->AddLayer(AddCPAP(evseg)); @@ -145,63 +145,63 @@ Daily::Daily(QWidget *parent,gGraphView * shared) gFlagsGroup *fg=new gFlagsGroup(); SF->AddLayer(AddCPAP(fg)); - fg->AddLayer((new gFlagsLine(CPAP_CSR,QColor("light green"),STR_TR_PB,false,FT_Span))); - fg->AddLayer((new gFlagsLine(CPAP_ClearAirway,QColor("purple"),STR_TR_CA,false))); - fg->AddLayer((new gFlagsLine(CPAP_Obstructive,QColor("#40c0ff"),STR_TR_OA,true))); - fg->AddLayer((new gFlagsLine(CPAP_Apnea,QColor("dark green"),STR_TR_UA))); - fg->AddLayer((new gFlagsLine(CPAP_Hypopnea,QColor("blue"),STR_TR_H,true))); - fg->AddLayer((new gFlagsLine(CPAP_ExP,QColor("dark cyan"),STR_TR_EP,false))); - fg->AddLayer((new gFlagsLine(CPAP_LeakFlag,QColor("dark blue"),STR_TR_LE,false))); - fg->AddLayer((new gFlagsLine(CPAP_NRI,QColor("dark magenta"),STR_TR_NRI,false))); - fg->AddLayer((new gFlagsLine(CPAP_FlowLimit,QColor("black"),STR_TR_FL))); - fg->AddLayer((new gFlagsLine(CPAP_RERA,QColor("gold"),STR_TR_RE))); - fg->AddLayer((new gFlagsLine(CPAP_VSnore,QColor("red"),STR_TR_VS))); - fg->AddLayer((new gFlagsLine(CPAP_VSnore2,QColor("red"),STR_TR_VS2))); + fg->AddLayer((new gFlagsLine(CPAP_CSR, COLOR_CSR, STR_TR_PB,false,FT_Span))); + fg->AddLayer((new gFlagsLine(CPAP_ClearAirway, COLOR_ClearAirway, STR_TR_CA,false))); + fg->AddLayer((new gFlagsLine(CPAP_Obstructive, COLOR_Obstructive, STR_TR_OA,true))); + fg->AddLayer((new gFlagsLine(CPAP_Apnea, COLOR_Apnea, STR_TR_UA))); + fg->AddLayer((new gFlagsLine(CPAP_Hypopnea, COLOR_Hypopnea, STR_TR_H,true))); + fg->AddLayer((new gFlagsLine(CPAP_ExP, COLOR_ExP, STR_TR_EP,false))); + fg->AddLayer((new gFlagsLine(CPAP_LeakFlag, COLOR_LeakFlag, STR_TR_LE,false))); + fg->AddLayer((new gFlagsLine(CPAP_NRI, COLOR_NRI, STR_TR_NRI,false))); + fg->AddLayer((new gFlagsLine(CPAP_FlowLimit, COLOR_FlowLimit, STR_TR_FL))); + fg->AddLayer((new gFlagsLine(CPAP_RERA, COLOR_RERA, STR_TR_RE))); + fg->AddLayer((new gFlagsLine(CPAP_VSnore, COLOR_VibratorySnore, STR_TR_VS))); + fg->AddLayer((new gFlagsLine(CPAP_VSnore2, COLOR_VibratorySnore, STR_TR_VS2))); if (PROFILE.cpap->userEventFlagging()) { - fg->AddLayer((new gFlagsLine(CPAP_UserFlag1,QColor("yellow"),tr("UF1")))); - fg->AddLayer((new gFlagsLine(CPAP_UserFlag2,QColor("green"),tr("UF2")))); - fg->AddLayer((new gFlagsLine(CPAP_UserFlag3,QColor("brown"),tr("UF3")))); + fg->AddLayer((new gFlagsLine(CPAP_UserFlag1, COLOR_Yellow, STR_TR_UF1))); + fg->AddLayer((new gFlagsLine(CPAP_UserFlag2, COLOR_DarkGreen, STR_TR_UF2))); + fg->AddLayer((new gFlagsLine(CPAP_UserFlag3, COLOR_Brown, STR_TR_UF3))); } - //fg->AddLayer((new gFlagsLine(PRS1_0B,QColor("dark green"),tr("U0B")))); + //fg->AddLayer((new gFlagsLine(PRS1_0B,COLOR_DarkGreen,tr("U0B")))); SF->setBlockZoom(true); SF->AddLayer(new gShadowArea()); SF->AddLayer(new gYSpacer(),LayerLeft,gYAxis::Margin); //SF->AddLayer(new gFooBar(),LayerBottom,0,1); - SF->AddLayer(new gXAxis(Qt::black,false),LayerBottom,0,20); //gXAxis::Margin); + SF->AddLayer(new gXAxis(COLOR_Text,false),LayerBottom,0,20); //gXAxis::Margin); gLineChart *l; - l=new gLineChart(CPAP_FlowRate,Qt::black,false,false); + l=new gLineChart(CPAP_FlowRate,COLOR_Black,false,false); gLineOverlaySummary *los=new gLineOverlaySummary(tr("Selection AHI"),5,-4); AddCPAP(l); FRW->AddLayer(new gXGrid()); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR,QColor("light green"),STR_TR_CSR,FT_Span))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR, COLOR_CSR, STR_TR_CSR,FT_Span))); FRW->AddLayer(l); FRW->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin); FRW->AddLayer(new gXAxis(),LayerBottom,0,20); - FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Hypopnea,QColor("blue"),STR_TR_H)))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,QColor("red"),STR_TR_PP,FT_Dot))); - //FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure,QColor("white"),tr("P"),FT_Dot))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0B,QColor("blue"),"0B",FT_Dot))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_10,QColor("orange"),"10",FT_Dot))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0E,QColor("dark red"),"0E",FT_Dot))); + FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Hypopnea,COLOR_Hypopnea,STR_TR_H)))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,COLOR_PressurePulse,STR_TR_PP,FT_Dot))); + //FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure, COLOR_White,STR_TR_P,FT_Dot))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0B,COLOR_Blue,"0B",FT_Dot))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_10,COLOR_Orange,"10",FT_Dot))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0E,COLOR_DarkRed,"0E",FT_Dot))); if (PROFILE.general->calculateRDI()) - FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_RERA,QColor("gold"),STR_TR_RE)))); + FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_RERA, COLOR_RERA, STR_TR_RE)))); else - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_RERA,QColor("gold"),STR_TR_RE))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_RERA, COLOR_RERA, STR_TR_RE))); - FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Apnea,QColor("dark green"),STR_TR_UA)))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore,QColor("red"),tr("VS")))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_FlowLimit,QColor("black"),tr("FL")))); - FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Obstructive,QColor("#40c0ff"),STR_TR_OA)))); - FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_ClearAirway,QColor("purple"),STR_TR_CA)))); + FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Apnea, COLOR_Apnea, STR_TR_UA)))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore, COLOR_VibratorySnore, STR_TR_VS))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_FlowLimit, COLOR_FlowLimit, STR_TR_FL))); + FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Obstructive, COLOR_Obstructive, STR_TR_OA)))); + FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_ClearAirway, COLOR_ClearAirway, STR_TR_CA)))); if (PROFILE.cpap->userEventFlagging()) { - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag1,QColor("yellow"),tr("U1"),FT_Bar))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag2,QColor("orange"),tr("U2"),FT_Bar))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag3,QColor("brown"),tr("U3"),FT_Bar))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag1, COLOR_Yellow, tr("U1"),FT_Bar))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag2, COLOR_Orange, tr("U2"),FT_Bar))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag3, COLOR_Brown, tr("U3"),FT_Bar))); } - FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_SPO2Drop,QColor("red"),STR_TR_O2))); - //FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange,QColor("blue"),STR_TR_PC,FT_Dot))); + FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2))); + //FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange, COLOR_PulseChange, STR_TR_PC,FT_Dot))); FRW->AddLayer(AddCPAP(los)); @@ -227,65 +227,65 @@ Daily::Daily(QWidget *parent,gGraphView * shared) bool square=PROFILE.appearance->squareWavePlots(); - gLineChart *pc=new gLineChart(CPAP_Pressure,QColor("dark green"),square); + gLineChart *pc=new gLineChart(CPAP_Pressure, COLOR_Pressure, square); PRD->AddLayer(AddCPAP(pc)); - pc->addPlot(CPAP_EPAP,Qt::blue,square); - pc->addPlot(CPAP_IPAPLo,Qt::darkRed,square); - pc->addPlot(CPAP_IPAP,Qt::red,square); - pc->addPlot(CPAP_IPAPHi,Qt::darkRed,square); + pc->addPlot(CPAP_EPAP, COLOR_EPAP, square); + pc->addPlot(CPAP_IPAPLo, COLOR_IPAPLo, square); + pc->addPlot(CPAP_IPAP, COLOR_IPAP, square); + pc->addPlot(CPAP_IPAPHi, COLOR_IPAPHi, square); if (PROFILE.general->calculateRDI()) { - AHI->AddLayer(AddCPAP(new gLineChart(CPAP_RDI,QColor("light green"),square))); + AHI->AddLayer(AddCPAP(new gLineChart(CPAP_RDI, COLOR_RDI, square))); // AHI->AddLayer(AddCPAP(new AHIChart(QColor("#37a24b")))); } else { - AHI->AddLayer(AddCPAP(new gLineChart(CPAP_AHI,QColor("light green"),square))); + AHI->AddLayer(AddCPAP(new gLineChart(CPAP_AHI, COLOR_AHI, square))); } - gLineChart *lc=new gLineChart(CPAP_LeakTotal,Qt::darkYellow,square); - lc->addPlot(CPAP_Leak,Qt::darkMagenta,square); - lc->addPlot(CPAP_MaxLeak,Qt::darkRed,square); + gLineChart *lc=new gLineChart(CPAP_LeakTotal, COLOR_LeakTotal, square); + lc->addPlot(CPAP_Leak, COLOR_Leak, square); + lc->addPlot(CPAP_MaxLeak, COLOR_MaxLeak, square); LEAK->AddLayer(AddCPAP(lc)); - //LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_Leak,Qt::darkMagenta,square))); - //LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_MaxLeak,Qt::darkRed,square))); - SNORE->AddLayer(AddCPAP(new gLineChart(CPAP_Snore,Qt::darkGray,true))); + //LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_Leak, COLOR_Leak,square))); + //LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_MaxLeak, COLOR_MaxLeak,square))); + SNORE->AddLayer(AddCPAP(new gLineChart(CPAP_Snore, COLOR_Snore, true))); - PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PTB,Qt::gray,square))); - MP->AddLayer(AddCPAP(new gLineChart(CPAP_MaskPressure,Qt::blue,false))); - RR->AddLayer(AddCPAP(lc=new gLineChart(CPAP_RespRate,Qt::darkBlue,square))); + PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PTB, COLOR_PTB, square))); + MP->AddLayer(AddCPAP(new gLineChart(CPAP_MaskPressure, COLOR_MaskPressure, false))); + RR->AddLayer(AddCPAP(lc=new gLineChart(CPAP_RespRate, COLOR_RespRate, square))); // Delete me!! -// lc->addPlot(CPAP_Test1,Qt::darkRed,square); +// lc->addPlot(CPAP_Test1, COLOR_DarkRed,square); - MV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_MinuteVent,Qt::cyan,square))); - lc->addPlot(CPAP_TgMV,Qt::darkCyan,square); + MV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_MinuteVent, COLOR_MinuteVent, square))); + lc->addPlot(CPAP_TgMV,COLOR_TgMV,square); - TV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_TidalVolume,Qt::magenta,square))); - //lc->addPlot(CPAP_Test2,Qt::darkYellow,square); + TV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_TidalVolume,COLOR_TidalVolume,square))); + //lc->addPlot(CPAP_Test2,COLOR_DarkYellow,square); - //TV->AddLayer(AddCPAP(new gLineChart("TidalVolume2",Qt::magenta,square))); - FLG->AddLayer(AddCPAP(new gLineChart(CPAP_FLG,Qt::darkBlue,true))); - //RE->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryEvent,Qt::magenta,true))); - IE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_IE,Qt::darkRed,square))); - TE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Te,Qt::darkGreen,square))); - TI->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Ti,Qt::darkBlue,square))); - //lc->addPlot(CPAP_Test2,Qt::darkYellow,square); - //INTPULSE->AddLayer(AddCPAP(new gLineChart(OXI_Pulse,Qt::red,square))); - //INTSPO2->AddLayer(AddCPAP(new gLineChart(OXI_SPO2,Qt::blue,square))); + //TV->AddLayer(AddCPAP(new gLineChart("TidalVolume2",COLOR_Magenta,square))); + FLG->AddLayer(AddCPAP(new gLineChart(CPAP_FLG, COLOR_FLG, true))); + //RE->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryEvent,COLOR_Magenta,true))); + IE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_IE, COLOR_IE, square))); + TE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Te, COLOR_Te, square))); + TI->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Ti, COLOR_Ti, square))); + //lc->addPlot(CPAP_Test2,COLOR:DarkYellow,square); + //INTPULSE->AddLayer(AddCPAP(new gLineChart(OXI_Pulse, COLOR_Pulse, square))); + //INTSPO2->AddLayer(AddCPAP(new gLineChart(OXI_SPO2, COLOR_SPO2, square))); - STAGE->AddLayer(AddSTAGE(new gLineChart(ZEO_SleepStage,Qt::gray,true))); + STAGE->AddLayer(AddSTAGE(new gLineChart(ZEO_SleepStage, COLOR_SleepStage, true))); gLineOverlaySummary *los1=new gLineOverlaySummary(tr("Events/hour"),5,-4); gLineOverlaySummary *los2=new gLineOverlaySummary(tr("Events/hour"),5,-4); - PULSE->AddLayer(AddOXI(los1->add(new gLineOverlayBar(OXI_PulseChange,QColor("light gray"),STR_TR_PC,FT_Span)))); + PULSE->AddLayer(AddOXI(los1->add(new gLineOverlayBar(OXI_PulseChange, COLOR_PulseChange, STR_TR_PC,FT_Span)))); PULSE->AddLayer(AddOXI(los1)); - SPO2->AddLayer(AddOXI(los2->add(new gLineOverlayBar(OXI_SPO2Drop,QColor("light blue"),STR_TR_O2,FT_Span)))); + SPO2->AddLayer(AddOXI(los2->add(new gLineOverlayBar(OXI_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2,FT_Span)))); SPO2->AddLayer(AddOXI(los2)); - PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse,Qt::red,square))); - SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2,Qt::blue,true))); - PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethy,Qt::darkBlue,false))); + PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse, COLOR_Pulse, square))); + SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2, COLOR_SPO2, true))); + PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethy, COLOR_Plethy,false))); PTB->setForceMaxY(100); SPO2->setForceMaxY(100); @@ -298,7 +298,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared) layout->layout(); QTextCharFormat format = ui->calendar->weekdayTextFormat(Qt::Saturday); - format.setForeground(QBrush(Qt::black, Qt::SolidPattern)); + format.setForeground(QBrush(COLOR_Black, Qt::SolidPattern)); ui->calendar->setWeekdayTextFormat(Qt::Saturday, format); ui->calendar->setWeekdayTextFormat(Qt::Sunday, format); @@ -552,19 +552,19 @@ void Daily::UpdateCalendarDay(QDate date) QTextCharFormat jourday; QTextCharFormat stageday; - cpaponly.setForeground(QBrush(Qt::blue, Qt::SolidPattern)); + cpaponly.setForeground(QBrush(COLOR_Blue, Qt::SolidPattern)); cpaponly.setFontWeight(QFont::Normal); - cpapjour.setForeground(QBrush(Qt::blue, Qt::SolidPattern)); + cpapjour.setForeground(QBrush(COLOR_Blue, Qt::SolidPattern)); cpapjour.setFontWeight(QFont::Bold); - oxiday.setForeground(QBrush(Qt::red, Qt::SolidPattern)); + oxiday.setForeground(QBrush(COLOR_Red, Qt::SolidPattern)); oxiday.setFontWeight(QFont::Normal); - oxicpap.setForeground(QBrush(Qt::red, Qt::SolidPattern)); + oxicpap.setForeground(QBrush(COLOR_Red, Qt::SolidPattern)); oxicpap.setFontWeight(QFont::Bold); - stageday.setForeground(QBrush(Qt::magenta, Qt::SolidPattern)); + stageday.setForeground(QBrush(COLOR_Magenta, Qt::SolidPattern)); stageday.setFontWeight(QFont::Bold); - jourday.setForeground(QBrush(QColor("black"), Qt::SolidPattern)); + jourday.setForeground(QBrush(COLOR_Black, Qt::SolidPattern)); jourday.setFontWeight(QFont::Bold); - nodata.setForeground(QBrush(QColor("black"), Qt::SolidPattern)); + nodata.setForeground(QBrush(COLOR_Black, Qt::SolidPattern)); nodata.setFontWeight(QFont::Normal); bool hascpap=PROFILE.GetDay(date,MT_CPAP)!=NULL; @@ -826,10 +826,10 @@ void Daily::Load(QDate date) if (!isBrick && hours>0) { if (PROFILE.general->calculateRDI()) { html+=QString("%3%4 %5\n") - .arg("#F88017").arg("black").arg(STR_TR_RDI).arg(schema::channel[CPAP_RDI].description()).arg(ahi,0,'f',2); + .arg("#F88017").arg(COLOR_Text.name()).arg(STR_TR_RDI).arg(schema::channel[CPAP_RDI].description()).arg(ahi,0,'f',2); } else { html+=QString("%3%4 %5\n") - .arg("#F88017").arg("black").arg(STR_TR_AHI).arg(schema::channel[CPAP_AHI].description()).arg(ahi,0,'f',2); + .arg("#F88017").arg(COLOR_Text.name()).arg(STR_TR_AHI).arg(schema::channel[CPAP_AHI].description()).arg(ahi,0,'f',2); } if (cpap->machine->GetClass()==STR_MACH_ResMed || cpap->machine->GetClass()==STR_MACH_FPIcon) { @@ -838,32 +838,32 @@ void Daily::Load(QDate date) html+=""; html+=QString("%3%4%5\n") - .arg("#4040ff").arg("white").arg(tr("Hypopnea")).arg(schema::channel[CPAP_Hypopnea].description()).arg(hi,0,'f',2).arg(CPAP_Hypopnea); + .arg(COLOR_Hypopnea.name()).arg("white").arg(tr("Hypopnea")).arg(schema::channel[CPAP_Hypopnea].description()).arg(hi,0,'f',2).arg(CPAP_Hypopnea); if (cpap->machine->GetClass()==STR_MACH_ResMed) { html+=QString("%3%4%5\n") - .arg("#208020").arg("black") + .arg(COLOR_Apnea.name()).arg(COLOR_Text.name()) .arg(tr("Apnea")).arg(schema::channel[CPAP_Apnea].description()).arg(uai,0,'f',2).arg(CPAP_Apnea); } html+=QString("%3%4%5\n") - .arg("#40afbf").arg("black").arg(tr("Obstructive")).arg(schema::channel[CPAP_Obstructive].description()).arg(oai,0,'f',2).arg(CPAP_Obstructive); + .arg(COLOR_Obstructive.name()).arg(COLOR_Text.name()).arg(tr("Obstructive")).arg(schema::channel[CPAP_Obstructive].description()).arg(oai,0,'f',2).arg(CPAP_Obstructive); if (cpap->machine->GetClass()==STR_MACH_FPIcon) { html+=QString("%3%4%5\n") - .arg("#404040").arg("white").arg(tr("Flow Limit")).arg(schema::channel[CPAP_FlowLimit].description()).arg(fli,0,'f',2).arg(CPAP_FlowLimit); + .arg(COLOR_FlowLimit.name()).arg("white").arg(tr("Flow Limit")).arg(schema::channel[CPAP_FlowLimit].description()).arg(fli,0,'f',2).arg(CPAP_FlowLimit); } else { html+=QString("%3%4%5\n") - .arg("#b254cd").arg("black").arg(tr("Clear Airway")).arg(schema::channel[CPAP_ClearAirway].description()).arg(cai,0,'f',2).arg(CPAP_ClearAirway); + .arg(COLOR_ClearAirway.name()).arg(COLOR_Text.name()).arg(tr("Clear Airway")).arg(schema::channel[CPAP_ClearAirway].description()).arg(cai,0,'f',2).arg(CPAP_ClearAirway); } if (cpap->machine->GetClass()==STR_MACH_Intellipap) { html+=QString("%3%4%5%\n") - .arg(schema::channel[CPAP_NRI].defaultColor().name()).arg("black").arg(STR_TR_NRI).arg(schema::channel[CPAP_NRI].description()).arg(nri,0,'f',2).arg(CPAP_NRI); + .arg(schema::channel[CPAP_NRI].defaultColor().name()).arg(COLOR_Text.name()).arg(STR_TR_NRI).arg(schema::channel[CPAP_NRI].description()).arg(nri,0,'f',2).arg(CPAP_NRI); } if (PROFILE.cpap->userEventFlagging()) { EventDataType uf1=cpap->count(CPAP_UserFlag1) / cpap->hours(); if (uf1>0) html+=QString("%3%4%5\n") - .arg("#e0e0e0").arg("black") + .arg(COLOR_UserFlag1.name()).arg(COLOR_Text.name()) .arg(tr("User Flags")) .arg(schema::channel[CPAP_UserFlag1].description()) .arg(uf1,0,'f',2).arg(CPAP_UserFlag1); @@ -874,31 +874,31 @@ void Daily::Load(QDate date) if (cpap->machine->GetClass()==STR_MACH_PRS1) { html+=""; html+=QString("\n") - .arg("#ffff80").arg("black").arg(STR_TR_RERA).arg(schema::channel[CPAP_RERA].description()).arg(rei,0,'f',2).arg(CPAP_RERA); + .arg(COLOR_RERA.name()).arg(COLOR_Text.name()).arg(STR_TR_RERA).arg(schema::channel[CPAP_RERA].description()).arg(rei,0,'f',2).arg(CPAP_RERA); if (mode>MODE_CPAP) { html+=QString("\n") - .arg("#404040").arg("white").arg(tr("Flow Limit")).arg(schema::channel[CPAP_FlowLimit].description()).arg(fli,0,'f',2).arg(CPAP_FlowLimit); + .arg(COLOR_FlowLimit.name()).arg("white").arg(tr("Flow Limit")).arg(schema::channel[CPAP_FlowLimit].description()).arg(fli,0,'f',2).arg(CPAP_FlowLimit); html+=QString("\n") - .arg("#ff4040").arg("black").arg(tr("VSnore")).arg(schema::channel[CPAP_VSnore].description()).arg(cpap->count(CPAP_VSnore)/cpap->hours(),0,'f',2).arg(CPAP_VSnore); + .arg(COLOR_VibratorySnore.name()).arg(COLOR_Text.name()).arg(tr("VSnore")).arg(schema::channel[CPAP_VSnore].description()).arg(cpap->count(CPAP_VSnore)/cpap->hours(),0,'f',2).arg(CPAP_VSnore); } else { //html+=""; html+=QString("\n") - .arg("#ff4040").arg("black").arg(tr("VSnore2")).arg(schema::channel[CPAP_VSnore2].description()).arg(cpap->count(CPAP_VSnore2)/cpap->hours(),0,'f',2).arg(CPAP_VSnore2); + .arg(COLOR_VibratorySnore.name()).arg(COLOR_Text.name()).arg(tr("VSnore2")).arg(schema::channel[CPAP_VSnore2].description()).arg(cpap->count(CPAP_VSnore2)/cpap->hours(),0,'f',2).arg(CPAP_VSnore2); } html+=QString("\n") - .arg("#80ff80").arg("black").arg(tr("PB/CSR")).arg(schema::channel[CPAP_CSR].description()).arg(csr,0,'f',2).arg(CPAP_CSR); + .arg(COLOR_CSR.name()).arg(COLOR_Text.name()).arg(tr("PB/CSR")).arg(schema::channel[CPAP_CSR].description()).arg(csr,0,'f',2).arg(CPAP_CSR); html+="
%3%4%5
%3%4%5
%3%4%5
 
%3%4%5
%3%4%5%
"; } else if (cpap->machine->GetClass()==STR_MACH_Intellipap) { html+=""; html+=QString("\n") - .arg("#40c0c0").arg("black").arg(STR_TR_Leak).arg(schema::channel[CPAP_LeakFlag].description()).arg(lki,0,'f',2).arg(CPAP_LeakFlag); + .arg(COLOR_LeakFlag.name()).arg(COLOR_Text.name()).arg(STR_TR_Leak).arg(schema::channel[CPAP_LeakFlag].description()).arg(lki,0,'f',2).arg(CPAP_LeakFlag); html+=QString("\n") - .arg("#ff4040").arg("black").arg(tr("VSnore")).arg(schema::channel[CPAP_VSnore].description()).arg(cpap->count(CPAP_VSnore)/cpap->hours(),0,'f',2).arg(CPAP_VSnore); + .arg(COLOR_VibratorySnore.name()).arg(COLOR_Text.name()).arg(tr("VSnore")).arg(schema::channel[CPAP_VSnore].description()).arg(cpap->count(CPAP_VSnore)/cpap->hours(),0,'f',2).arg(CPAP_VSnore); html+=QString("\n") - .arg("#80ff80").arg("black").arg(tr("Exh Puff")).arg(schema::channel[CPAP_ExP].description()).arg(exp,0,'f',2).arg(CPAP_ExP); + .arg(COLOR_ExP.name()).arg("white").arg(tr("Exh Puff")).arg(schema::channel[CPAP_ExP].description()).arg(exp,0,'f',2).arg(CPAP_ExP); html+="
%3%4%5%
%3%4%5
%3%4%5%
"; @@ -1021,7 +1021,7 @@ void Daily::Load(QDate date) } } - html+=QString("%1%6%2%3%4%5") + html+=QString("%1%6%2%3%4%5") //.arg(QString("%3%2") //"+STR_TR_RDI+""+ //.arg(QString::number(code)).arg(tooltip).arg(schema::channel[code].label())) .arg(schema::channel[code].label()) @@ -1455,7 +1455,7 @@ void Daily::on_JournalNotesFontsize_activated(int index) void Daily::on_JournalNotesColour_clicked() { - QColor col=QColorDialog::getColor(Qt::black,this,tr("Pick a Colour")); //,QColorDialog::NoButtons); + QColor col=QColorDialog::getColor(COLOR_Black,this,tr("Pick a Colour")); //,QColorDialog::NoButtons); if (!col.isValid()) return; QTextCursor cursor = ui->JournalNotes->textCursor(); diff --git a/overview.cpp b/overview.cpp index 78e05da3..da82b93a 100644 --- a/overview.cpp +++ b/overview.cpp @@ -50,7 +50,7 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : // Stop both calendar drop downs highlighting weekends in red QTextCharFormat format = ui->dateStart->calendarWidget()->weekdayTextFormat(Qt::Saturday); - format.setForeground(QBrush(Qt::black, Qt::SolidPattern)); + format.setForeground(QBrush(COLOR_Black, Qt::SolidPattern)); ui->dateStart->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, format); ui->dateStart->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format); ui->dateEnd->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, format); @@ -136,112 +136,112 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : ZOMBIE=createGraph(STR_TR_Zombie,tr("How you felt\n(0-10)")); ahihr=new SummaryChart(tr("Events/Hr"),GT_LINE); - ahihr->addSlice(ahicode,QColor("blue"),ST_MAX); - ahihr->addSlice(ahicode,QColor("orange"),ST_WAVG); + ahihr->addSlice(ahicode,COLOR_Blue,ST_MAX); + ahihr->addSlice(ahicode,COLOR_Orange,ST_WAVG); AHIHR->AddLayer(ahihr); weight=new SummaryChart(STR_TR_Weight,GT_LINE); weight->setMachineType(MT_JOURNAL); - weight->addSlice(Journal_Weight,QColor("black"),ST_SETAVG); + weight->addSlice(Journal_Weight,COLOR_Black,ST_SETAVG); WEIGHT->AddLayer(weight); bmi=new SummaryChart(STR_TR_BMI,GT_LINE); bmi->setMachineType(MT_JOURNAL); - bmi->addSlice(Journal_BMI,QColor("dark blue"),ST_SETAVG); + bmi->addSlice(Journal_BMI,COLOR_DarkBlue,ST_SETAVG); BMI->AddLayer(bmi); zombie=new SummaryChart(tr("Zombie Meter"),GT_LINE); zombie->setMachineType(MT_JOURNAL); - zombie->addSlice(Journal_ZombieMeter,QColor("dark red"),ST_SETAVG); + zombie->addSlice(Journal_ZombieMeter,COLOR_DarkRed,ST_SETAVG); ZOMBIE->AddLayer(zombie); pulse=new SummaryChart(STR_TR_PulseRate,GT_LINE); pulse->setMachineType(MT_OXIMETER); - pulse->addSlice(OXI_Pulse,QColor("red"),ST_mid,0.5); - pulse->addSlice(OXI_Pulse,QColor("pink"),ST_MIN); - pulse->addSlice(OXI_Pulse,QColor("orange"),ST_MAX); + pulse->addSlice(OXI_Pulse,COLOR_Red,ST_mid,0.5); + pulse->addSlice(OXI_Pulse,COLOR_Pink,ST_MIN); + pulse->addSlice(OXI_Pulse,COLOR_Orange,ST_MAX); PULSE->AddLayer(pulse); spo2=new SummaryChart(STR_TR_SpO2,GT_LINE); spo2->setMachineType(MT_OXIMETER); - spo2->addSlice(OXI_SPO2,QColor("cyan"),ST_mid,0.5); - spo2->addSlice(OXI_SPO2,QColor("light blue"),ST_PERC,percentile); - spo2->addSlice(OXI_SPO2,QColor("blue"),ST_MIN); + spo2->addSlice(OXI_SPO2,COLOR_Cyan,ST_mid,0.5); + spo2->addSlice(OXI_SPO2,COLOR_LightBlue,ST_PERC,percentile); + spo2->addSlice(OXI_SPO2,COLOR_Blue,ST_MIN); SPO2->AddLayer(spo2); uc=new SummaryChart(STR_UNIT_Hours,GT_BAR); - uc->addSlice(NoChannel,QColor("green"),ST_HOURS); + uc->addSlice(NoChannel, COLOR_Green, ST_HOURS); UC->AddLayer(uc); fl=new SummaryChart(STR_TR_FL,GT_BAR); - fl->addSlice(CPAP_FlowLimit,QColor("brown"),ST_CPH); + fl->addSlice(CPAP_FlowLimit, COLOR_Brown, ST_CPH); FL->AddLayer(fl); us=new SummaryChart(STR_UNIT_Hours,GT_SESSIONS); - us->addSlice(NoChannel,QColor("dark blue"),ST_HOURS); - us->addSlice(NoChannel,QColor("blue"),ST_SESSIONS); + us->addSlice(NoChannel, COLOR_DarkBlue, ST_HOURS); + us->addSlice(NoChannel, COLOR_Blue, ST_SESSIONS); US->AddLayer(us); ses=new SummaryChart(STR_TR_Sessions,GT_LINE); - ses->addSlice(NoChannel,QColor("blue"),ST_SESSIONS); + ses->addSlice(NoChannel, COLOR_Blue, ST_SESSIONS); SES->AddLayer(ses); if (ahicode==CPAP_RDI) - bc=new SummaryChart(STR_TR_RDI,GT_BAR); + bc=new SummaryChart(STR_TR_RDI, GT_BAR); else - bc=new SummaryChart(STR_TR_AHI,GT_BAR); - bc->addSlice(CPAP_Hypopnea,QColor("blue"),ST_CPH); - bc->addSlice(CPAP_Apnea,QColor("dark green"),ST_CPH); - bc->addSlice(CPAP_Obstructive,QColor("#40c0ff"),ST_CPH); - bc->addSlice(CPAP_ClearAirway,QColor("purple"),ST_CPH); + bc=new SummaryChart(STR_TR_AHI, GT_BAR); + bc->addSlice(CPAP_Hypopnea, COLOR_Hypopnea, ST_CPH); + bc->addSlice(CPAP_Apnea, COLOR_Apnea, ST_CPH); + bc->addSlice(CPAP_Obstructive, COLOR_Obstructive, ST_CPH); + bc->addSlice(CPAP_ClearAirway, COLOR_ClearAirway, ST_CPH); if (PROFILE.general->calculateRDI()) { - bc->addSlice(CPAP_RERA,QColor("gold"),ST_CPH); + bc->addSlice(CPAP_RERA, COLOR_RERA, ST_CPH); } AHI->AddLayer(bc); set=new SummaryChart("",GT_LINE); - //set->addSlice(PRS1_SysOneResistSet,QColor("grey"),ST_SETAVG); - set->addSlice(CPAP_HumidSetting,QColor("blue"),ST_SETWAVG); - set->addSlice(CPAP_PresReliefSet,QColor("red"),ST_SETWAVG); - //set->addSlice(RMS9_EPRSet,QColor("green"),ST_SETWAVG); - //set->addSlice(INTP_SmartFlex,QColor("purple"),ST_SETWAVG); + //set->addSlice(PRS1_SysOneResistSet,COLOR_Gray,ST_SETAVG); + set->addSlice(CPAP_HumidSetting, COLOR_Blue, ST_SETWAVG); + set->addSlice(CPAP_PresReliefSet, COLOR_Red, ST_SETWAVG); + //set->addSlice(RMS9_EPRSet,COLOR_Green,ST_SETWAVG); + //set->addSlice(INTP_SmartFlex,COLOR_Purple,ST_SETWAVG); SET->AddLayer(set); rr=new SummaryChart(tr("breaths/min"),GT_LINE); - rr->addSlice(CPAP_RespRate,QColor("light blue"),ST_MIN); - rr->addSlice(CPAP_RespRate,QColor("blue"),ST_mid,0.5); - rr->addSlice(CPAP_RespRate,QColor("light green"),ST_PERC,percentile); - rr->addSlice(CPAP_RespRate,QColor("green"),ST_max,maxperc); - // rr->addSlice(CPAP_RespRate,QColor("green"),ST_MAX); + rr->addSlice(CPAP_RespRate, COLOR_LightBlue, ST_MIN); + rr->addSlice(CPAP_RespRate, COLOR_Blue, ST_mid,0.5); + rr->addSlice(CPAP_RespRate, COLOR_LightGreen, ST_PERC,percentile); + rr->addSlice(CPAP_RespRate, COLOR_Green, ST_max,maxperc); + // rr->addSlice(CPAP_RespRate,COLOR_Green,ST_MAX); RR->AddLayer(rr); tv=new SummaryChart(tr("L/b"),GT_LINE); - tv->addSlice(CPAP_TidalVolume,QColor("light blue"),ST_MIN); - tv->addSlice(CPAP_TidalVolume,QColor("blue"),ST_mid,0.5); - tv->addSlice(CPAP_TidalVolume,QColor("light green"),ST_PERC,percentile); - tv->addSlice(CPAP_TidalVolume,QColor("green"),ST_max,maxperc); + tv->addSlice(CPAP_TidalVolume,COLOR_LightBlue,ST_MIN); + tv->addSlice(CPAP_TidalVolume,COLOR_Blue,ST_mid,0.5); + tv->addSlice(CPAP_TidalVolume,COLOR_LightGreen,ST_PERC,percentile); + tv->addSlice(CPAP_TidalVolume,COLOR_Green,ST_max,maxperc); TV->AddLayer(tv); mv=new SummaryChart(STR_UNIT_LPM,GT_LINE); - mv->addSlice(CPAP_MinuteVent,QColor("light blue"),ST_MIN); - mv->addSlice(CPAP_MinuteVent,QColor("blue"),ST_mid,0.5); - mv->addSlice(CPAP_MinuteVent,QColor("light green"),ST_PERC,percentile); - mv->addSlice(CPAP_MinuteVent,QColor("green"),ST_max,maxperc); + mv->addSlice(CPAP_MinuteVent,COLOR_LightBlue,ST_MIN); + mv->addSlice(CPAP_MinuteVent,COLOR_Blue,ST_mid,0.5); + mv->addSlice(CPAP_MinuteVent,COLOR_LightGreen,ST_PERC,percentile); + mv->addSlice(CPAP_MinuteVent,COLOR_Green,ST_max,maxperc); MV->AddLayer(mv); // should merge... tgmv=new SummaryChart(STR_UNIT_LPM,GT_LINE); - tgmv->addSlice(CPAP_TgMV,QColor("light blue"),ST_MIN); - tgmv->addSlice(CPAP_TgMV,QColor("blue"),ST_mid,0.5); - tgmv->addSlice(CPAP_TgMV,QColor("light green"),ST_PERC,percentile); - tgmv->addSlice(CPAP_TgMV,QColor("green"),ST_max,maxperc); + tgmv->addSlice(CPAP_TgMV,COLOR_LightBlue,ST_MIN); + tgmv->addSlice(CPAP_TgMV,COLOR_Blue,ST_mid,0.5); + tgmv->addSlice(CPAP_TgMV,COLOR_LightGreen,ST_PERC,percentile); + tgmv->addSlice(CPAP_TgMV,COLOR_Green,ST_max,maxperc); TGMV->AddLayer(tgmv); ptb=new SummaryChart(tr("%PTB"),GT_LINE); - ptb->addSlice(CPAP_PTB,QColor("yellow"),ST_MIN); - ptb->addSlice(CPAP_PTB,QColor("blue"),ST_mid,0.5); - ptb->addSlice(CPAP_PTB,QColor("light gray"),ST_PERC,percentile); - ptb->addSlice(CPAP_PTB,QColor("orange"),ST_WAVG); + ptb->addSlice(CPAP_PTB,COLOR_Yellow,ST_MIN); + ptb->addSlice(CPAP_PTB,COLOR_Blue,ST_mid,0.5); + ptb->addSlice(CPAP_PTB,COLOR_LightGray,ST_PERC,percentile); + ptb->addSlice(CPAP_PTB,COLOR_Orange,ST_WAVG); PTB->AddLayer(ptb); pr=new SummaryChart(STR_TR_Pressure,GT_LINE); @@ -249,23 +249,23 @@ Overview::Overview(QWidget *parent,gGraphView * shared) : PR->AddLayer(pr); lk=new SummaryChart(STR_TR_Leaks,GT_LINE); - lk->addSlice(CPAP_Leak,QColor("light blue"),ST_mid,0.5); - lk->addSlice(CPAP_Leak,QColor("dark grey"),ST_PERC,percentile); - //lk->addSlice(CPAP_Leak,QColor("dark blue"),ST_WAVG); - lk->addSlice(CPAP_Leak,QColor("grey"),ST_max,maxperc); - //lk->addSlice(CPAP_Leak,QColor("dark yellow")); + lk->addSlice(CPAP_Leak,COLOR_LightBlue,ST_mid,0.5); + lk->addSlice(CPAP_Leak,COLOR_DarkGray,ST_PERC,percentile); + //lk->addSlice(CPAP_Leak,COLOR_DarkBlue,ST_WAVG); + lk->addSlice(CPAP_Leak,COLOR_Gray,ST_max,maxperc); + //lk->addSlice(CPAP_Leak,COLOR_DarkYellow); LK->AddLayer(lk); totlk=new SummaryChart(STR_TR_TotalLeaks,GT_LINE); - totlk->addSlice(CPAP_LeakTotal,QColor("light blue"),ST_mid,0.5); - totlk->addSlice(CPAP_LeakTotal,QColor("dark grey"),ST_PERC,percentile); - totlk->addSlice(CPAP_LeakTotal,QColor("grey"),ST_max,maxperc); - //tot->addSlice(CPAP_Leak,QColor("dark blue"),ST_WAVG); - //tot->addSlice(CPAP_Leak,QColor("dark yellow")); + totlk->addSlice(CPAP_LeakTotal, COLOR_LightBlue, ST_mid,0.5); + totlk->addSlice(CPAP_LeakTotal, COLOR_DarkGray, ST_PERC,percentile); + totlk->addSlice(CPAP_LeakTotal, COLOR_Gray, ST_max,maxperc); + //tot->addSlice(CPAP_Leak, COLOR_DarkBlue, ST_WAVG); + //tot->addSlice(CPAP_Leak, COLOR_DarkYellow); TOTLK->AddLayer(totlk); NPB->AddLayer(npb=new SummaryChart(tr("% PB"),GT_BAR)); - npb->addSlice(CPAP_CSR,QColor("light green"),ST_SPH); + npb->addSlice(CPAP_CSR, COLOR_DarkGreen, ST_SPH); // <--- The code to the previous marker is crap GraphView->LoadSettings("Overview"); //no trans diff --git a/oximetry.cpp b/oximetry.cpp index 5bc0cdf2..bbdaa7e1 100644 --- a/oximetry.cpp +++ b/oximetry.cpp @@ -1015,22 +1015,22 @@ Oximetry::Oximetry(QWidget *parent,gGraphView * shared) : g->AddLayer(new gXGrid()); } - plethy=new gLineChart(OXI_Plethy,Qt::black,false,true); + plethy=new gLineChart(OXI_Plethy,COLOR_Plethy,false,true); plethy->SetDay(day); CONTROL->AddLayer(plethy); //new gLineChart(OXI_Plethysomogram)); - pulse=new gLineChart(OXI_Pulse,Qt::red,true); + pulse=new gLineChart(OXI_Pulse,COLOR_Pulse,true); //pulse->SetDay(day); - spo2=new gLineChart(OXI_SPO2,Qt::blue,true); + spo2=new gLineChart(OXI_SPO2,COLOR_SPO2,true); //spo2->SetDay(day); PLETHY->AddLayer(plethy); - PULSE->AddLayer(lo1=new gLineOverlayBar(OXI_PulseChange,QColor("light gray"),STR_TR_PC,FT_Span)); - SPO2->AddLayer(lo2=new gLineOverlayBar(OXI_SPO2Drop,QColor("light blue"),STR_TR_O2,FT_Span)); + PULSE->AddLayer(lo1=new gLineOverlayBar(OXI_PulseChange,COLOR_PulseChange,STR_TR_PC,FT_Span)); + SPO2->AddLayer(lo2=new gLineOverlayBar(OXI_SPO2Drop,COLOR_SPO2Drop,STR_TR_O2,FT_Span)); PULSE->AddLayer(pulse); SPO2->AddLayer(spo2); PULSE->setDay(day); @@ -1063,7 +1063,7 @@ Oximetry::Oximetry(QWidget *parent,gGraphView * shared) : // Stop both calendar drop downs highlighting weekends in red //QTextCharFormat format = ui->dateEdit->calendarWidget()->weekdayTextFormat(Qt::Saturday); - //format.setForeground(QBrush(Qt::black, Qt::SolidPattern)); + //format.setForeground(QBrush(COLOR_Text, Qt::SolidPattern)); //ui->dateEdit->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, format); //ui->dateEdit->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format); dont_update_date=false; @@ -1084,6 +1084,7 @@ void Oximetry::on_RefreshPortsButton_clicked() int z=0; QString firstport; bool current_found=false; + const QString STR_USB="USB"; // Windows build mixes these up #if defined(Q_OS_WIN32) || defined(Q_OS_MAC) @@ -1093,14 +1094,14 @@ void Oximetry::on_RefreshPortsButton_clicked() #endif for (int i = 0; i < ports.size(); i++) { if (!ports.at(i).friendName.isEmpty()) { - if (ports.at(i).friendName.toUpper().contains("USB")) { + if (ports.at(i).friendName.toUpper().contains(STR_USB)) { if (firstport.isEmpty()) firstport=ports.at(i). qesPORTNAME; if (!portname.isEmpty() && ports.at(i).qesPORTNAME==portname) current_found=true; ui->SerialPortsCombo->addItem(ports.at(i).qesPORTNAME); z++; } } else { // Mac stuff. - if (ports.at(i).portName.toUpper().contains("USB") || ports.at(i).portName.toUpper().contains("SPO2")) { + if (ports.at(i).portName.toUpper().contains(STR_USB) || ports.at(i).portName.toUpper().contains("SPO2")) { if (firstport.isEmpty()) firstport=ports.at(i).portName; if (!portname.isEmpty() && ports.at(i).portName==portname) current_found=true; ui->SerialPortsCombo->addItem(ports.at(i).portName); @@ -1320,7 +1321,7 @@ void Oximetry::oximeter_running_check() oximeter->destroySession(); day->getSessions().clear(); ui->SerialPortsCombo->setEnabled(true); - qstatus->setText(tr("Ready")); + qstatus->setText(STR_TR_Ready); ui->ImportButton->setEnabled(true); ui->RunButton->setChecked(false); ui->saveButton->setEnabled(false); @@ -1378,7 +1379,7 @@ void Oximetry::import_finished() // Hanging here.. :( ui->SerialPortsCombo->setEnabled(true); - qstatus->setText(tr("Ready")); + qstatus->setText(STR_TR_Ready); ui->ImportButton->setDisabled(false); ui->saveButton->setEnabled(true);