diff --git a/Resources.qrc b/Resources.qrc index 40c604cf..fe8854fe 100644 --- a/Resources.qrc +++ b/Resources.qrc @@ -12,5 +12,6 @@ icons/back.png fonts/FreeSans.ttf icons/refresh.png + docs/usage.html diff --git a/SleepLib/machine.cpp b/SleepLib/machine.cpp index 9741f7f1..98057d41 100644 --- a/SleepLib/machine.cpp +++ b/SleepLib/machine.cpp @@ -45,14 +45,14 @@ ChannelID OXI_Pulse, OXI_SPO2, OXI_Plethysomogram, OXI_PulseChange, OXI_SPO2Drop ChannelID ZEO_SleepStage, ZEO_Waveform; ChannelID JOURNAL_Notes, JOURNAL_Weight; -ChannelID ChannelGroup::Get(ChannelType ctype,QString description,QString label,QString lookup) +ChannelID ChannelGroup::Get(ChannelType ctype,QString description,QString label,QString lookup,QColor color) { ChannelID id=m_first+m_pos; if (++m_pos>=m_size) { qCritical("Not enough slots allocated for channel group"); abort(); } - channel[id]=Channel(id,m_type,ctype,description,label); + channel[id]=Channel(id,m_type,ctype,description,label,color); m_channelsbytype[ctype][id]=channel_lookup[lookup]=m_channel[id]=&channel[id]; return id; diff --git a/SleepLib/machine.h b/SleepLib/machine.h index 404b2d02..ee3c3752 100644 --- a/SleepLib/machine.h +++ b/SleepLib/machine.h @@ -82,9 +82,6 @@ protected: bool firstsession; }; - - - class CPAP:public Machine { public: diff --git a/SleepLib/machine_common.h b/SleepLib/machine_common.h index af3a10ca..13877ecb 100644 --- a/SleepLib/machine_common.h +++ b/SleepLib/machine_common.h @@ -8,6 +8,7 @@ #define MACHINE_COMMON_H #include +#include #include #include #include @@ -41,14 +42,15 @@ protected: ChannelType m_ctype; QString m_details; QString m_label; + QColor m_color; QVector m_option; EventDataType m_min_value; EventDataType m_max_value; public: Channel() - :m_id(0),m_mtype(MT_UNKNOWN), m_ctype(CT_Unknown), m_details(""), m_label("") {} - Channel(ChannelID id, MachineType mtype, ChannelType ctype, QString details, QString label) - :m_id(id),m_mtype(mtype),m_ctype(ctype),m_details(details),m_label(label) {} + :m_id(0),m_mtype(MT_UNKNOWN), m_ctype(CT_Unknown), m_details(""), m_label(""),m_color(Qt::black) {} + Channel(ChannelID id, MachineType mtype, ChannelType ctype, QString details, QString label, QColor color) + :m_id(id),m_mtype(mtype),m_ctype(ctype),m_details(details),m_label(label),m_color(color) {} ChannelID & id() { return m_id; } MachineType & machinetype() { return m_mtype; } ChannelType & channeltype() { return m_ctype; } @@ -92,7 +94,7 @@ public: Channel & operator [](QString lookup) { return *m_channel_lookup[lookup]; } QHash & operator [](ChannelType type) { return m_channelsbytype[type]; } - ChannelID Get(ChannelType ctype,QString description="",QString label="",QString lookup=""); + ChannelID Get(ChannelType ctype,QString description="",QString label="",QString lookup="",QColor color=Qt::black); ChannelGroup(); ChannelGroup(MachineType type, ChannelID first, ChannelID reserved=0x200); }; diff --git a/SleepyHeadQT.pro b/SleepyHeadQT.pro index 19bfd425..fb7bfc1e 100644 --- a/SleepyHeadQT.pro +++ b/SleepyHeadQT.pro @@ -122,4 +122,5 @@ RESOURCES += \ Resources.qrc OTHER_FILES += \ - docs/index.html + docs/index.html \ + docs/usage.html diff --git a/daily.cpp b/daily.cpp index 5619c3a1..f70db590 100644 --- a/daily.cpp +++ b/daily.cpp @@ -699,8 +699,8 @@ void Daily::Load(QDate date) ""; } - html+="\n"+tr("Event Breakdown")+"\n"; - if (1) { // AHI Pie Chart + if (pref["EnableGraphSnapshots"].toBool()) { // AHI Pie Chart + html+="\n"+tr("Event Breakdown")+"\n"; G_AHI->setFixedSize(gwwidth,120); QPixmap pixmap=G_AHI->renderPixmap(gwwidth,120,false); //gwwidth,gwheight,false); QByteArray byteArray; @@ -795,7 +795,8 @@ void Daily::Load(QDate date) if (cpap) { if (mode==MODE_BIPAP) { - { + if (pref["EnableGraphSnapshots"].toBool()) { + { html+=("")+tr("Time@EPAP")+("\n"); TAP_EAP->setFixedSize(gwwidth,30); QPixmap pixmap=TAP_EAP->renderPixmap(gwwidth,30,false); @@ -804,8 +805,8 @@ void Daily::Load(QDate date) buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); html+="\n"; - } - { + } + { html+=("")+tr("Time@IPAP")+("\n"); TAP_IAP->setFixedSize(gwwidth,30); QPixmap pixmap=TAP_IAP->renderPixmap(gwwidth,30,false); @@ -814,10 +815,11 @@ void Daily::Load(QDate date) buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); html+="\n"; + } } } else if (mode==MODE_APAP) { + if (pref["EnableGraphSnapshots"].toBool()) { html+=("")+tr("Time@Pressure")+("\n"); - TAP->setFixedSize(gwwidth,30); QPixmap pixmap=TAP->renderPixmap(gwwidth,30,false); QByteArray byteArray; @@ -825,6 +827,7 @@ void Daily::Load(QDate date) buffer.open(QIODevice::WriteOnly); pixmap.save(&buffer, "PNG"); html+="\n"; + } } html+="
"; html+=""; diff --git a/daily.h b/daily.h index cf12f265..bfc4b72a 100644 --- a/daily.h +++ b/daily.h @@ -1,8 +1,8 @@ -/******************************************************************** +/* Daily GUI Headers Copyright (c)2011 Mark Watkins License: GPL -*********************************************************************/ +*/ #ifndef DAILY_H #define DAILY_H @@ -100,7 +100,7 @@ private: Ui::Daily *ui; Profile *profile; QDate previous_date; - MyScrollArea *scrollArea; + QScrollArea *scrollArea; QVBoxLayout *splitter; QLabel *NoData; QWidget *spacer; diff --git a/docs/index.html b/docs/index.html index c9025c9c..4f89b309 100644 --- a/docs/index.html +++ b/docs/index.html @@ -15,7 +15,8 @@ p,a,td,body { font-size: 14px }
  • Philips Respironics System One (Including ASV models)
  • ResMed S9 models (AutoSet and lower)
  • Contec CMS50 Oximeters
  • -

    This is a developer preview, features are missing and bugs will be plentyful. +

    A few usage notes and basic instructions

    +

    This is a developer preview, features are missing and bugs will be plentyful.

    Project Website: http://sleepyhead.sourceforge.net
    About Sleep Apnea: http://en.wikipedia.org/wiki/Sleep_apnea
    CPAPTalk Forum: http://www.cpaptalk.com

    diff --git a/docs/usage.html b/docs/usage.html new file mode 100644 index 00000000..e2aefe3d --- /dev/null +++ b/docs/usage.html @@ -0,0 +1,19 @@ + + + + + +
    Usage Notes
    +

    To import your PRS1 or S9 CPAP data, select either the root or drive letter of the SD card, or any folder containing a copy of it. +On the PRS1 this folder should either contain or be the P-Series folder.. For the S9, the folder you select must contain the DATALOG folder, and Journal.dat, etc..

    +

    ResMed S9 Users Please Note: It's a good idea to keep a running backup of your DATALOG folder as your machine automatically deletes Flow waveform data past 7 days, and other waveforms after 30 days.

    +

    CMS50 users: To import data recorded by the SpO2Review software, look for the "Application Data" folder in your Home directory, point at the folder containing the Spo2.ini, Spo2Review.ini and Data folder. +Serial importing is still a work in progress and may or may not behave how you would expect.

    + +
    +

    Do NOT rely on this softwares accuracy when making medical decisions. Talk to your doctor.

    + + diff --git a/mainwindow.cpp b/mainwindow.cpp index 92fb45bc..d50b0a4f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -97,6 +97,10 @@ MainWindow::MainWindow(QWidget *parent) : if (!pref.Exists("NoonDateSplit")) pref["NoonDateSplit"]=false; ui->action_Noon_Date_Split->setChecked(pref["NoonDateSplit"].toBool()); + if (!pref.Exists("EnableGraphSnapshots")) pref["EnableGraphSnapshots"]=false; + ui->actionDisplay_Graph_Snapshots->setChecked(pref["EnableGraphSnapshots"].toBool()); + + if (!pref.Exists("MemoryHog")) pref["MemoryHog"]=true; ui->action_Memory_Hog->setChecked(pref["MemoryHog"].toBool()); @@ -360,3 +364,10 @@ void MainWindow::on_action_Preferences_triggered() qDebug() << "Preferences Accepted"; } } + +void MainWindow::on_actionDisplay_Graph_Snapshots_toggled(bool checked) +{ + //if (QMessageBox::question(this,"Warning","Turning this feature on has caused crashes on some hardware configurations due to OpenGL/Qt bugs.\nIf you have already seen Pie Charts & CandleSticks in the left panel of daily view previously, you're not affected by this bug.\nAre you sure you want to enable this?",QMessageBox::Yes|QMessageBox::No)==QMessageBox::Yes) { + pref["EnableGraphSnapshots"]=checked; + //} +} diff --git a/mainwindow.h b/mainwindow.h index 35d1de30..4754c513 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -1,8 +1,8 @@ -/******************************************************************** +/* MainWindow Headers Copyright (c)2011 Mark Watkins License: GPL -*********************************************************************/ +*/ #ifndef MAINWINDOW_H #define MAINWINDOW_H @@ -82,6 +82,8 @@ private slots: void on_action_Preferences_triggered(); + void on_actionDisplay_Graph_Snapshots_toggled(bool arg1); + private: Ui::MainWindow *ui; Daily * daily; diff --git a/mainwindow.ui b/mainwindow.ui index a3b1a4cd..87b9ad02 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -592,6 +592,7 @@ + @@ -733,6 +734,18 @@ &Reset Graph Layout + + + true + + + Display Crashy Snapshots + + + Warning: Enabling this feature may require you to either hand edit the Preferences.xml or delete SleepyHeads data folder. + + + diff --git a/overview.h b/overview.h index dda46b56..4ad63e25 100644 --- a/overview.h +++ b/overview.h @@ -1,8 +1,8 @@ -/******************************************************************** +/* Overview GUI Headers Copyright (c)2011 Mark Watkins License: GPL -*********************************************************************/ +*/ #ifndef OVERVIEW_H #define OVERVIEW_H diff --git a/oximetry.h b/oximetry.h index adce8272..342cca6e 100644 --- a/oximetry.h +++ b/oximetry.h @@ -1,3 +1,9 @@ +/* + Oximetry GUI Headers + Copyright (c)2011 Mark Watkins + License: GPL +*/ + #ifndef OXIMETRY_H #define OXIMETRY_H diff --git a/preferencesdialog.cpp b/preferencesdialog.cpp index 4dd17dcd..bc506748 100644 --- a/preferencesdialog.cpp +++ b/preferencesdialog.cpp @@ -10,7 +10,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : { ui->setupUi(this); ui->eventTable->setColumnWidth(0,40); - ui->eventTable->setColumnWidth(1,50); + ui->eventTable->setColumnWidth(1,55); int row=0; QTableWidgetItem *item; QHash::iterator ci; @@ -20,11 +20,12 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) : item=new QTableWidgetItem(ci.value().details()); ui->eventTable->setItem(row,2,item); QCheckBox *c=new QCheckBox(ui->eventTable); + c->setChecked(true); QLabel *pb=new QLabel(ui->eventTable); pb->setText("foo"); ui->eventTable->setCellWidget(row,0,c); ui->eventTable->setCellWidget(row,1,pb); - QColor a(random() % 255, random() %255, random()%255, 255); + QColor a(random() % 255, random() % 255, random() % 255, 255); QPalette p(a,a,a,a,a,a,a); pb->setPalette(p); diff --git a/preferencesdialog.h b/preferencesdialog.h index fdffe5f1..f2d7d9c6 100644 --- a/preferencesdialog.h +++ b/preferencesdialog.h @@ -1,3 +1,9 @@ +/* + SleepyHead Preferences Dialog GUI Headers + Copyright (c)2011 Mark Watkins + License: GPL +*/ + #ifndef PREFERENCESDIALOG_H #define PREFERENCESDIALOG_H
    SessionIDDateStartEnd