From d422a46802ecf9cf20b09f9773630be77fb1f5b6 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Thu, 28 Jul 2011 01:28:46 +1000 Subject: [PATCH] Database Changes.. hopefully the last one for quite a while --- Graphs/gFlagsLine.cpp | 12 +-- Graphs/gFlagsLine.h | 12 +-- Graphs/gLineOverlay.cpp | 16 ++-- Graphs/gLineOverlay.h | 8 +- Graphs/glcommon.cpp | 9 +- Graphs/graphlayer.h | 4 +- SleepLib/machine.cpp | 110 +-------------------- SleepLib/machine_common.h | 11 ++- SleepLib/session.cpp | 197 ++++++++++++-------------------------- daily.cpp | 6 +- 10 files changed, 105 insertions(+), 280 deletions(-) diff --git a/Graphs/gFlagsLine.cpp b/Graphs/gFlagsLine.cpp index b62a6b56..dab1f448 100644 --- a/Graphs/gFlagsLine.cpp +++ b/Graphs/gFlagsLine.cpp @@ -67,8 +67,8 @@ void gFlagsGroup::Plot(gGraphWindow &w, float scrx, float scry) } -gFlagsLine::gFlagsLine(MachineCode code,QColor col,QString _label,bool always_visible,FLT_Type flt) -:gLayer(code),label(_label),m_always_visible(always_visible),m_flt(flt) +gFlagsLine::gFlagsLine(MachineCode code,QColor col,QString label,bool always_visible,FlagType flt) +:gLayer(code),m_label(label),m_always_visible(always_visible),m_flt(flt) { color.clear(); color.push_back(col); @@ -136,8 +136,8 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry) // Draw text label float x,y; - GetTextExtent(label,x,y); - DrawText(w,label,start_px-x-10,(scry-line_top)-(line_h/2)+(y/2)); + GetTextExtent(m_label,x,y); + DrawText(w,m_label,start_px-x-10,(scry-line_top)-(line_h/2)+(y/2)); float x1,x2; QColor & col=color[0]; @@ -157,12 +157,12 @@ void gFlagsLine::Plot(gGraphWindow & w,float scrx,float scry) if (Y < minx) continue; if (X > maxx) break; x1=(X - minx) * xmult + w.GetLeftMargin(); - if (m_flt==FLT_Bar) { + if (m_flt==FT_Bar) { vertarray[vertcnt++]=x1; vertarray[vertcnt++]=top; vertarray[vertcnt++]=x1; vertarray[vertcnt++]=bottom; - } else if (m_flt==FLT_Span) { + } else if (m_flt==FT_Span) { x2=(Y-minx)*xmult+w.GetLeftMargin(); //w1=x2-x1; quadarray[quadcnt++]=x1; diff --git a/Graphs/gFlagsLine.h b/Graphs/gFlagsLine.h index 2909ca33..b8ded744 100644 --- a/Graphs/gFlagsLine.h +++ b/Graphs/gFlagsLine.h @@ -11,27 +11,25 @@ class gFlagsGroup; -enum FLT_Type { FLT_Bar, FLT_Span, FLT_Dot }; - class gFlagsLine:public gLayer { friend class gFlagsGroup; public: - gFlagsLine(MachineCode code,QColor col=Qt::black,QString _label="",bool always_visible=false,FLT_Type flt=FLT_Bar); + gFlagsLine(MachineCode code,QColor col=Qt::black,QString label="",bool always_visible=false,FlagType flt=FT_Bar); virtual ~gFlagsLine(); virtual void Plot(gGraphWindow & w,float scrx,float scry); bool isAlwaysVisible() { return m_always_visible; } void setAlwaysVisible(bool b) { m_always_visible=b; } - QString Label() { return label; } - void Label(QString s) { label=s; } + QString label() { return m_label; } + void setLabel(QString s) { m_label=s; } void setTotalLines(int i) { total_lines=i; } void setLineNum(int i) { line_num=i; } protected: - QString label; + QString m_label; bool m_always_visible; int total_lines,line_num; - FLT_Type m_flt; + FlagType m_flt; }; class gFlagsGroup:public gLayerGroup diff --git a/Graphs/gLineOverlay.cpp b/Graphs/gLineOverlay.cpp index 1d7a3894..5d4a4feb 100644 --- a/Graphs/gLineOverlay.cpp +++ b/Graphs/gLineOverlay.cpp @@ -8,8 +8,8 @@ #include "SleepLib/profiles.h" #include "gLineOverlay.h" -gLineOverlayBar::gLineOverlayBar(MachineCode code,QColor col,QString _label,LO_Type _lot) -:gLayer(code),label(_label),lo_type(_lot) +gLineOverlayBar::gLineOverlayBar(MachineCode code,QColor col,QString label,FlagType flt) +:gLayer(code),m_label(label),m_flt(flt) { color.clear(); color.push_back(col); @@ -63,7 +63,7 @@ void gLineOverlayBar::Plot(gGraphWindow & w,float scrx,float scry) // bool done=false; for (int i=0;i MachLastCode; +//map MachLastCode; -/* ChannelCode RegisterChannel(MachineType type) -{ - if (MachLastCode.find(type)==MachLastCode.end()) { - return MachLastCode[type]=0; - } - return ++(MachLastCode[type]); -}; - -const int CPAP_WHATEVER=RegisterChannel(MT_CPAP); */ -//map MachList; - -/*map MachineTypeString= { - {MT_UNKNOWN, wxT("Unknown")}, - {MT_CPAP, wxT("CPAP")}, - {MT_OXIMETER, wxT("Oximeter")}, - {MT_SLEEPSTAGE, wxT("SleepStage")} -}; */ - -/*map MachineTypeLookup= { - { MachineTypeString[MT_UNKNOWN].Lower(), MT_UNKNOWN }, - { MachineTypeString[MT_CPAP].Lower(), MT_CPAP }, - { MachineTypeString[MT_OXIMETER].Lower(), MT_OXIMETER }, - { MachineTypeString[MT_SLEEPSTAGE].Lower(), MT_SLEEPSTAGE} -}; */ map CPAPModeNames; -/*={ - {MODE_UNKNOWN,wxT("Undetermined")}, - {MODE_CPAP,wxT("CPAP")}, - {MODE_APAP,wxT("APAP")}, - {MODE_BIPAP,wxT("BIPAP")}, - {MODE_ASV,wxT("ASV")} -};*/ + map PressureReliefNames; -/*={ - {PR_UNKNOWN,_("Undetermined")}, - {PR_NONE,_("None")}, - {PR_CFLEX,wxT("C-Flex")}, - {PR_CFLEXPLUS,wxT("C-Flex+")}, - {PR_AFLEX,wxT("A-Flex")}, - {PR_BIFLEX,wxT("Bi-Flex")}, - {PR_EPR,wxT("Exhalation Pressure Relief (EPR)")}, - {PR_SMARTFLEX,wxT("SmartFlex")} -}; */ - - // Master list. Look up local name table first.. then these if not found. map DefaultMCShortNames; -/*= { - {CPAP_Obstructive, wxT("OA")}, - {CPAP_Hypopnea, wxT("H")}, - {CPAP_RERA, wxT("RE")}, - {CPAP_ClearAirway, wxT("CA")}, - {CPAP_CSR, wxT("CSR")}, - {CPAP_VSnore, wxT("VS")}, - {CPAP_FlowLimit, wxT("FL")}, - {CPAP_Pressure, wxT("P")}, - {CPAP_Leak, wxT("LR")}, - {CPAP_EAP, wxT("EAP")}, - {CPAP_IAP, wxT("IAP")}, - {PRS1_VSnore2, wxT("VS")}, - {PRS1_PressurePulse,wxT("PP")} -}; */ // Master list. Look up local name table first.. then these if not found. map DefaultMCLongNames; -/*= { - {CPAP_Obstructive, wxT("Obstructive Apnea")}, - {CPAP_Hypopnea, wxT("Hypopnea")}, - {CPAP_RERA, wxT("Respiratory Effort / Arrousal")}, - {CPAP_ClearAirway, wxT("Clear Airway Apnea")}, - {CPAP_CSR, wxT("Cheyne Stokes Respiration")}, - {CPAP_VSnore, wxT("Vibratory Snore")}, - {CPAP_FlowLimit, wxT("Flow Limitation")}, - {CPAP_Pressure, wxT("Pressure")}, - {CPAP_Leak, wxT("Leak Rate")}, - {CPAP_EAP, wxT("BIPAP EPAP")}, - {CPAP_IAP, wxT("BIPAP IPAP")}, - {PRS1_VSnore2, wxT("Vibratory Snore")}, - {PRS1_PressurePulse,wxT("Pressue Pulse")} -}; */ void InitMapsWithoutAwesomeInitializerLists() { @@ -119,6 +47,7 @@ void InitMapsWithoutAwesomeInitializerLists() PressureReliefNames[PR_SMARTFLEX]=QObject::tr("SmartFlex"); DefaultMCShortNames[CPAP_Obstructive]=QObject::tr("OA"); + DefaultMCShortNames[CPAP_Apnea]=QObject::tr("A"); DefaultMCShortNames[CPAP_Hypopnea]=QObject::tr("H"); DefaultMCShortNames[CPAP_RERA]=QObject::tr("RE"); DefaultMCShortNames[CPAP_ClearAirway]=QObject::tr("CA"); @@ -134,6 +63,7 @@ void InitMapsWithoutAwesomeInitializerLists() DefaultMCLongNames[CPAP_Obstructive]=QObject::tr("Obstructive Apnea"); DefaultMCLongNames[CPAP_Hypopnea]=QObject::tr("Hypopnea"); + DefaultMCLongNames[CPAP_Apnea]=QObject::tr("Apnea"); DefaultMCLongNames[CPAP_RERA]=QObject::tr("RERA"); DefaultMCLongNames[CPAP_ClearAirway]=QObject::tr("Clear Airway Apnea"); DefaultMCLongNames[CPAP_CSR]=QObject::tr("Periodic Breathing"); @@ -141,6 +71,7 @@ void InitMapsWithoutAwesomeInitializerLists() DefaultMCLongNames[CPAP_FlowLimit]=QObject::tr("Flow Limitation"); DefaultMCLongNames[CPAP_Pressure]=QObject::tr("Pressure"); DefaultMCLongNames[CPAP_Leak]=QObject::tr("Leak Rate"); + DefaultMCLongNames[CPAP_PS]=QObject::tr("Pressure Support"); DefaultMCLongNames[CPAP_EAP]=QObject::tr("BIPAP EPAP"); DefaultMCLongNames[CPAP_IAP]=QObject::tr("BIPAP IPAP"); DefaultMCLongNames[CPAP_Snore]=QObject::tr("Vibratory Snore"); // Graph data @@ -154,35 +85,6 @@ void InitMapsWithoutAwesomeInitializerLists() } - -// This is technically gui related.. however I have something in mind for it. -/*const map DefaultFlagTypes= { - {CPAP_Obstructive, FT_BAR}, - {CPAP_Hypopnea, FT_BAR}, - {CPAP_RERA, FT_BAR}, - {CPAP_VSnore, FT_BAR}, - {PRS1_VSnore2, FT_BAR}, - {CPAP_FlowLimit, FT_BAR}, - {CPAP_ClearAirway, FT_BAR}, - {CPAP_CSR, FT_SPAN}, - {PRS1_PressurePulse,FT_DOT}, - {CPAP_Pressure, FT_DOT} -}; - -const unsigned char flagalpha=0x80; -const map DefaultFlagColours= { - {CPAP_Obstructive, wxColour(0x80,0x80,0xff,flagalpha)}, - {CPAP_Hypopnea, wxColour(0x00,0x00,0xff,flagalpha)}, - {CPAP_RERA, wxColour(0x40,0x80,0xff,flagalpha)}, - {CPAP_VSnore, wxColour(0xff,0x20,0x20,flagalpha)}, - {CPAP_FlowLimit, wxColour(0x20,0x20,0x20,flagalpha)}, - {CPAP_ClearAirway, wxColour(0xff,0x40,0xff,flagalpha)}, - {CPAP_CSR, wxColour(0x40,0xff,0x40,flagalpha)}, - {PRS1_VSnore2, wxColour(0xff,0x20,0x20,flagalpha)}, - {PRS1_PressurePulse,wxColour(0xff,0x40,0xff,flagalpha)} -}; */ - - ////////////////////////////////////////////////////////////////////////////////////////// // Machine Base-Class implmementation ////////////////////////////////////////////////////////////////////////////////////////// @@ -243,7 +145,6 @@ Day *Machine::AddSession(Session *s,Profile *p) QDate date=d2.date(); //QTime time=d2.time(); - // pref["NoonDateSplit"]=true; if (pref.Exists("NoonDataSplit") && pref["NoonDateSplit"].toBool()) { int hour=d2.time().hour(); if (hour<12) @@ -405,7 +306,6 @@ bool Machine::Load() if (sess->LoadSummary(s->second[0])) { sess->SetEventFile(s->second[1]); - sess->SetWaveFile(s->second[2]); AddSession(sess,profile); } else { qWarning() << "Error unpacking summary data"; diff --git a/SleepLib/machine_common.h b/SleepLib/machine_common.h index 6ca591c0..36d4ad1f 100644 --- a/SleepLib/machine_common.h +++ b/SleepLib/machine_common.h @@ -17,6 +17,10 @@ typedef long SessionID; class BoundsError {}; +// This is the uber important database version for SleepyHeads internal storage +// Increment this after stuffing with Session's save & load code. +const quint16 dbversion=4; + const int max_number_event_fields=10; enum MachineType//: short @@ -25,7 +29,8 @@ enum MachineType//: short // Could be implimented by MachineLoader's register function requesting a block of integer space, // and a map to name strings. -typedef int ChannelCode; +//typedef int ChannelCode; + // Be cautious when extending these.. add to the end of each groups to preserve file formats. enum MachineCode//:qint16 @@ -67,13 +72,9 @@ enum MachineCode//:qint16 GEN_Weight=0x3000, GEN_Notes, GEN_Glucose, GEN_Calories, GEN_Energy, GEN_Mood, GEN_Excercise, GEN_Reminder - - }; void InitMapsWithoutAwesomeInitializerLists(); -enum FlagType//:short -{ FT_BAR, FT_DOT, FT_SPAN }; enum CPAPMode//:short { diff --git a/SleepLib/session.cpp b/SleepLib/session.cpp index db9ae698..9653b226 100644 --- a/SleepLib/session.cpp +++ b/SleepLib/session.cpp @@ -9,6 +9,7 @@ #include "math.h" #include #include +#include #include #include #include @@ -52,8 +53,7 @@ void Session::TrashEvents() bool Session::OpenEvents() { if (s_events_loaded) return true; - bool b; - b=LoadEvents(s_eventfile); + bool b=LoadEvents(s_eventfile); if (!b) { qWarning() << "Error Unkpacking Events" << s_eventfile; return false; @@ -75,23 +75,29 @@ bool Session::Store(QString path) base.sprintf("%08lx",s_session); base=path+"/"+base; //qDebug() << "Storing Session: " << base; - bool a; + bool a,b=false; a=StoreSummary(base+".000"); // if actually has events //qDebug() << " Summary done"; - s_eventfile=base+".001"; - if (eventlist.size()>0) StoreEvents(base+".001"); + if (eventlist.size()>0) + b=StoreEvents(base+".001"); //qDebug() << " Events done"; - if (a) { - s_changed=false; - s_events_loaded=true; + s_changed=false; + s_eventfile=base+".001"; + s_events_loaded=true; + //TrashEvents(); - } + //} else { + // qDebug() << "Session::Store() No event data saved" << s_session; + //} return a; } +const quint16 filetype_summary=0; +const quint16 filetype_data=1; const quint32 magic=0xC73216AB; + bool IsPlatformLittleEndian() { quint32 j=1; @@ -107,69 +113,23 @@ bool Session::StoreSummary(QString filename) QDataStream out(&file); out.setVersion(QDataStream::Qt_4_6); + out.setByteOrder(QDataStream::LittleEndian); out << (quint32)magic; + out << (quint16)dbversion; + out << (quint16)filetype_summary; out << (quint32)s_machine->id(); out << (quint32)s_session; - out << (quint16)0 << (quint16)0; - quint32 starttime=s_first/1000L; - quint32 duration=(s_last-s_first)/1000L; - - out << (quint32)starttime; // Session Start Time - out << (quint32)duration; // Duration of sesion in seconds. + out << s_first; // Session Start Time + out << s_last; // Duration of sesion in seconds. out << (quint16)summary.size(); - map mctype; - // First output the Machine Code and type for each summary record - map::iterator i; - for (i=summary.begin(); i!=summary.end(); i++) { + for (map::iterator i=summary.begin(); i!=summary.end(); i++) { MachineCode mc=i->first; - - QMetaType::Type type=(QMetaType::Type)i->second.type(); // Urkk.. this is a mess. - if (type==QMetaType::Bool) { - mctype[mc]=MC_bool; - } else if (type==QMetaType::Int) { - mctype[mc]=MC_int; - } else if (type==QMetaType::LongLong) { - mctype[mc]=MC_long; - } else if (type==QMetaType::Double) { - mctype[mc]=MC_double; - } else if (type==QMetaType::Float) { - mctype[mc]=MC_float; - } else if (type==QMetaType::QString) { - mctype[mc]=MC_string; - } else if (type==QMetaType::QDateTime) { - mctype[mc]=MC_datetime; - } else { - QString t=i->second.typeToName((QVariant::Type)type); - qWarning() << "Error in Session->StoreSummary: Can't pack variant type " << t; - return false; - //exit(1); - } out << (qint16)mc; - out << (qint8)mctype[mc]; - } - // Then dump out the actual data, according to format. - for (i=summary.begin(); i!=summary.end(); i++) { - MachineCode mc=i->first; - if (mctype[mc]==MC_bool) { - out << i->second.toBool(); - } else if (mctype[mc]==MC_int) { - out << (qint32)i->second.toInt(); - } else if (mctype[mc]==MC_long) { - out << (qint64)i->second.toLongLong(); - } else if (mctype[mc]==MC_double) { - out << (double)i->second.toDouble(); - } else if (mctype[mc]==MC_float) { - float f=(float)i->second.toDouble(); // check me. - out << f; - } else if (mctype[mc]==MC_string) { - out << i->second.toString(); - } else if (mctype[mc]==MC_datetime) { - out << i->second.toDateTime(); - } + out << i->second; } file.close(); return true; @@ -177,17 +137,20 @@ bool Session::StoreSummary(QString filename) bool Session::LoadSummary(QString filename) { - if (filename.isEmpty()) return false; - //qDebug() << "Loading Summary " << filename; + if (filename.isEmpty()) { + qDebug() << "Empty summary filename"; + return false; + } QFile file(filename); if (!file.open(QIODevice::ReadOnly)) { - qDebug() << "Couldn't open file" << filename; + qDebug() << "Couldn't open summary file" << filename; return false; } QDataStream in(&file); in.setVersion(QDataStream::Qt_4_6); + in.setByteOrder(QDataStream::LittleEndian); quint64 t64; quint32 t32; @@ -203,67 +166,34 @@ bool Session::LoadSummary(QString filename) return false; } - in >> t32; // MachineID (dont need this result) - - in >> t32; // Sessionid; - s_session=t32; + in >> t16; // DB Version + if (t16!=dbversion) { + qWarning() << "Old dbversion "<< t16 << "summary file.. Sorry, you need to purge and reimport"; + return false; + } in >> t16; // File Type - if (t16!=0) { + if (t16!=filetype_summary) { qDebug() << "Wrong file type"; //wrong file type return false; } - in >> t16; // File Version - // dont care yet - in >> t32; // Start time - s_first=qint64(t32)*1000L; + in >> t32; // MachineID (dont need this result) + in >> t32; // Sessionid; + s_session=t32; - in >> t32; // Duration // (16bit==Limited to 18 hours) - s_last=s_first+qint64(t32)*1000L; + in >> s_first; // Start time + in >> s_last; // Duration // (16bit==Limited to 18 hours) in >> sumsize; // Summary size (number of Machine Code lists) for (int i=0; i> t16; // Machine Code MachineCode mc=(MachineCode)t16; - in >> t8; // Data Type - mctype[mc]=(MCDataType)t8; - mcorder.push_back(mc); + in >> summary[mc]; } - for (int i=0; i> b; - summary[mc]=b; - } else if (mctype[mc]==MC_int) { - in >> t32; - summary[mc]=(qint32)t32; - } else if (mctype[mc]==MC_long) { - in >> t64; - summary[mc]=(qint64)t64; - } else if (mctype[mc]==MC_double) { - double dl; - in >> dl; - summary[mc]=(double)dl; - } else if (mctype[mc]==MC_float) { - float fl; - in >> fl; - summary[mc]=(float)fl; - } else if (mctype[mc]==MC_string) { - QString s; - in >> s; - summary[mc]=s; - } else if (mctype[mc]==MC_datetime) { - QDateTime dt; - in >> dt; - summary[mc]=dt; - } - - } return true; } @@ -274,12 +204,13 @@ bool Session::StoreEvents(QString filename) QDataStream out(&file); out.setVersion(QDataStream::Qt_4_6); + out.setByteOrder(QDataStream::LittleEndian); - out << (quint32)magic; // Magic Number - out << (quint32)s_machine->id(); // Machine ID - out << (quint32)s_session; // This session's ID - out << (quint16)1; // File type 1 == Event - out << (quint16)0; // File Version + out << (quint32)magic; // Magic Number + out << (quint16)dbversion; // File Version + out << (quint16)filetype_data; // File type 1 == Event + out << (quint32)s_machine->id();// Machine ID + out << (quint32)s_session; // This session's ID out << s_first; out << s_last; @@ -302,13 +233,8 @@ bool Session::StoreEvents(QString filename) out << e.rate(); out << e.gain(); out << e.offset(); - //if (!e.update_minmax()) { - out << e.min(); - out << e.max(); - //} else { - // out << (EventDataType)0; - // out << (EventDataType)0; - //} + out << e.min(); + out << e.max(); } } qint64 t,last; @@ -316,6 +242,7 @@ bool Session::StoreEvents(QString filename) for (i=eventlist.begin(); i!=eventlist.end(); i++) { for (unsigned j=0;jsecond.size();j++) { EventList &e=*i->second[j]; + for (int c=0;c> t32; // MachineID - - in >> t32; // Sessionid; - s_session=t32; + in >> t16; // File Version + if (t16!=dbversion) { + qWarning() << "Old dbversion "<< t16 << "summary file.. Sorry, you need to purge and reimport"; + return false; + } in >> t16; // File Type - if (t16!=1) { + if (t16!=filetype_data) { qDebug() << "Wrong File Type in " << filename; return false; } - in >> t16; // File Version - // dont give a crap yet.. + in >> t32; // MachineID + in >> t32; // Sessionid; + s_session=t32; in >> s_first; in >> s_last; @@ -392,9 +324,7 @@ bool Session::LoadEvents(QString filename) sizevec.push_back(size2); for (int j=0;j> ts1; - //UpdateFirst(ts1); in >> ts2; - //UpdateLast(ts2); in >> evcount; in >> t8; elt=(EventListType)t8; @@ -412,7 +342,6 @@ bool Session::LoadEvents(QString filename) } } - EventStoreType t; qint64 last; quint32 x; diff --git a/daily.cpp b/daily.cpp index 1737d85b..39204e7a 100644 --- a/daily.cpp +++ b/daily.cpp @@ -78,7 +78,7 @@ Daily::Daily(QWidget *parent,QGLWidget * shared) : SF->setMinimumHeight(160); fg=new gFlagsGroup(); - fg->AddLayer(new gFlagsLine(CPAP_CSR,QColor("light green"),"CSR",false,FLT_Span)); + fg->AddLayer(new gFlagsLine(CPAP_CSR,QColor("light green"),"CSR",false,FT_Span)); fg->AddLayer(new gFlagsLine(CPAP_ClearAirway,QColor("purple"),"CA",true)); fg->AddLayer(new gFlagsLine(CPAP_Obstructive,QColor("#40c0ff"),"OA",true)); fg->AddLayer(new gFlagsLine(CPAP_Hypopnea,QColor("blue"),"H",true)); @@ -122,13 +122,13 @@ Daily::Daily(QWidget *parent,QGLWidget * shared) : //FRW->AddLayer(new gFooBar()); FRW->AddLayer(new gYAxis()); FRW->AddLayer(new gXAxis()); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR,QColor("light green"),"CSR",LOT_Span))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_CSR,QColor("light green"),"CSR",FT_Span))); g=new gLineChart(CPAP_FlowRate,Qt::black,false); g->ReportEmpty(true); AddCPAP(g); FRW->AddLayer(g); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Hypopnea,QColor("blue"),"H"))); - FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_PressurePulse,QColor("red"),"PR",LOT_Dot))); + FRW->AddLayer(AddCPAP(new gLineOverlayBar(PRS1_PressurePulse,QColor("red"),"PR",FT_Dot))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_RERA,QColor("gold"),"RE"))); //FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_Unknown0E,QColor("dark green"),"U0E"))); FRW->AddLayer(AddCPAP(new gLineOverlayBar(CPAP_VSnore,QColor("red"),"VS")));