From 610c9351915399a3ae997618de36510c833aff28 Mon Sep 17 00:00:00 2001 From: Seeker4 Date: Tue, 11 Jun 2019 06:28:34 -0700 Subject: [PATCH 1/2] Correct error in calculating number of periods in monthly report. --- oscar/statistics.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/oscar/statistics.cpp b/oscar/statistics.cpp index e3cea829..dd7fc6a3 100644 --- a/oscar/statistics.cpp +++ b/oscar/statistics.cpp @@ -1011,13 +1011,14 @@ QString Statistics::GenerateHTML() // Compute number of monthly periods for a monthly rather than standard time distribution int number_periods = 0; if (p_profile->general->statReportMode() == STAT_MODE_MONTHLY) { - QDate beginDate = qMax(firstcpap, lastcpap.addYears(-1)); - int beginMonth = beginDate.month(); + int firstMonth = firstcpap.month(); int lastMonth = lastcpap.month(); - if (lastMonth < beginMonth) lastMonth += 12; // handle time extending to next year - number_periods = lastMonth - beginMonth + 1; + if (lastMonth <= firstMonth && firstcpap.year() != lastcpap.year()) + lastMonth += 12; // handle time extending to next year + number_periods = lastMonth - firstMonth + 1; + if (number_periods < 1) { - qDebug() << "*** Begin" << beginDate << "beginMonth" << beginMonth << "lastMonth" << lastMonth << "periods" << number_periods; + qDebug() << "*** Begin" << firstcpap << "beginMonth" << firstMonth << "lastMonth" << lastMonth << "periods" << number_periods; number_periods = 1; } // But not more than one year From 24258ea4e3abc2df8c7b16243005914ba5406e4e Mon Sep 17 00:00:00 2001 From: Seeker4 Date: Tue, 11 Jun 2019 10:20:03 -0700 Subject: [PATCH 2/2] Correctly identify Climate setting as Auto or Manual in Machine Settings on Daily page. --- oscar/SleepLib/loader_plugins/resmed_loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oscar/SleepLib/loader_plugins/resmed_loader.cpp b/oscar/SleepLib/loader_plugins/resmed_loader.cpp index 7e37534c..cbf0fe37 100644 --- a/oscar/SleepLib/loader_plugins/resmed_loader.cpp +++ b/oscar/SleepLib/loader_plugins/resmed_loader.cpp @@ -3117,8 +3117,8 @@ void ResmedLoader::initChannels() QObject::tr("Climate Control"), "", LOOKUP, Qt::black)); - chan->addOption(0, QObject::tr("Manual")); - chan->addOption(1, QObject::tr("Auto")); + chan->addOption(0, QObject::tr("Auto")); + chan->addOption(1, QObject::tr("Manual")); channel.add(GRP_CPAP, chan = new Channel(RMS9_Mask= 0xe20C, SETTING, MT_CPAP, SESSION, "RMS9_Mask", QObject::tr("Mask"),