From b16231a599016756b3015d8e9257247856c648ca Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 26 Dec 2011 13:06:39 +1000 Subject: [PATCH] SPO2 stat decimal rounding, use compliance hours threshold in best/worst ahi stats --- daily.cpp | 6 +++--- docs/index.html | 32 ++++++++++++++++++++------------ docs/release_notes.html | 2 +- mainwindow.cpp | 39 ++++++++++++++++++++++++++++----------- mainwindow.h | 2 ++ mainwindow.ui | 2 +- 6 files changed, 55 insertions(+), 28 deletions(-) diff --git a/daily.cpp b/daily.cpp index 3c4874b1..d2ea0a0b 100644 --- a/daily.cpp +++ b/daily.cpp @@ -881,9 +881,9 @@ void Daily::Load(QDate date) html+="
"; html+=""+oxi->machine->properties[STR_PROP_Brand]+" "+oxi->machine->properties[STR_PROP_Model]+"\n"; html+=" "; - html+=QString("%1: %2 (%3)\%").arg(tr("SpO2 Desaturations")).arg(oxi->count(OXI_SPO2Drop)).arg((100.0/oxi->hours()) * (oxi->sum(OXI_SPO2Drop)/3600.0)); - html+=QString("%1: %2 (%3)\%").arg(tr("Pulse Change events")).arg(oxi->count(OXI_PulseChange)).arg((100.0/oxi->hours()) * (oxi->sum(OXI_PulseChange)/3600.0)); - html+=QString("%1: %2\%").arg(tr("SpO2 Baseline Used")).arg(oxi->settings_wavg(OXI_SPO2Drop)); + html+=QString("%1: %2 (%3)\%").arg(tr("SpO2 Desaturations")).arg(oxi->count(OXI_SPO2Drop)).arg((100.0/oxi->hours()) * (oxi->sum(OXI_SPO2Drop)/3600.0),0,'f',2); + html+=QString("%1: %2 (%3)\%").arg(tr("Pulse Change events")).arg(oxi->count(OXI_PulseChange)).arg((100.0/oxi->hours()) * (oxi->sum(OXI_PulseChange)/3600.0),0,'f',2); + html+=QString("%1: %2\%").arg(tr("SpO2 Baseline Used")).arg(oxi->settings_wavg(OXI_SPO2Drop),0,'f',2); } if (cpap) { diff --git a/docs/index.html b/docs/index.html index 17958ca3..e3bc58d5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,23 +12,31 @@ a:hover { background-color: inherit; color: red; text-decoration:none; font-weig Welcome to SleepyHead -

This software is currently being designed to assist you in reviewing data for your CPAP Machine, Oximeter, and Sleep Stage monitors, as well as help you track general issues related to sleep health.

-

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

-

Currenly supports the following machines:

+

About SleepyHead

+

This software has been created to assist you in reviewing the data produced by your CPAP Machine or Oximeter, and help you track your progress in your fight against Sleep Disorders.

+

SleepyHead has been designed by a software developer with personal experience with sleep disorders, and shaped by the feedback and testing of many others dealing with similar conditions.

+

Please Note:This is a beta release, some features may not yet behave as expected.
Please report any bugs you find to SleepyHead's SourceForge page.

+

Currenly supported machines:

