From 48777787b1fc276252b77a3985ca1f90d4f8638f Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Thu, 29 Dec 2011 06:07:33 +1000 Subject: [PATCH] Removed AHI/hr from averages list, changed Daily Details percentiles to variable calculation, Stop Unintentional leaks being calculated in APAP mode for PRS1, as they are inaccurate without mask formulae --- SleepLib/calcs.cpp | 2 ++ daily.cpp | 9 +++++---- docs/release_notes.html | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SleepLib/calcs.cpp b/SleepLib/calcs.cpp index 3ff33442..2261c82b 100644 --- a/SleepLib/calcs.cpp +++ b/SleepLib/calcs.cpp @@ -455,6 +455,8 @@ int calcLeaks(Session *session) if (session->eventlist.contains(CPAP_Leak)) return 0; // abort if already there if (!session->eventlist.contains(CPAP_LeakTotal)) return 0; // can't calculate without this.. + if (session->settings[CPAP_Mode].toInt()>MODE_APAP) return 0; // Don't bother calculating when in APAP mode + const qint64 winsize=3600000; // 5 minute window //qint64 first=session->first(), last=session->last(), f; diff --git a/daily.cpp b/daily.cpp index bb97b48a..28cdd0a5 100644 --- a/daily.cpp +++ b/daily.cpp @@ -861,6 +861,7 @@ void Daily::Load(QDate date) } // if (!CPAP) html+="\n"; + float percentile=0.95; if ((cpap && !isBrick) || oxi) { html+="\n"; @@ -870,11 +871,11 @@ void Daily::Load(QDate date) .arg(tr("Channel")) .arg(tr("Min")) .arg(tr("Avg")) - .arg(tr("90%")) + .arg(tr("%i%").arg(percentile*100,0,'f',0)) .arg(tr("Max")); ChannelID chans[]={ CPAP_Pressure,CPAP_EPAP,CPAP_IPAP,CPAP_PS,CPAP_PTB, - CPAP_MinuteVent,CPAP_AHI, CPAP_RespRate, CPAP_RespEvent,CPAP_FLG, + CPAP_MinuteVent, CPAP_RespRate, CPAP_RespEvent,CPAP_FLG, CPAP_Leak, CPAP_LeakTotal, CPAP_Snore,CPAP_IE,CPAP_Ti,CPAP_Te, CPAP_TgMV, CPAP_TidalVolume, OXI_Pulse, OXI_SPO2 }; @@ -892,7 +893,7 @@ void Daily::Load(QDate date) .arg(QString::number(code)).arg(tooltip).arg(schema::channel[code].label())) .arg(cpap->Min(code),0,'f',2) .arg(cpap->wavg(code),0,'f',2) - .arg(cpap->p90(code),0,'f',2) + .arg(cpap->percentile(code,percentile),0,'f',2) .arg(cpap->Max(code),0,'f',2); } if (oxi && oxi->channelHasData(code)) { @@ -901,7 +902,7 @@ void Daily::Load(QDate date) html+=""; } diff --git a/docs/release_notes.html b/docs/release_notes.html index 3e983822..2d8b7948 100644 --- a/docs/release_notes.html +++ b/docs/release_notes.html @@ -12,6 +12,7 @@
  • Auto-Updater for Windows & Mac Platforms
  • SleepLib database improvements, and lots of other underneath stuff and code cleanups you don't see.
  • +
  • Session Hiding capabilities, by clicking on the toggle button down the bottom of Daily views details panel
  • New Statistics page showing some more useful data.
  • Welcome page has become a Help Browser.
  • New Navigation Panel on the right side, now accessible from all tabs. It can be hidden to reclaim screen space.
  •  
    "+schema::channel[code].label()+""; html+=""+a.sprintf("%.2f",oxi->Min(code)); html+=""+a.sprintf("%.2f",oxi->wavg(code)); - html+=""+a.sprintf("%.2f",oxi->p90(code)); + html+=""+a.sprintf("%.2f",oxi->percentile(code,percentile)); html+=""+a.sprintf("%.2f",oxi->Max(code)); html+="