Make Colors a little more consistent in the code

This commit is contained in:
Mark Watkins 2013-09-11 01:09:09 +10:00
parent 6a833b4c33
commit a3d2be28d7
13 changed files with 330 additions and 199 deletions

View File

@ -12,8 +12,6 @@
gFlagsGroup::gFlagsGroup() gFlagsGroup::gFlagsGroup()
{ {
//static QColor col=Qt::black;
addVertexBuffer(quads=new gVertexBuffer(512,GL_QUADS)); addVertexBuffer(quads=new gVertexBuffer(512,GL_QUADS));
addVertexBuffer(lines=new gVertexBuffer(20,GL_LINE_LOOP)); addVertexBuffer(lines=new gVertexBuffer(20,GL_LINE_LOOP));
quads->setAntiAlias(true); 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); m_barh=float(height)/float(vis);
float linetop=top; float linetop=top;
static QColor col1=QColor(0xd0,0xff,0xd0,0xff); QColor barcol;
static QColor col2=QColor(0xff,0xff,0xff,0xff);
QColor * barcol;
for (int i=0;i<lvisible.size();i++) { for (int i=0;i<lvisible.size();i++) {
// Alternating box color // Alternating box color
if (i & 1) barcol=&col1; else barcol=&col2; 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()); quads->add(left, linetop, left, linetop+m_barh, left+width-1, linetop+m_barh, left+width-1, linetop, barcol.rgba());
// Paint the actual flags // Paint the actual flags
lvisible[i]->paint(w,left,linetop,width,m_barh); 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(); gVertexBuffer *outlines=w.lines();
QColor blk=Qt::black; outlines->add(left-1, top, left-1, top+height, COLOR_Outline.rgba());
outlines->add(left-1, top, left-1, top+height, blk.rgba()); outlines->add(left-1, top+height, left+width,top+height, COLOR_Outline.rgba());
outlines->add(left-1, top+height, left+width,top+height, blk.rgba()); outlines->add(left+width,top+height, left+width, top,COLOR_Outline.rgba());
outlines->add(left+width,top+height, left+width, top,blk.rgba()); outlines->add(left+width, top, left-1, top, COLOR_Outline.rgba());
outlines->add(left+width, top, left-1, top, blk.rgba());
//lines->add(left-1, top, left-1, top+height); //lines->add(left-1, top, left-1, top+height);
//lines->add(left+width, top+height, left+width, top); //lines->add(left+width, top+height, left+width, top);

View File

@ -15,7 +15,7 @@
class gShadowArea:public Layer class gShadowArea:public Layer
{ {
public: 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 ~gShadowArea();
virtual void paint(gGraph & w,int left, int top, int width, int height); virtual void paint(gGraph & w,int left, int top, int width, int height);
protected: protected:

View File

@ -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) :Layer(NoChannel),m_color(col)
{ {
m_miny=m_maxy=0; m_miny=m_maxy=0;

View File

@ -20,7 +20,7 @@ class AHIChart:public Layer
{ {
public: public:
//! \brief Constructs an AHIChart object, with QColor col for the line plots. //! \brief Constructs an AHIChart object, with QColor col for the line plots.
AHIChart(const QColor col=QColor("black")); AHIChart(QColor col=QColor("black"));
~AHIChart(); ~AHIChart();
//! \brief Draws the precalculated data to the Vertex buffers //! \brief Draws the precalculated data to the Vertex buffers

View File

@ -13,7 +13,7 @@
class gXAxis:public Layer class gXAxis:public Layer
{ {
public: public:
gXAxis(QColor col=QColor("black"),bool fadeout=true); gXAxis(QColor col=Qt::black,bool fadeout=true);
virtual ~gXAxis(); virtual ~gXAxis();
virtual void paint(gGraph & w,int left,int top, int width, int height); 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) static const int Margin=20; // How much room does this take up. (Bottom margin)

View File

@ -65,7 +65,7 @@ class gYAxis:public Layer
{ {
public: public:
//! \brief Construct a gYAxis object, with QColor col for tickers & text //! \brief Construct a gYAxis object, with QColor col for tickers & text
gYAxis(QColor col=QColor("black")); gYAxis(QColor col=Qt::black);
virtual ~gYAxis(); virtual ~gYAxis();
//! \brief Draw the horizontal tickers display //! \brief Draw the horizontal tickers display

View File

@ -10,6 +10,39 @@
#include <QtOpenGL/qgl.h> #include <QtOpenGL/qgl.h>
#include <QColor> #include <QColor>
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 /*! \brief Draw an outline of a rounded rectangle
\param radius Radius of corner rounding \param radius Radius of corner rounding
\param lw Line Width \param lw Line Width

View File

@ -2,6 +2,7 @@
#define COMMON_H #define COMMON_H
#include <QString> #include <QString>
#include <QColor>
#include <QObject> #include <QObject>
#include "version.h" #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_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_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_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_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_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_O2=QObject::tr("O2"); // SpO2 Desaturation
const QString STR_TR_PC=QObject::tr("PC"); // Short form for Pulse Change 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_MaskTime=QObject::tr("Mask Time");
const QString STR_TR_Unknown=QObject::tr("Unknown"); const QString STR_TR_Unknown=QObject::tr("Unknown");
const QString STR_TR_None=QObject::tr("None"); 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_First=QObject::tr("First");
const QString STR_TR_Last=QObject::tr("Last"); 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_Avg=QObject::tr("Avg"); // Average
const QString STR_TR_WAvg=QObject::tr("W-Avg"); // Weighted Average const QString STR_TR_WAvg=QObject::tr("W-Avg"); // Weighted Average
#endif // COMMON_H #endif // COMMON_H

View File

@ -25,6 +25,7 @@ void sh_delay(int ms)
#endif #endif
#if (QT_VERSION >= QT_VERSION_CHECK(4,8,0)) #if (QT_VERSION >= QT_VERSION_CHECK(4,8,0))
// Qt 4.8 makes this a whole lot easier // Qt 4.8 makes this a whole lot easier
Qt::DayOfWeek firstDayOfWeekFromLocale() Qt::DayOfWeek firstDayOfWeekFromLocale()
@ -80,6 +81,54 @@ Qt::DayOfWeek firstDayOfWeekFromLocale()
#endif #endif
return firstDay; return firstDay;
} }
#endif #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;

View File

@ -8,6 +8,7 @@
#define COMMON_GUI_H #define COMMON_GUI_H
#include <QLocale> #include <QLocale>
#include "Graphs/glcommon.h"
//! \brief Gets the first day of week from the system locale, to show in the calendars. //! \brief Gets the first day of week from the system locale, to show in the calendars.
Qt::DayOfWeek firstDayOfWeekFromLocale(); Qt::DayOfWeek firstDayOfWeekFromLocale();
@ -15,4 +16,51 @@ Qt::DayOfWeek firstDayOfWeekFromLocale();
//! \brief Delay of ms milliseconds //! \brief Delay of ms milliseconds
void sh_delay(int ms); 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 #endif

216
daily.cpp
View File

@ -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); 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); 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); //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); 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); 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); 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); GAHI=new gGraph(snapGV,tr("Breakdown"),tr("events"),172);
gSegmentChart * evseg=new gSegmentChart(GST_Pie); gSegmentChart * evseg=new gSegmentChart(GST_Pie);
evseg->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),tr("H")); evseg->AddSlice(CPAP_Hypopnea,QColor(0x40,0x40,0xff,0xff),STR_TR_H);
evseg->AddSlice(CPAP_Apnea,QColor(0x20,0x80,0x20,0xff),tr("A")); evseg->AddSlice(CPAP_Apnea,QColor(0x20,0x80,0x20,0xff),STR_TR_UA);
evseg->AddSlice(CPAP_Obstructive,QColor(0x40,0xaf,0xbf,0xff),tr("OA")); evseg->AddSlice(CPAP_Obstructive,QColor(0x40,0xaf,0xbf,0xff),STR_TR_OA);
evseg->AddSlice(CPAP_ClearAirway,QColor(0xb2,0x54,0xcd,0xff),tr("CA")); evseg->AddSlice(CPAP_ClearAirway,QColor(0xb2,0x54,0xcd,0xff),STR_TR_CA);
evseg->AddSlice(CPAP_RERA,QColor(0xff,0xff,0x80,0xff),tr("RE")); evseg->AddSlice(CPAP_RERA,QColor(0xff,0xff,0x80,0xff),STR_TR_RE);
evseg->AddSlice(CPAP_NRI,QColor(0x00,0x80,0x40,0xff),tr("NR")); evseg->AddSlice(CPAP_NRI,QColor(0x00,0x80,0x40,0xff),STR_TR_NR);
evseg->AddSlice(CPAP_FlowLimit,QColor(0x40,0x40,0x40,0xff),tr("FL")); evseg->AddSlice(CPAP_FlowLimit,QColor(0x40,0x40,0x40,0xff),STR_TR_FL);
//evseg->AddSlice(CPAP_UserFlag1,QColor(0x40,0x40,0x40,0xff),tr("UF")); //evseg->AddSlice(CPAP_UserFlag1,QColor(0x40,0x40,0x40,0xff),tr("UF"));
GAHI->AddLayer(AddCPAP(evseg)); GAHI->AddLayer(AddCPAP(evseg));
@ -145,63 +145,63 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
gFlagsGroup *fg=new gFlagsGroup(); gFlagsGroup *fg=new gFlagsGroup();
SF->AddLayer(AddCPAP(fg)); SF->AddLayer(AddCPAP(fg));
fg->AddLayer((new gFlagsLine(CPAP_CSR,QColor("light green"),STR_TR_PB,false,FT_Span))); fg->AddLayer((new gFlagsLine(CPAP_CSR, COLOR_CSR, STR_TR_PB,false,FT_Span)));
fg->AddLayer((new gFlagsLine(CPAP_ClearAirway,QColor("purple"),STR_TR_CA,false))); fg->AddLayer((new gFlagsLine(CPAP_ClearAirway, COLOR_ClearAirway, STR_TR_CA,false)));
fg->AddLayer((new gFlagsLine(CPAP_Obstructive,QColor("#40c0ff"),STR_TR_OA,true))); fg->AddLayer((new gFlagsLine(CPAP_Obstructive, COLOR_Obstructive, STR_TR_OA,true)));
fg->AddLayer((new gFlagsLine(CPAP_Apnea,QColor("dark green"),STR_TR_UA))); fg->AddLayer((new gFlagsLine(CPAP_Apnea, COLOR_Apnea, STR_TR_UA)));
fg->AddLayer((new gFlagsLine(CPAP_Hypopnea,QColor("blue"),STR_TR_H,true))); fg->AddLayer((new gFlagsLine(CPAP_Hypopnea, COLOR_Hypopnea, STR_TR_H,true)));
fg->AddLayer((new gFlagsLine(CPAP_ExP,QColor("dark cyan"),STR_TR_EP,false))); fg->AddLayer((new gFlagsLine(CPAP_ExP, COLOR_ExP, STR_TR_EP,false)));
fg->AddLayer((new gFlagsLine(CPAP_LeakFlag,QColor("dark blue"),STR_TR_LE,false))); fg->AddLayer((new gFlagsLine(CPAP_LeakFlag, COLOR_LeakFlag, STR_TR_LE,false)));
fg->AddLayer((new gFlagsLine(CPAP_NRI,QColor("dark magenta"),STR_TR_NRI,false))); fg->AddLayer((new gFlagsLine(CPAP_NRI, COLOR_NRI, STR_TR_NRI,false)));
fg->AddLayer((new gFlagsLine(CPAP_FlowLimit,QColor("black"),STR_TR_FL))); fg->AddLayer((new gFlagsLine(CPAP_FlowLimit, COLOR_FlowLimit, STR_TR_FL)));
fg->AddLayer((new gFlagsLine(CPAP_RERA,QColor("gold"),STR_TR_RE))); fg->AddLayer((new gFlagsLine(CPAP_RERA, COLOR_RERA, STR_TR_RE)));
fg->AddLayer((new gFlagsLine(CPAP_VSnore,QColor("red"),STR_TR_VS))); fg->AddLayer((new gFlagsLine(CPAP_VSnore, COLOR_VibratorySnore, STR_TR_VS)));
fg->AddLayer((new gFlagsLine(CPAP_VSnore2,QColor("red"),STR_TR_VS2))); fg->AddLayer((new gFlagsLine(CPAP_VSnore2, COLOR_VibratorySnore, STR_TR_VS2)));
if (PROFILE.cpap->userEventFlagging()) { if (PROFILE.cpap->userEventFlagging()) {
fg->AddLayer((new gFlagsLine(CPAP_UserFlag1,QColor("yellow"),tr("UF1")))); fg->AddLayer((new gFlagsLine(CPAP_UserFlag1, COLOR_Yellow, STR_TR_UF1)));
fg->AddLayer((new gFlagsLine(CPAP_UserFlag2,QColor("green"),tr("UF2")))); fg->AddLayer((new gFlagsLine(CPAP_UserFlag2, COLOR_DarkGreen, STR_TR_UF2)));
fg->AddLayer((new gFlagsLine(CPAP_UserFlag3,QColor("brown"),tr("UF3")))); 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->setBlockZoom(true);
SF->AddLayer(new gShadowArea()); SF->AddLayer(new gShadowArea());
SF->AddLayer(new gYSpacer(),LayerLeft,gYAxis::Margin); SF->AddLayer(new gYSpacer(),LayerLeft,gYAxis::Margin);
//SF->AddLayer(new gFooBar(),LayerBottom,0,1); //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; 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); gLineOverlaySummary *los=new gLineOverlaySummary(tr("Selection AHI"),5,-4);
AddCPAP(l); AddCPAP(l);
FRW->AddLayer(new gXGrid()); 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(l);
FRW->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin); FRW->AddLayer(new gYAxis(),LayerLeft,gYAxis::Margin);
FRW->AddLayer(new gXAxis(),LayerBottom,0,20); FRW->AddLayer(new gXAxis(),LayerBottom,0,20);
FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Hypopnea,QColor("blue"),STR_TR_H)))); FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Hypopnea,COLOR_Hypopnea,STR_TR_H))));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,QColor("red"),STR_TR_PP,FT_Dot))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_PressurePulse,COLOR_PressurePulse,STR_TR_PP,FT_Dot)));
//FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure,QColor("white"),tr("P"),FT_Dot))); //FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Pressure, COLOR_White,STR_TR_P,FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0B,QColor("blue"),"0B",FT_Dot))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0B,COLOR_Blue,"0B",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_10,QColor("orange"),"10",FT_Dot))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_10,COLOR_Orange,"10",FT_Dot)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0E,QColor("dark red"),"0E",FT_Dot))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_0E,COLOR_DarkRed,"0E",FT_Dot)));
if (PROFILE.general->calculateRDI()) 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 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(los->add(new gLineOverlayBar(CPAP_Apnea, COLOR_Apnea, STR_TR_UA))));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore,QColor("red"),tr("VS")))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore, COLOR_VibratorySnore, STR_TR_VS)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_FlowLimit,QColor("black"),tr("FL")))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_FlowLimit, COLOR_FlowLimit, STR_TR_FL)));
FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Obstructive,QColor("#40c0ff"),STR_TR_OA)))); FRW->AddLayer(AddCPAP(los->add(new gLineOverlayBar(CPAP_Obstructive, COLOR_Obstructive, 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_ClearAirway, COLOR_ClearAirway, STR_TR_CA))));
if (PROFILE.cpap->userEventFlagging()) { if (PROFILE.cpap->userEventFlagging()) {
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag1,QColor("yellow"),tr("U1"),FT_Bar))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag1, COLOR_Yellow, tr("U1"),FT_Bar)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag2,QColor("orange"),tr("U2"),FT_Bar))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag2, COLOR_Orange, tr("U2"),FT_Bar)));
FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_UserFlag3,QColor("brown"),tr("U3"),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_SPO2Drop, COLOR_SPO2Drop, STR_TR_O2)));
//FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange,QColor("blue"),STR_TR_PC,FT_Dot))); //FRW->AddLayer(AddOXI(new gLineOverlayBar(OXI_PulseChange, COLOR_PulseChange, STR_TR_PC,FT_Dot)));
FRW->AddLayer(AddCPAP(los)); FRW->AddLayer(AddCPAP(los));
@ -227,65 +227,65 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
bool square=PROFILE.appearance->squareWavePlots(); 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)); PRD->AddLayer(AddCPAP(pc));
pc->addPlot(CPAP_EPAP,Qt::blue,square); pc->addPlot(CPAP_EPAP, COLOR_EPAP, square);
pc->addPlot(CPAP_IPAPLo,Qt::darkRed,square); pc->addPlot(CPAP_IPAPLo, COLOR_IPAPLo, square);
pc->addPlot(CPAP_IPAP,Qt::red,square); pc->addPlot(CPAP_IPAP, COLOR_IPAP, square);
pc->addPlot(CPAP_IPAPHi,Qt::darkRed,square); pc->addPlot(CPAP_IPAPHi, COLOR_IPAPHi, square);
if (PROFILE.general->calculateRDI()) { 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")))); // AHI->AddLayer(AddCPAP(new AHIChart(QColor("#37a24b"))));
} else { } 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); gLineChart *lc=new gLineChart(CPAP_LeakTotal, COLOR_LeakTotal, square);
lc->addPlot(CPAP_Leak,Qt::darkMagenta,square); lc->addPlot(CPAP_Leak, COLOR_Leak, square);
lc->addPlot(CPAP_MaxLeak,Qt::darkRed,square); lc->addPlot(CPAP_MaxLeak, COLOR_MaxLeak, square);
LEAK->AddLayer(AddCPAP(lc)); LEAK->AddLayer(AddCPAP(lc));
//LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_Leak,Qt::darkMagenta,square))); //LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_Leak, COLOR_Leak,square)));
//LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_MaxLeak,Qt::darkRed,square))); //LEAK->AddLayer(AddCPAP(new gLineChart(CPAP_MaxLeak, COLOR_MaxLeak,square)));
SNORE->AddLayer(AddCPAP(new gLineChart(CPAP_Snore,Qt::darkGray,true))); SNORE->AddLayer(AddCPAP(new gLineChart(CPAP_Snore, COLOR_Snore, true)));
PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PTB,Qt::gray,square))); PTB->AddLayer(AddCPAP(new gLineChart(CPAP_PTB, COLOR_PTB, square)));
MP->AddLayer(AddCPAP(new gLineChart(CPAP_MaskPressure,Qt::blue,false))); MP->AddLayer(AddCPAP(new gLineChart(CPAP_MaskPressure, COLOR_MaskPressure, false)));
RR->AddLayer(AddCPAP(lc=new gLineChart(CPAP_RespRate,Qt::darkBlue,square))); RR->AddLayer(AddCPAP(lc=new gLineChart(CPAP_RespRate, COLOR_RespRate, square)));
// Delete me!! // 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))); MV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_MinuteVent, COLOR_MinuteVent, square)));
lc->addPlot(CPAP_TgMV,Qt::darkCyan,square); lc->addPlot(CPAP_TgMV,COLOR_TgMV,square);
TV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_TidalVolume,Qt::magenta,square))); TV->AddLayer(AddCPAP(lc=new gLineChart(CPAP_TidalVolume,COLOR_TidalVolume,square)));
//lc->addPlot(CPAP_Test2,Qt::darkYellow,square); //lc->addPlot(CPAP_Test2,COLOR_DarkYellow,square);
//TV->AddLayer(AddCPAP(new gLineChart("TidalVolume2",Qt::magenta,square))); //TV->AddLayer(AddCPAP(new gLineChart("TidalVolume2",COLOR_Magenta,square)));
FLG->AddLayer(AddCPAP(new gLineChart(CPAP_FLG,Qt::darkBlue,true))); FLG->AddLayer(AddCPAP(new gLineChart(CPAP_FLG, COLOR_FLG, true)));
//RE->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryEvent,Qt::magenta,true))); //RE->AddLayer(AddCPAP(new gLineChart(CPAP_RespiratoryEvent,COLOR_Magenta,true)));
IE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_IE,Qt::darkRed,square))); IE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_IE, COLOR_IE, square)));
TE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Te,Qt::darkGreen,square))); TE->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Te, COLOR_Te, square)));
TI->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Ti,Qt::darkBlue,square))); TI->AddLayer(AddCPAP(lc=new gLineChart(CPAP_Ti, COLOR_Ti, square)));
//lc->addPlot(CPAP_Test2,Qt::darkYellow,square); //lc->addPlot(CPAP_Test2,COLOR:DarkYellow,square);
//INTPULSE->AddLayer(AddCPAP(new gLineChart(OXI_Pulse,Qt::red,square))); //INTPULSE->AddLayer(AddCPAP(new gLineChart(OXI_Pulse, COLOR_Pulse, square)));
//INTSPO2->AddLayer(AddCPAP(new gLineChart(OXI_SPO2,Qt::blue,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 *los1=new gLineOverlaySummary(tr("Events/hour"),5,-4);
gLineOverlaySummary *los2=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)); 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)); SPO2->AddLayer(AddOXI(los2));
PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse,Qt::red,square))); PULSE->AddLayer(AddOXI(new gLineChart(OXI_Pulse, COLOR_Pulse, square)));
SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2,Qt::blue,true))); SPO2->AddLayer(AddOXI(new gLineChart(OXI_SPO2, COLOR_SPO2, true)));
PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethy,Qt::darkBlue,false))); PLETHY->AddLayer(AddOXI(new gLineChart(OXI_Plethy, COLOR_Plethy,false)));
PTB->setForceMaxY(100); PTB->setForceMaxY(100);
SPO2->setForceMaxY(100); SPO2->setForceMaxY(100);
@ -298,7 +298,7 @@ Daily::Daily(QWidget *parent,gGraphView * shared)
layout->layout(); layout->layout();
QTextCharFormat format = ui->calendar->weekdayTextFormat(Qt::Saturday); 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::Saturday, format);
ui->calendar->setWeekdayTextFormat(Qt::Sunday, format); ui->calendar->setWeekdayTextFormat(Qt::Sunday, format);
@ -552,19 +552,19 @@ void Daily::UpdateCalendarDay(QDate date)
QTextCharFormat jourday; QTextCharFormat jourday;
QTextCharFormat stageday; QTextCharFormat stageday;
cpaponly.setForeground(QBrush(Qt::blue, Qt::SolidPattern)); cpaponly.setForeground(QBrush(COLOR_Blue, Qt::SolidPattern));
cpaponly.setFontWeight(QFont::Normal); cpaponly.setFontWeight(QFont::Normal);
cpapjour.setForeground(QBrush(Qt::blue, Qt::SolidPattern)); cpapjour.setForeground(QBrush(COLOR_Blue, Qt::SolidPattern));
cpapjour.setFontWeight(QFont::Bold); cpapjour.setFontWeight(QFont::Bold);
oxiday.setForeground(QBrush(Qt::red, Qt::SolidPattern)); oxiday.setForeground(QBrush(COLOR_Red, Qt::SolidPattern));
oxiday.setFontWeight(QFont::Normal); oxiday.setFontWeight(QFont::Normal);
oxicpap.setForeground(QBrush(Qt::red, Qt::SolidPattern)); oxicpap.setForeground(QBrush(COLOR_Red, Qt::SolidPattern));
oxicpap.setFontWeight(QFont::Bold); oxicpap.setFontWeight(QFont::Bold);
stageday.setForeground(QBrush(Qt::magenta, Qt::SolidPattern)); stageday.setForeground(QBrush(COLOR_Magenta, Qt::SolidPattern));
stageday.setFontWeight(QFont::Bold); stageday.setFontWeight(QFont::Bold);
jourday.setForeground(QBrush(QColor("black"), Qt::SolidPattern)); jourday.setForeground(QBrush(COLOR_Black, Qt::SolidPattern));
jourday.setFontWeight(QFont::Bold); jourday.setFontWeight(QFont::Bold);
nodata.setForeground(QBrush(QColor("black"), Qt::SolidPattern)); nodata.setForeground(QBrush(COLOR_Black, Qt::SolidPattern));
nodata.setFontWeight(QFont::Normal); nodata.setFontWeight(QFont::Normal);
bool hascpap=PROFILE.GetDay(date,MT_CPAP)!=NULL; bool hascpap=PROFILE.GetDay(date,MT_CPAP)!=NULL;
@ -826,10 +826,10 @@ void Daily::Load(QDate date)
if (!isBrick && hours>0) { if (!isBrick && hours>0) {
if (PROFILE.general->calculateRDI()) { if (PROFILE.general->calculateRDI()) {
html+=QString("<tr><td bgcolor='%1' align=center colspan=4><font size=+2 color='%2'><a class=info2 href='#'><font size=+2><b>%3</b></font><span>%4</span></a> <b>%5</b></font></td></tr>\n") html+=QString("<tr><td bgcolor='%1' align=center colspan=4><font size=+2 color='%2'><a class=info2 href='#'><font size=+2><b>%3</b></font><span>%4</span></a> <b>%5</b></font></td></tr>\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 { } else {
html+=QString("<tr><td bgcolor='%1' align=center colspan=4><font size=+2 color='%2'><a class=info2 href='#'><font size=+2><b>%3</b></font><span>%4</span></a> <b>%5</b></font></td></tr>\n") html+=QString("<tr><td bgcolor='%1' align=center colspan=4><font size=+2 color='%2'><a class=info2 href='#'><font size=+2><b>%3</b></font><span>%4</span></a> <b>%5</b></font></td></tr>\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) { if (cpap->machine->GetClass()==STR_MACH_ResMed || cpap->machine->GetClass()==STR_MACH_FPIcon) {
@ -838,32 +838,32 @@ void Daily::Load(QDate date)
html+="<tr><td valign=top colspan="+cs+"<table cellspacing=0 cellpadding=1 border=0 width='100%'>"; html+="<tr><td valign=top colspan="+cs+"<table cellspacing=0 cellpadding=1 border=0 width='100%'>";
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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) { if (cpap->machine->GetClass()==STR_MACH_ResMed) {
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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); .arg(tr("Apnea")).arg(schema::channel[CPAP_Apnea].description()).arg(uai,0,'f',2).arg(CPAP_Apnea);
} }
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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) { if (cpap->machine->GetClass()==STR_MACH_FPIcon) {
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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 { } else {
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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) { if (cpap->machine->GetClass()==STR_MACH_Intellipap) {
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\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()) { if (PROFILE.cpap->userEventFlagging()) {
EventDataType uf1=cpap->count(CPAP_UserFlag1) / cpap->hours(); EventDataType uf1=cpap->count(CPAP_UserFlag1) / cpap->hours();
if (uf1>0) if (uf1>0)
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n")
.arg("#e0e0e0").arg("black") .arg(COLOR_UserFlag1.name()).arg(COLOR_Text.name())
.arg(tr("User Flags")) .arg(tr("User Flags"))
.arg(schema::channel[CPAP_UserFlag1].description()) .arg(schema::channel[CPAP_UserFlag1].description())
.arg(uf1,0,'f',2).arg(CPAP_UserFlag1); .arg(uf1,0,'f',2).arg(CPAP_UserFlag1);
@ -874,31 +874,31 @@ void Daily::Load(QDate date)
if (cpap->machine->GetClass()==STR_MACH_PRS1) { if (cpap->machine->GetClass()==STR_MACH_PRS1) {
html+="<td colspan=2 valign=top><table cellspacing=0 cellpadding=1 border=0 width='100%'>"; html+="<td colspan=2 valign=top><table cellspacing=0 cellpadding=1 border=0 width='100%'>";
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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) { if (mode>MODE_CPAP) {
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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 { } else {
//html+="<tr bgcolor='#404040'><td colspan=2>&nbsp;</td></tr>"; //html+="<tr bgcolor='#404040'><td colspan=2>&nbsp;</td></tr>";
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\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+="</table></td>"; html+="</table></td>";
} else if (cpap->machine->GetClass()==STR_MACH_Intellipap) { } else if (cpap->machine->GetClass()==STR_MACH_Intellipap) {
html+="<td colspan=2 valign=top><table cellspacing=0 cellpadding=1 border=0 width='100%'>"; html+="<td colspan=2 valign=top><table cellspacing=0 cellpadding=1 border=0 width='100%'>";
html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\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("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5</font></b></td></tr>\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("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\n") html+=QString("<tr><td align='left' bgcolor='%1'><b><font color='%2'><a class=info2 href='event=%6'>%3<span>%4</span></a></font></b></td><td width=20% bgcolor='%1'><b><font color='%2'>%5%</font></b></td></tr>\n")
.arg("#80ff80").arg("black").arg(tr("Exh&nbsp;Puff")).arg(schema::channel[CPAP_ExP].description()).arg(exp,0,'f',2).arg(CPAP_ExP); .arg(COLOR_ExP.name()).arg("white").arg(tr("Exh&nbsp;Puff")).arg(schema::channel[CPAP_ExP].description()).arg(exp,0,'f',2).arg(CPAP_ExP);
html+="</table></td>"; html+="</table></td>";
@ -1021,7 +1021,7 @@ void Daily::Load(QDate date)
} }
} }
html+=QString("<tr><td align=left class='info' onmouseover=\"style.color='blue';\" onmouseout=\"style.color='black';\">%1<span>%6</span></td><td>%2</td><td>%3</td><td>%4</td><td>%5</td></tr>") html+=QString("<tr><td align=left class='info' onmouseover=\"style.color='blue';\" onmouseout=\"style.color='"+COLOR_Text.name()+"';\">%1<span>%6</span></td><td>%2</td><td>%3</td><td>%4</td><td>%5</td></tr>")
//.arg(QString("<a class='info' href='graph=%1'>%3<span>%2</span></a>") //<a class='tooltip' href='#'>"+STR_TR_RDI+"<span class='classic'>"+ //.arg(QString("<a class='info' href='graph=%1'>%3<span>%2</span></a>") //<a class='tooltip' href='#'>"+STR_TR_RDI+"<span class='classic'>"+
//.arg(QString::number(code)).arg(tooltip).arg(schema::channel[code].label())) //.arg(QString::number(code)).arg(tooltip).arg(schema::channel[code].label()))
.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() 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; if (!col.isValid()) return;
QTextCursor cursor = ui->JournalNotes->textCursor(); QTextCursor cursor = ui->JournalNotes->textCursor();

View File

@ -50,7 +50,7 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
// Stop both calendar drop downs highlighting weekends in red // Stop both calendar drop downs highlighting weekends in red
QTextCharFormat format = ui->dateStart->calendarWidget()->weekdayTextFormat(Qt::Saturday); 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::Saturday, format);
ui->dateStart->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format); ui->dateStart->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format);
ui->dateEnd->calendarWidget()->setWeekdayTextFormat(Qt::Saturday, 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)")); ZOMBIE=createGraph(STR_TR_Zombie,tr("How you felt\n(0-10)"));
ahihr=new SummaryChart(tr("Events/Hr"),GT_LINE); ahihr=new SummaryChart(tr("Events/Hr"),GT_LINE);
ahihr->addSlice(ahicode,QColor("blue"),ST_MAX); ahihr->addSlice(ahicode,COLOR_Blue,ST_MAX);
ahihr->addSlice(ahicode,QColor("orange"),ST_WAVG); ahihr->addSlice(ahicode,COLOR_Orange,ST_WAVG);
AHIHR->AddLayer(ahihr); AHIHR->AddLayer(ahihr);
weight=new SummaryChart(STR_TR_Weight,GT_LINE); weight=new SummaryChart(STR_TR_Weight,GT_LINE);
weight->setMachineType(MT_JOURNAL); weight->setMachineType(MT_JOURNAL);
weight->addSlice(Journal_Weight,QColor("black"),ST_SETAVG); weight->addSlice(Journal_Weight,COLOR_Black,ST_SETAVG);
WEIGHT->AddLayer(weight); WEIGHT->AddLayer(weight);
bmi=new SummaryChart(STR_TR_BMI,GT_LINE); bmi=new SummaryChart(STR_TR_BMI,GT_LINE);
bmi->setMachineType(MT_JOURNAL); bmi->setMachineType(MT_JOURNAL);
bmi->addSlice(Journal_BMI,QColor("dark blue"),ST_SETAVG); bmi->addSlice(Journal_BMI,COLOR_DarkBlue,ST_SETAVG);
BMI->AddLayer(bmi); BMI->AddLayer(bmi);
zombie=new SummaryChart(tr("Zombie Meter"),GT_LINE); zombie=new SummaryChart(tr("Zombie Meter"),GT_LINE);
zombie->setMachineType(MT_JOURNAL); zombie->setMachineType(MT_JOURNAL);
zombie->addSlice(Journal_ZombieMeter,QColor("dark red"),ST_SETAVG); zombie->addSlice(Journal_ZombieMeter,COLOR_DarkRed,ST_SETAVG);
ZOMBIE->AddLayer(zombie); ZOMBIE->AddLayer(zombie);
pulse=new SummaryChart(STR_TR_PulseRate,GT_LINE); pulse=new SummaryChart(STR_TR_PulseRate,GT_LINE);
pulse->setMachineType(MT_OXIMETER); pulse->setMachineType(MT_OXIMETER);
pulse->addSlice(OXI_Pulse,QColor("red"),ST_mid,0.5); pulse->addSlice(OXI_Pulse,COLOR_Red,ST_mid,0.5);
pulse->addSlice(OXI_Pulse,QColor("pink"),ST_MIN); pulse->addSlice(OXI_Pulse,COLOR_Pink,ST_MIN);
pulse->addSlice(OXI_Pulse,QColor("orange"),ST_MAX); pulse->addSlice(OXI_Pulse,COLOR_Orange,ST_MAX);
PULSE->AddLayer(pulse); PULSE->AddLayer(pulse);
spo2=new SummaryChart(STR_TR_SpO2,GT_LINE); spo2=new SummaryChart(STR_TR_SpO2,GT_LINE);
spo2->setMachineType(MT_OXIMETER); spo2->setMachineType(MT_OXIMETER);
spo2->addSlice(OXI_SPO2,QColor("cyan"),ST_mid,0.5); spo2->addSlice(OXI_SPO2,COLOR_Cyan,ST_mid,0.5);
spo2->addSlice(OXI_SPO2,QColor("light blue"),ST_PERC,percentile); spo2->addSlice(OXI_SPO2,COLOR_LightBlue,ST_PERC,percentile);
spo2->addSlice(OXI_SPO2,QColor("blue"),ST_MIN); spo2->addSlice(OXI_SPO2,COLOR_Blue,ST_MIN);
SPO2->AddLayer(spo2); SPO2->AddLayer(spo2);
uc=new SummaryChart(STR_UNIT_Hours,GT_BAR); 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); UC->AddLayer(uc);
fl=new SummaryChart(STR_TR_FL,GT_BAR); 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); FL->AddLayer(fl);
us=new SummaryChart(STR_UNIT_Hours,GT_SESSIONS); us=new SummaryChart(STR_UNIT_Hours,GT_SESSIONS);
us->addSlice(NoChannel,QColor("dark blue"),ST_HOURS); us->addSlice(NoChannel, COLOR_DarkBlue, ST_HOURS);
us->addSlice(NoChannel,QColor("blue"),ST_SESSIONS); us->addSlice(NoChannel, COLOR_Blue, ST_SESSIONS);
US->AddLayer(us); US->AddLayer(us);
ses=new SummaryChart(STR_TR_Sessions,GT_LINE); 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); SES->AddLayer(ses);
if (ahicode==CPAP_RDI) if (ahicode==CPAP_RDI)
bc=new SummaryChart(STR_TR_RDI,GT_BAR); bc=new SummaryChart(STR_TR_RDI, GT_BAR);
else else
bc=new SummaryChart(STR_TR_AHI,GT_BAR); bc=new SummaryChart(STR_TR_AHI, GT_BAR);
bc->addSlice(CPAP_Hypopnea,QColor("blue"),ST_CPH); bc->addSlice(CPAP_Hypopnea, COLOR_Hypopnea, ST_CPH);
bc->addSlice(CPAP_Apnea,QColor("dark green"),ST_CPH); bc->addSlice(CPAP_Apnea, COLOR_Apnea, ST_CPH);
bc->addSlice(CPAP_Obstructive,QColor("#40c0ff"),ST_CPH); bc->addSlice(CPAP_Obstructive, COLOR_Obstructive, ST_CPH);
bc->addSlice(CPAP_ClearAirway,QColor("purple"),ST_CPH); bc->addSlice(CPAP_ClearAirway, COLOR_ClearAirway, ST_CPH);
if (PROFILE.general->calculateRDI()) { if (PROFILE.general->calculateRDI()) {
bc->addSlice(CPAP_RERA,QColor("gold"),ST_CPH); bc->addSlice(CPAP_RERA, COLOR_RERA, ST_CPH);
} }
AHI->AddLayer(bc); AHI->AddLayer(bc);
set=new SummaryChart("",GT_LINE); set=new SummaryChart("",GT_LINE);
//set->addSlice(PRS1_SysOneResistSet,QColor("grey"),ST_SETAVG); //set->addSlice(PRS1_SysOneResistSet,COLOR_Gray,ST_SETAVG);
set->addSlice(CPAP_HumidSetting,QColor("blue"),ST_SETWAVG); set->addSlice(CPAP_HumidSetting, COLOR_Blue, ST_SETWAVG);
set->addSlice(CPAP_PresReliefSet,QColor("red"),ST_SETWAVG); set->addSlice(CPAP_PresReliefSet, COLOR_Red, ST_SETWAVG);
//set->addSlice(RMS9_EPRSet,QColor("green"),ST_SETWAVG); //set->addSlice(RMS9_EPRSet,COLOR_Green,ST_SETWAVG);
//set->addSlice(INTP_SmartFlex,QColor("purple"),ST_SETWAVG); //set->addSlice(INTP_SmartFlex,COLOR_Purple,ST_SETWAVG);
SET->AddLayer(set); SET->AddLayer(set);
rr=new SummaryChart(tr("breaths/min"),GT_LINE); rr=new SummaryChart(tr("breaths/min"),GT_LINE);
rr->addSlice(CPAP_RespRate,QColor("light blue"),ST_MIN); rr->addSlice(CPAP_RespRate, COLOR_LightBlue, ST_MIN);
rr->addSlice(CPAP_RespRate,QColor("blue"),ST_mid,0.5); rr->addSlice(CPAP_RespRate, COLOR_Blue, ST_mid,0.5);
rr->addSlice(CPAP_RespRate,QColor("light green"),ST_PERC,percentile); rr->addSlice(CPAP_RespRate, COLOR_LightGreen, ST_PERC,percentile);
rr->addSlice(CPAP_RespRate,QColor("green"),ST_max,maxperc); rr->addSlice(CPAP_RespRate, COLOR_Green, ST_max,maxperc);
// rr->addSlice(CPAP_RespRate,QColor("green"),ST_MAX); // rr->addSlice(CPAP_RespRate,COLOR_Green,ST_MAX);
RR->AddLayer(rr); RR->AddLayer(rr);
tv=new SummaryChart(tr("L/b"),GT_LINE); tv=new SummaryChart(tr("L/b"),GT_LINE);
tv->addSlice(CPAP_TidalVolume,QColor("light blue"),ST_MIN); tv->addSlice(CPAP_TidalVolume,COLOR_LightBlue,ST_MIN);
tv->addSlice(CPAP_TidalVolume,QColor("blue"),ST_mid,0.5); tv->addSlice(CPAP_TidalVolume,COLOR_Blue,ST_mid,0.5);
tv->addSlice(CPAP_TidalVolume,QColor("light green"),ST_PERC,percentile); tv->addSlice(CPAP_TidalVolume,COLOR_LightGreen,ST_PERC,percentile);
tv->addSlice(CPAP_TidalVolume,QColor("green"),ST_max,maxperc); tv->addSlice(CPAP_TidalVolume,COLOR_Green,ST_max,maxperc);
TV->AddLayer(tv); TV->AddLayer(tv);
mv=new SummaryChart(STR_UNIT_LPM,GT_LINE); mv=new SummaryChart(STR_UNIT_LPM,GT_LINE);
mv->addSlice(CPAP_MinuteVent,QColor("light blue"),ST_MIN); mv->addSlice(CPAP_MinuteVent,COLOR_LightBlue,ST_MIN);
mv->addSlice(CPAP_MinuteVent,QColor("blue"),ST_mid,0.5); mv->addSlice(CPAP_MinuteVent,COLOR_Blue,ST_mid,0.5);
mv->addSlice(CPAP_MinuteVent,QColor("light green"),ST_PERC,percentile); mv->addSlice(CPAP_MinuteVent,COLOR_LightGreen,ST_PERC,percentile);
mv->addSlice(CPAP_MinuteVent,QColor("green"),ST_max,maxperc); mv->addSlice(CPAP_MinuteVent,COLOR_Green,ST_max,maxperc);
MV->AddLayer(mv); MV->AddLayer(mv);
// should merge... // should merge...
tgmv=new SummaryChart(STR_UNIT_LPM,GT_LINE); tgmv=new SummaryChart(STR_UNIT_LPM,GT_LINE);
tgmv->addSlice(CPAP_TgMV,QColor("light blue"),ST_MIN); tgmv->addSlice(CPAP_TgMV,COLOR_LightBlue,ST_MIN);
tgmv->addSlice(CPAP_TgMV,QColor("blue"),ST_mid,0.5); tgmv->addSlice(CPAP_TgMV,COLOR_Blue,ST_mid,0.5);
tgmv->addSlice(CPAP_TgMV,QColor("light green"),ST_PERC,percentile); tgmv->addSlice(CPAP_TgMV,COLOR_LightGreen,ST_PERC,percentile);
tgmv->addSlice(CPAP_TgMV,QColor("green"),ST_max,maxperc); tgmv->addSlice(CPAP_TgMV,COLOR_Green,ST_max,maxperc);
TGMV->AddLayer(tgmv); TGMV->AddLayer(tgmv);
ptb=new SummaryChart(tr("%PTB"),GT_LINE); ptb=new SummaryChart(tr("%PTB"),GT_LINE);
ptb->addSlice(CPAP_PTB,QColor("yellow"),ST_MIN); ptb->addSlice(CPAP_PTB,COLOR_Yellow,ST_MIN);
ptb->addSlice(CPAP_PTB,QColor("blue"),ST_mid,0.5); ptb->addSlice(CPAP_PTB,COLOR_Blue,ST_mid,0.5);
ptb->addSlice(CPAP_PTB,QColor("light gray"),ST_PERC,percentile); ptb->addSlice(CPAP_PTB,COLOR_LightGray,ST_PERC,percentile);
ptb->addSlice(CPAP_PTB,QColor("orange"),ST_WAVG); ptb->addSlice(CPAP_PTB,COLOR_Orange,ST_WAVG);
PTB->AddLayer(ptb); PTB->AddLayer(ptb);
pr=new SummaryChart(STR_TR_Pressure,GT_LINE); pr=new SummaryChart(STR_TR_Pressure,GT_LINE);
@ -249,23 +249,23 @@ Overview::Overview(QWidget *parent,gGraphView * shared) :
PR->AddLayer(pr); PR->AddLayer(pr);
lk=new SummaryChart(STR_TR_Leaks,GT_LINE); lk=new SummaryChart(STR_TR_Leaks,GT_LINE);
lk->addSlice(CPAP_Leak,QColor("light blue"),ST_mid,0.5); lk->addSlice(CPAP_Leak,COLOR_LightBlue,ST_mid,0.5);
lk->addSlice(CPAP_Leak,QColor("dark grey"),ST_PERC,percentile); lk->addSlice(CPAP_Leak,COLOR_DarkGray,ST_PERC,percentile);
//lk->addSlice(CPAP_Leak,QColor("dark blue"),ST_WAVG); //lk->addSlice(CPAP_Leak,COLOR_DarkBlue,ST_WAVG);
lk->addSlice(CPAP_Leak,QColor("grey"),ST_max,maxperc); lk->addSlice(CPAP_Leak,COLOR_Gray,ST_max,maxperc);
//lk->addSlice(CPAP_Leak,QColor("dark yellow")); //lk->addSlice(CPAP_Leak,COLOR_DarkYellow);
LK->AddLayer(lk); LK->AddLayer(lk);
totlk=new SummaryChart(STR_TR_TotalLeaks,GT_LINE); totlk=new SummaryChart(STR_TR_TotalLeaks,GT_LINE);
totlk->addSlice(CPAP_LeakTotal,QColor("light blue"),ST_mid,0.5); totlk->addSlice(CPAP_LeakTotal, COLOR_LightBlue, ST_mid,0.5);
totlk->addSlice(CPAP_LeakTotal,QColor("dark grey"),ST_PERC,percentile); totlk->addSlice(CPAP_LeakTotal, COLOR_DarkGray, ST_PERC,percentile);
totlk->addSlice(CPAP_LeakTotal,QColor("grey"),ST_max,maxperc); totlk->addSlice(CPAP_LeakTotal, COLOR_Gray, ST_max,maxperc);
//tot->addSlice(CPAP_Leak,QColor("dark blue"),ST_WAVG); //tot->addSlice(CPAP_Leak, COLOR_DarkBlue, ST_WAVG);
//tot->addSlice(CPAP_Leak,QColor("dark yellow")); //tot->addSlice(CPAP_Leak, COLOR_DarkYellow);
TOTLK->AddLayer(totlk); TOTLK->AddLayer(totlk);
NPB->AddLayer(npb=new SummaryChart(tr("% PB"),GT_BAR)); 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 // <--- The code to the previous marker is crap
GraphView->LoadSettings("Overview"); //no trans GraphView->LoadSettings("Overview"); //no trans

View File

@ -1015,22 +1015,22 @@ Oximetry::Oximetry(QWidget *parent,gGraphView * shared) :
g->AddLayer(new gXGrid()); 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); plethy->SetDay(day);
CONTROL->AddLayer(plethy); //new gLineChart(OXI_Plethysomogram)); 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); //pulse->SetDay(day);
spo2=new gLineChart(OXI_SPO2,Qt::blue,true); spo2=new gLineChart(OXI_SPO2,COLOR_SPO2,true);
//spo2->SetDay(day); //spo2->SetDay(day);
PLETHY->AddLayer(plethy); PLETHY->AddLayer(plethy);
PULSE->AddLayer(lo1=new gLineOverlayBar(OXI_PulseChange,QColor("light gray"),STR_TR_PC,FT_Span)); PULSE->AddLayer(lo1=new gLineOverlayBar(OXI_PulseChange,COLOR_PulseChange,STR_TR_PC,FT_Span));
SPO2->AddLayer(lo2=new gLineOverlayBar(OXI_SPO2Drop,QColor("light blue"),STR_TR_O2,FT_Span)); SPO2->AddLayer(lo2=new gLineOverlayBar(OXI_SPO2Drop,COLOR_SPO2Drop,STR_TR_O2,FT_Span));
PULSE->AddLayer(pulse); PULSE->AddLayer(pulse);
SPO2->AddLayer(spo2); SPO2->AddLayer(spo2);
PULSE->setDay(day); PULSE->setDay(day);
@ -1063,7 +1063,7 @@ Oximetry::Oximetry(QWidget *parent,gGraphView * shared) :
// Stop both calendar drop downs highlighting weekends in red // Stop both calendar drop downs highlighting weekends in red
//QTextCharFormat format = ui->dateEdit->calendarWidget()->weekdayTextFormat(Qt::Saturday); //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::Saturday, format);
//ui->dateEdit->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format); //ui->dateEdit->calendarWidget()->setWeekdayTextFormat(Qt::Sunday, format);
dont_update_date=false; dont_update_date=false;
@ -1084,6 +1084,7 @@ void Oximetry::on_RefreshPortsButton_clicked()
int z=0; int z=0;
QString firstport; QString firstport;
bool current_found=false; bool current_found=false;
const QString STR_USB="USB";
// Windows build mixes these up // Windows build mixes these up
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC) #if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
@ -1093,14 +1094,14 @@ void Oximetry::on_RefreshPortsButton_clicked()
#endif #endif
for (int i = 0; i < ports.size(); i++) { for (int i = 0; i < ports.size(); i++) {
if (!ports.at(i).friendName.isEmpty()) { 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 (firstport.isEmpty()) firstport=ports.at(i). qesPORTNAME;
if (!portname.isEmpty() && ports.at(i).qesPORTNAME==portname) current_found=true; if (!portname.isEmpty() && ports.at(i).qesPORTNAME==portname) current_found=true;
ui->SerialPortsCombo->addItem(ports.at(i).qesPORTNAME); ui->SerialPortsCombo->addItem(ports.at(i).qesPORTNAME);
z++; z++;
} }
} else { // Mac stuff. } 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 (firstport.isEmpty()) firstport=ports.at(i).portName;
if (!portname.isEmpty() && ports.at(i).portName==portname) current_found=true; if (!portname.isEmpty() && ports.at(i).portName==portname) current_found=true;
ui->SerialPortsCombo->addItem(ports.at(i).portName); ui->SerialPortsCombo->addItem(ports.at(i).portName);
@ -1320,7 +1321,7 @@ void Oximetry::oximeter_running_check()
oximeter->destroySession(); oximeter->destroySession();
day->getSessions().clear(); day->getSessions().clear();
ui->SerialPortsCombo->setEnabled(true); ui->SerialPortsCombo->setEnabled(true);
qstatus->setText(tr("Ready")); qstatus->setText(STR_TR_Ready);
ui->ImportButton->setEnabled(true); ui->ImportButton->setEnabled(true);
ui->RunButton->setChecked(false); ui->RunButton->setChecked(false);
ui->saveButton->setEnabled(false); ui->saveButton->setEnabled(false);
@ -1378,7 +1379,7 @@ void Oximetry::import_finished()
// Hanging here.. :( // Hanging here.. :(
ui->SerialPortsCombo->setEnabled(true); ui->SerialPortsCombo->setEnabled(true);
qstatus->setText(tr("Ready")); qstatus->setText(STR_TR_Ready);
ui->ImportButton->setDisabled(false); ui->ImportButton->setDisabled(false);
ui->saveButton->setEnabled(true); ui->saveButton->setEnabled(true);