From 41fdcd0bd3f2f4f51914cef31fa6917cc640b92d Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Sat, 11 Apr 2020 15:52:32 -0400 Subject: [PATCH] Fix pressure relief display in statistics page. Also revert 691aafd as that change is no longer necessary with this fix. --- oscar/SleepLib/day.cpp | 11 ++++++++++- oscar/SleepLib/loader_plugins/resmed_loader.cpp | 5 ----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/oscar/SleepLib/day.cpp b/oscar/SleepLib/day.cpp index 526b654b..0b0a2f59 100644 --- a/oscar/SleepLib/day.cpp +++ b/oscar/SleepLib/day.cpp @@ -1492,7 +1492,16 @@ QString Day::getPressureRelief() if (pr_level_chan != NoChannel && settingExists(pr_level_chan)) { pr_level = qRound(settings_wavg(pr_level_chan)); } - if (pr_level >= 0) pr_str += QString(" %1").arg(schema::channel[pr_level_chan].option(pr_level)); + + if (pr_level >= 0) { + // TODO: Ideally the formatting of LOOKUP datatypes should be done in only one place. + schema::Channel & chan = schema::channel[pr_level_chan]; + QString level = chan.option(pr_level); + if (level.isEmpty()) { + level = QString().number(pr_level) + " " + chan.units();; + } + pr_str += QString(" %1").arg(level); + } } else pr_str = STR_TR_None; return pr_str; } diff --git a/oscar/SleepLib/loader_plugins/resmed_loader.cpp b/oscar/SleepLib/loader_plugins/resmed_loader.cpp index a72e17eb..90bec3f4 100644 --- a/oscar/SleepLib/loader_plugins/resmed_loader.cpp +++ b/oscar/SleepLib/loader_plugins/resmed_loader.cpp @@ -110,11 +110,6 @@ void ResmedLoader::initChannels() channel.add(GRP_CPAP, chan = new Channel(RMS9_EPRLevel = 0xe202, SETTING, MT_CPAP, SESSION, "EPRLevel", QObject::tr("EPR Level"), QObject::tr("Exhale Pressure Relief Level"), QObject::tr("EPR Level"), STR_UNIT_CMH2O, LOOKUP, Qt::blue)); - chan->addOption(0, QObject::tr("0cmH20")); - chan->addOption(1, QObject::tr("1cmH2O")); - chan->addOption(2, QObject::tr("2cmH2O")); - chan->addOption(3, QObject::tr("3cmH2O")); - // RMS9_SmartStart, RMS9_HumidStatus, RMS9_HumidLevel, // RMS9_PtAccess, RMS9_Mask, RMS9_ABFilter, RMS9_ClimateControl, RMS9_TubeType, // RMS9_Temp, RMS9_TempEnable;