From 89e9e305fb83189067dc532d1ac5b15d68d7eb4d Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Thu, 26 Mar 2020 19:47:37 -0400 Subject: [PATCH 1/3] Fix gcc warning in PRS1 loader. --- oscar/SleepLib/loader_plugins/prs1_loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oscar/SleepLib/loader_plugins/prs1_loader.cpp b/oscar/SleepLib/loader_plugins/prs1_loader.cpp index bedcda30..fcaf8a22 100644 --- a/oscar/SleepLib/loader_plugins/prs1_loader.cpp +++ b/oscar/SleepLib/loader_plugins/prs1_loader.cpp @@ -6907,7 +6907,7 @@ bool PRS1DataChunk::ParseSettingsF0V6(const unsigned char* data, int size) break; case 0x40: // new to 400G, also seen on 500X110, alternate tubing type? appears after 0x39 and before 0x3c CHECK_VALUE(len, 1); - if (data[pos] < 0 || data[pos] > 3) UNEXPECTED_VALUE(data[pos], "0-3"); // 0 = 22mm, 1 = 15mm, 2 = 15HT, 3 = 12mm + if (data[pos] > 3) UNEXPECTED_VALUE(data[pos], "0-3"); // 0 = 22mm, 1 = 15mm, 2 = 15HT, 3 = 12mm this->ParseTubingTypeV3(data[pos]); break; case 0x3c: // View Optional Screens @@ -7467,7 +7467,7 @@ bool PRS1DataChunk::ParseSettingsF5V3(const unsigned char* data, int size) break; case 0x3b: // Tubing Type CHECK_VALUE(len, 1); - if (data[pos] < 0 || data[pos] > 2) UNEXPECTED_VALUE(data[pos], "0-2"); // 15HT = 2, 15 = 1, 22 = 0, though report only says "15" for 15HT + if (data[pos] > 2) UNEXPECTED_VALUE(data[pos], "0-2"); // 15HT = 2, 15 = 1, 22 = 0, though report only says "15" for 15HT this->ParseTubingTypeV3(data[pos]); break; case 0x3c: // View Optional Screens From 47c97721fbd74ed331f81d5d259ba92d7fb2b7c2 Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Thu, 26 Mar 2020 19:48:09 -0400 Subject: [PATCH 2/3] Use platform-native fullscreen shortcut for Maximize Toggle. Also fix annoying typo in mainwindow.ui. --- oscar/mainwindow.cpp | 1 + oscar/mainwindow.ui | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index 26c1a889..ed8e6def 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -135,6 +135,7 @@ void MainWindow::SetupGUI() ui->action_Preferences->setMenuRole(QAction::PreferencesRole); #endif ui->actionPrint_Report->setShortcuts(QKeySequence::Print); + ui->action_Fullscreen->setShortcuts(QKeySequence::FullScreen); ui->actionLine_Cursor->setChecked(AppSetting->lineCursorMode()); ui->actionPie_Chart->setChecked(AppSetting->showPieChart()); diff --git a/oscar/mainwindow.ui b/oscar/mainwindow.ui index 696a7374..e6af849c 100644 --- a/oscar/mainwindow.ui +++ b/oscar/mainwindow.ui @@ -2887,7 +2887,7 @@ p, li { white-space: pre-wrap; } &Advanced - + Purge Oximetry Data @@ -2901,7 +2901,7 @@ p, li { white-space: pre-wrap; } - + From 828d449aa44d5626c658d9cc82e89166a08679d6 Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Thu, 26 Mar 2020 19:59:54 -0400 Subject: [PATCH 3/3] Update summary cache so that purging oximetry persists between launches. --- oscar/mainwindow.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/oscar/mainwindow.cpp b/oscar/mainwindow.cpp index ed8e6def..53e8a30e 100644 --- a/oscar/mainwindow.cpp +++ b/oscar/mainwindow.cpp @@ -2587,16 +2587,19 @@ void MainWindow::on_actionPurgeCurrentDaysOximetry_triggered() } QList sessionlist=day->getSessions(MT_OXIMETER); + QSet machines; for (auto & sess : sessionlist) { + machines += sess->machine(); sess->Destroy(); delete sess; } - // TODO: Fix this. It deletes the underlying session data file in the machine, - // but not from the machine's summary cache. This results in future launches - // of OSCAR thinking the day has oximetry data, but then it isn't really there. - // Currently this is only useful for reimporting a single day, which the purge - // permits, and which in turn creates a new data file for that day. + + // We have to update the summary cache for the affected machine(s), + // otherwise OSCAR will still think this day has oximetry data at next launch. + for (auto & mach : machines) { + mach->SaveSummaryCache(); + } if (daily) {