From 2c5d59e666e518e33bdc5e648fc6409d0ad940b4 Mon Sep 17 00:00:00 2001
From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com>
Date: Mon, 20 Dec 2021 12:42:45 -0500
Subject: [PATCH] Fix missing oximetry and motion waveforms on Overview pages.
Motion channels reported by oximeters and oximetry channels reported
by CPAPs weren't being calculated, so they'd always be blank when
present.
---
Htmldocs/release_notes.html | 1 +
oscar/Graphs/gSessionTimesChart.cpp | 12 ++++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Htmldocs/release_notes.html b/Htmldocs/release_notes.html
index 94cd1506..a5b13859 100644
--- a/Htmldocs/release_notes.html
+++ b/Htmldocs/release_notes.html
@@ -29,6 +29,7 @@
[new] Add 95% flow limitation to Therapy Efficacy section on Statistics page.
[new] Add date range option to Statistics page.
[new] Improve appearance and operation of event types and graphs comboboxes on Daily and Overview pages.
+ [fix] Fix missing oximetry and motion waveforms on Overview pages.
[fix] Correct SleepStyle machines sometimes identified as Icon machines.
[fix] Improve event flag position in flow graph for DV6 machines.
[fix] --datadir option now allows fully qualified paths on Mac and Linux.
diff --git a/oscar/Graphs/gSessionTimesChart.cpp b/oscar/Graphs/gSessionTimesChart.cpp
index b4ba8a75..06e23aab 100644
--- a/oscar/Graphs/gSessionTimesChart.cpp
+++ b/oscar/Graphs/gSessionTimesChart.cpp
@@ -68,8 +68,16 @@ void gSummaryChart::SetDay(Day *unused_day)
Q_UNUSED(unused_day)
Layer::SetDay(nullptr);
- firstday = p_profile->FirstDay(m_machtype);
- lastday = p_profile->LastDay(m_machtype);
+ if (m_machtype != MT_CPAP) {
+ // Channels' machine types are not terribly reliable: oximetry channels can be reported by a CPAP,
+ // and position channels can be reported by an oximeter. So look for any days with data.
+ firstday = p_profile->FirstDay();
+ lastday = p_profile->LastDay();
+ } else {
+ // But CPAP channels (like pressure settings) can only be reported by a CPAP.
+ firstday = p_profile->FirstDay(m_machtype);
+ lastday = p_profile->LastDay(m_machtype);
+ }
dayindex.clear();
daylist.clear();