From 6b581bc3038e64fbff0b2c9a8240708335706d81 Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Tue, 24 Mar 2020 21:33:50 -0400 Subject: [PATCH] Fix AVAPS settings display. --- oscar/SleepLib/day.cpp | 5 +++-- oscar/SleepLib/loader_plugins/prs1_loader.cpp | 12 +++++------- oscar/welcome.cpp | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/oscar/SleepLib/day.cpp b/oscar/SleepLib/day.cpp index 659da7b4..fcc90d9f 100644 --- a/oscar/SleepLib/day.cpp +++ b/oscar/SleepLib/day.cpp @@ -1534,9 +1534,10 @@ QString Day::getPressureSettings() arg(validPressure(settings_min(CPAP_PSMax))). arg(units); } else if (mode == MODE_AVAPS) { - return QObject::tr("EPAP %1 IPAP %2 (%3)"). + return QObject::tr("EPAP %1 IPAP %2-%3 (%4)"). arg(validPressure(settings_min(CPAP_EPAP))). - arg(validPressure(settings_max(CPAP_IPAP))). + arg(validPressure(settings_max(CPAP_IPAPLo))). + arg(validPressure(settings_max(CPAP_IPAPHi))). arg(units); } diff --git a/oscar/SleepLib/loader_plugins/prs1_loader.cpp b/oscar/SleepLib/loader_plugins/prs1_loader.cpp index 118fcc30..9dfcbc5b 100644 --- a/oscar/SleepLib/loader_plugins/prs1_loader.cpp +++ b/oscar/SleepLib/loader_plugins/prs1_loader.cpp @@ -4172,17 +4172,15 @@ CPAPMode PRS1Import::importMode(int prs1mode) case PRS1_MODE_BILEVEL: mode = MODE_BILEVEL_FIXED; break; case PRS1_MODE_AUTOBILEVEL: mode = MODE_BILEVEL_AUTO_VARIABLE_PS; break; case PRS1_MODE_ASV: mode = MODE_ASV_VARIABLE_EPAP; break; - case PRS1_MODE_S: mode = MODE_BILEVEL_FIXED; break; // TODO - case PRS1_MODE_ST: mode = MODE_BILEVEL_FIXED; break; // TODO, pressure seems variable - case PRS1_MODE_PC: mode = MODE_AVAPS; break; // TODO, maybe only PC - AVAPS mode - case PRS1_MODE_ST_AVAPS: mode = MODE_AVAPS; break; // TODO, maybe only PC - AVAPS mode - case PRS1_MODE_PC_AVAPS: mode = MODE_AVAPS; break; // TODO, maybe only PC - AVAPS mode + case PRS1_MODE_S: mode = MODE_BILEVEL_FIXED; break; + case PRS1_MODE_ST: mode = MODE_BILEVEL_FIXED; break; + case PRS1_MODE_PC: mode = MODE_BILEVEL_FIXED; break; + case PRS1_MODE_ST_AVAPS: mode = MODE_AVAPS; break; + case PRS1_MODE_PC_AVAPS: mode = MODE_AVAPS; break; default: UNEXPECTED_VALUE(prs1mode, "known PRS1 mode"); break; } - // TODO: fixed vs. variable PS seems to be independent from ventilator mode, for example - // S/T can be fixed (single IPAP pressure) or variable (IPAP min/max). return mode; } diff --git a/oscar/welcome.cpp b/oscar/welcome.cpp index c263eb33..d1559132 100644 --- a/oscar/welcome.cpp +++ b/oscar/welcome.cpp @@ -244,7 +244,7 @@ QString Welcome::GenerateCPAPHTML() EventDataType ipap = day->percentile(pressChanID, perc/100.0); EventDataType epap = day->percentile(CPAP_EPAP, perc/100.0); html += tr("Your machine was under %1-%2 %3 for %4% of the time.").arg(epap).arg(ipap).arg(schema::channel[pressChanID].units()).arg(perc); - } else if (cpapmode == MODE_ASV){ + } else if (cpapmode == MODE_ASV || cpapmode == MODE_AVAPS){ EventDataType ipap = day->percentile(pressChanID, perc/100.0); EventDataType epap = qRound(day->settings_wavg(CPAP_EPAP));