Fix pressure relief display in statistics page.

Also revert 691aafd as that change is no longer necessary with this fix.
This commit is contained in:
sawinglogz 2020-04-11 15:52:32 -04:00
parent 0d25d31049
commit 41fdcd0bd3
2 changed files with 10 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;