CPAP -
  • Philips Respironics System One
  • -
  • ResMed S9 models
  • -
  • DeVilbiss Intellipap models (*new)
  • +
  • Philips Respironics System One (CPAP, Auto, BiPAP & ASV models)
  • +
  • ResMed S9 models (CPAP, Auto, VPAP)
  • +
  • DeVilbiss Intellipap (Auto)
  • Oximetry -
  • Contec CMS50 Oximeters (*improved)
  • -

    I don't recommend using this built in "web browser" to do any major surfing in, it will work, but it's mainly meant as a help browser. -(It doesn't support SSL encryption.)

    - +
  • Contec CMS50 Oximeters
  • +

    Online Help Resources

    +SleepyHead's Online Users Guide
    +Frequently Asked Questions
    +Glossary of Sleep Disorder Terms
    +SleepyHead Wiki

    +SleepyHead's Project Website on SourceForge


    +
    +

    Got a neat idea on how to improve SleepyHead? Check out SleepyHeads Idea Torrent

    +

    Further Information

    +

    Note:I don't recommend using this built in "web browser" to do any major surfing in, it will work, but it's mainly meant as a help browser. +(It doesn't support SSL encryption, so it's not a good idea to type your passwords or personal details anywhere.)

    -Here is the SleepyHead Wiki
    Here are the release notes for this version.
    Plus a few usage notes, and some important information for Mac users.
    -SleepyHead's Project Website on SourceForge

    About Sleep Apnea on Wikipedia

    Friendly forums to talk and learn about Sleep Apnea:
    CPAPTalk Forum, diff --git a/docs/release_notes.html b/docs/release_notes.html index 7b695454..10873764 100644 --- a/docs/release_notes.html +++ b/docs/release_notes.html @@ -43,7 +43,7 @@ SourceForge is still the best place to report bugs, and this is especially impor Thanks to all of you for the wonderful support you've given, by testing the software, reporting bugs, sharing your data, giving kind words of encouragement, monetary donations, and all the cool suggestions on how to make this project even better.

    Special thanks to James M. (BreatheJimbo), who has been a huge help in getting things solid, espescially for Apple Mac users.

    I'm very glad I've had the opportunity to share this project with you all.

    -

    Sleep Well, and have fun! Please be safe over these year end holidays.

    +

    Sleep Well, and have fun!

    Mark Watkins (JediMark)

    diff --git a/mainwindow.cpp b/mainwindow.cpp index 8457185d..2ed932de 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -144,6 +145,7 @@ MainWindow::MainWindow(QWidget *parent) : daily->graphView()->redraw(); ui->recordsBox->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); + ui->webView->page()->setLinkDelegationPolicy(QWebPage::DelegateExternalLinks); ui->toolBox->setStyleSheet( "QToolBox::tab {" "background: #6789ab;" @@ -748,18 +750,21 @@ void MainWindow::on_summaryButton_clicked() lastchanged=false; if (day) { - EventDataType ahi=day->count(CPAP_Obstructive)+day->count(CPAP_Hypopnea)+day->count(CPAP_Apnea)+day->count(CPAP_ClearAirway); - if (PROFILE.general->calculateRDI()) ahi+=day->count(CPAP_RERA); - ahi/=day->hours(); - if (ahi > worstAHI) { - worstAHI=ahi; - worstAHIdate=date; - } - if (ahi < bestAHI) { - bestAHI=ahi; - bestAHIdate=date; - } + EventDataType hours=day->hours(); + if (hours>PROFILE.cpap->complianceHours()) { + EventDataType ahi=day->count(CPAP_Obstructive)+day->count(CPAP_Hypopnea)+day->count(CPAP_Apnea)+day->count(CPAP_ClearAirway); + if (PROFILE.general->calculateRDI()) ahi+=day->count(CPAP_RERA); + ahi/=day->hours(); + if (ahi > worstAHI) { + worstAHI=ahi; + worstAHIdate=date; + } + if (ahi < bestAHI) { + bestAHI=ahi; + bestAHIdate=date; + } + } mode=(CPAPMode)round(day->settings_wavg(CPAP_Mode)); min=day->settings_min(CPAP_PressureMin); if (mode==MODE_CPAP) { @@ -2025,3 +2030,15 @@ void MainWindow::on_actionView_S_ummary_triggered() { ui->tabWidget->setCurrentWidget(ui->summaryTab); } + +void MainWindow::on_webView_linkClicked(const QUrl &url) +{ + QString s=url.toString(); + qDebug() << "Link Clicked" << url; + if (s.toLower().startsWith("https:")) { + QDesktopServices().openUrl(url); + + } else { + ui->webView->setUrl(url); + } +} diff --git a/mainwindow.h b/mainwindow.h index 97fdde4c..b47668fb 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -251,6 +251,8 @@ private slots: void on_actionView_S_ummary_triggered(); + void on_webView_linkClicked(const QUrl &arg1); + private: Ui::MainWindow *ui; diff --git a/mainwindow.ui b/mainwindow.ui index 619fa341..56d1003b 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -78,7 +78,7 @@ QTabWidget::North - 0 + 1 false