diff --git a/Graphs/gSummaryChart.cpp b/Graphs/gSummaryChart.cpp index a13ad633..283ec0bf 100644 --- a/Graphs/gSummaryChart.cpp +++ b/Graphs/gSummaryChart.cpp @@ -175,6 +175,10 @@ void SummaryChart::SetDay(Day * nullday) type=m_type[j]; } } + + if (code==CPAP_Hypopnea) { // Make sure at least one of the CPAP data gets through with 0 + hascode=true; + } if (hascode) { m_days[dn]=day; switch(type) { diff --git a/SleepLib/calcs.cpp b/SleepLib/calcs.cpp index e880748e..753997c0 100644 --- a/SleepLib/calcs.cpp +++ b/SleepLib/calcs.cpp @@ -903,9 +903,9 @@ 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 + 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 + const qint64 winsize=3600000; //qint64 first=session->first(), last=session->last(), f;