diff --git a/sleepyhead/SleepLib/day.cpp b/sleepyhead/SleepLib/day.cpp index 523163a8..928d1990 100644 --- a/sleepyhead/SleepLib/day.cpp +++ b/sleepyhead/SleepLib/day.cpp @@ -110,7 +110,7 @@ EventDataType Day::settings_sum(ChannelID code) EventDataType Day::settings_max(ChannelID code) { - EventDataType min = std::numeric_limits::min(); + EventDataType min = -std::numeric_limits::max(); EventDataType max = min; EventDataType value; @@ -118,7 +118,7 @@ EventDataType Day::settings_max(ChannelID code) for(QList::iterator it = sessions.begin(); it < end; ++it) { Session &sess = *(*it); if (sess.enabled()) { - value = sess.settings.value(code, min).toDouble(); + value = sess.settings.value(code, min).toFloat(); if (value > max) { max = value; } @@ -139,7 +139,7 @@ EventDataType Day::settings_min(ChannelID code) for(QList::iterator it = sessions.begin(); it < end; ++it) { Session &sess = *(*it); if (sess.enabled()) { - value = sess.settings.value(code, max).toDouble(); + value = sess.settings.value(code, max).toFloat(); if (value < min) { min = value; } diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index b9f13986..618f9281 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -271,8 +271,8 @@ void ResmedLoader::ParseSTR(Machine *mach, QStringList strfiles) if ((sig = str.lookupSignal(RMS9_EPR))) { R.epr = EventDataType(sig->data[rec]) * sig->gain + sig->offset; } - if ((sig = str.lookupSignal(RMS9_EPRSet))) { - R.epr_set = EventDataType(sig->data[rec]) * sig->gain + sig->offset; + if ((sig = str.lookupSignal(RMS9_EPRLevel))) { + R.epr_level = EventDataType(sig->data[rec]) * sig->gain + sig->offset; } if ((sig = str.lookupSignal(CPAP_Mode))) { int mod = EventDataType(sig->data[rec]) * sig->gain + sig->offset; @@ -688,9 +688,9 @@ void ResmedImport::run() sess->settings[CPAP_PresReliefType] = (int)PR_EPR; sess->settings[CPAP_PresReliefSet] = (int)R.epr; } - if (R.epr_set >= 0) { - sess->settings[RMS9_EPRSet] = (int)R.epr_set; - sess->settings[CPAP_PresReliefMode] = (int)R.epr_set; + if (R.epr_level >= 0) { + sess->settings[RMS9_EPRLevel] = (int)R.epr_level; + sess->settings[CPAP_PresReliefMode] = (int)R.epr_level; } // Ignore all the rest of the sumary data, because there is enough available to calculate it with higher accuracy. @@ -809,9 +809,9 @@ void ResmedImportStage2::run() sess->settings[CPAP_PresReliefType] = (int)PR_EPR; sess->settings[CPAP_PresReliefSet] = (int)R.epr; } - if (R.epr_set >= 0) { - sess->settings[RMS9_EPRSet] = (int)R.epr_set; - sess->settings[CPAP_PresReliefMode] = (int)R.epr_set; + if (R.epr_level >= 0) { + sess->settings[RMS9_EPRLevel] = (int)R.epr_level; + sess->settings[CPAP_PresReliefMode] = (int)R.epr_level; } if (R.leakmax >= 0) sess->setMax(CPAP_Leak, R.leakmax); if (R.leakmax >= 0) sess->setMin(CPAP_Leak, 0); @@ -2107,14 +2107,14 @@ void ResInitModelMap() resmed_codes[RMS9_SetPressure].push_back("Inställt tryck"); resmed_codes[RMS9_EPR].push_back("EPR"); resmed_codes[RMS9_EPR].push_back("\xE5\x91\xBC\xE6\xB0\x94\xE9\x87\x8A\xE5\x8E\x8B\x28\x45\x50"); // Chinese - resmed_codes[RMS9_EPRSet].push_back("EPR Level"); - resmed_codes[RMS9_EPRSet].push_back("EPR-Stufe"); - resmed_codes[RMS9_EPRSet].push_back("EPR-niveau"); - resmed_codes[RMS9_EPRSet].push_back("\x45\x50\x52\x20\xE6\xB0\xB4\xE5\xB9\xB3"); // Chinese + resmed_codes[RMS9_EPRLevel].push_back("EPR Level"); + resmed_codes[RMS9_EPRLevel].push_back("EPR-Stufe"); + resmed_codes[RMS9_EPRLevel].push_back("EPR-niveau"); + resmed_codes[RMS9_EPRLevel].push_back("\x45\x50\x52\x20\xE6\xB0\xB4\xE5\xB9\xB3"); // Chinese - resmed_codes[RMS9_EPRSet].push_back("Niveau EPR"); - resmed_codes[RMS9_EPRSet].push_back("EPR-nivå"); - resmed_codes[RMS9_EPRSet].push_back("EPR-nivÃ¥"); + resmed_codes[RMS9_EPRLevel].push_back("Niveau EPR"); + resmed_codes[RMS9_EPRLevel].push_back("EPR-nivå"); + resmed_codes[RMS9_EPRLevel].push_back("EPR-nivÃ¥"); resmed_codes[CPAP_PressureMax].push_back("Max Pressure"); resmed_codes[CPAP_PressureMax].push_back("Max. Druck"); resmed_codes[CPAP_PressureMax].push_back("Max druk"); diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.h b/sleepyhead/SleepLib/loader_plugins/resmed_loader.h index 4c44a6f8..db13b2b3 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.h +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.h @@ -122,7 +122,7 @@ struct STRRecord max_ipap = -1; min_ipap = -1; epr = -1; - epr_set = -1; + epr_level = -1; sessionid = 0; ahi = -1; @@ -157,7 +157,7 @@ struct STRRecord max_ipap = copy.max_ipap; min_ipap = copy.min_ipap; epr = copy.epr; - epr_set = copy.epr_set; + epr_level = copy.epr_level; sessionid = copy.sessionid; ahi = copy.ahi; ai = copy.ai; @@ -188,7 +188,7 @@ struct STRRecord EventDataType max_ipap; EventDataType min_ipap; EventDataType epr; - EventDataType epr_set; + EventDataType epr_level; quint32 sessionid; EventDataType ahi; EventDataType ai; diff --git a/sleepyhead/SleepLib/machine.cpp b/sleepyhead/SleepLib/machine.cpp index 734b53bd..10e35324 100644 --- a/sleepyhead/SleepLib/machine.cpp +++ b/sleepyhead/SleepLib/machine.cpp @@ -638,7 +638,7 @@ ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CPAP_EPAP CPAP_Test2; -ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRSet, RMS9_SetPressure, RMS9_MaskOnTime; +ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRLevel, RMS9_SetPressure, RMS9_MaskOnTime; ChannelID INTP_SmartFlex; ChannelID INTELLIPAP_Unknown1, INTELLIPAP_Unknown2; diff --git a/sleepyhead/SleepLib/machine_common.h b/sleepyhead/SleepLib/machine_common.h index a01b6ae0..2d62427c 100644 --- a/sleepyhead/SleepLib/machine_common.h +++ b/sleepyhead/SleepLib/machine_common.h @@ -100,7 +100,7 @@ extern ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CP CPAP_UserFlag1, CPAP_UserFlag2, CPAP_UserFlag3, CPAP_BrokenSummary, CPAP_BrokenWaveform, CPAP_RDI, CPAP_PresReliefSet, CPAP_PresReliefMode, CPAP_PresReliefType, CPAP_Test1, CPAP_Test2; -extern ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRSet, RMS9_SetPressure, RMS9_MaskOnTime; +extern ChannelID RMS9_E01, RMS9_E02, RMS9_EPR, RMS9_EPRLevel, RMS9_SetPressure, RMS9_MaskOnTime; extern ChannelID INTP_SmartFlex; extern ChannelID PRS1_00, PRS1_01, PRS1_08, PRS1_0A, PRS1_0B, PRS1_0C, PRS1_0E, PRS1_0F, CPAP_LargeLeak, PRS1_12, diff --git a/sleepyhead/SleepLib/schema.cpp b/sleepyhead/SleepLib/schema.cpp index 1ebbf3be..2f4e6462 100644 --- a/sleepyhead/SleepLib/schema.cpp +++ b/sleepyhead/SleepLib/schema.cpp @@ -451,7 +451,7 @@ void init() RMS9_E01 = schema::channel["RMS9_E01"].id(); RMS9_E02 = schema::channel["RMS9_E02"].id(); RMS9_EPR = schema::channel["EPR"].id(); - RMS9_EPRSet = schema::channel["EPRSet"].id(); + RMS9_EPRLevel = schema::channel["EPRLevel"].id(); RMS9_SetPressure = schema::channel["SetPressure"].id(); PRS1_FlexMode = schema::channel["FlexMode"].id(); PRS1_FlexSet = schema::channel["FlexSet"].id(); diff --git a/sleepyhead/daily.cpp b/sleepyhead/daily.cpp index 2f65d0a6..d362b4cd 100644 --- a/sleepyhead/daily.cpp +++ b/sleepyhead/daily.cpp @@ -957,7 +957,15 @@ QString Daily::getMachineSettings(Day * cpap) { if (cpap->settingExists(CPAP_PresReliefType)) { int i=cpap->settings_max(CPAP_PresReliefType); int j=cpap->settings_max(CPAP_PresReliefMode); - QString flexstr=(i>1) ? schema::channel[CPAP_PresReliefType].option(i)+" x"+QString::number(j) : STR_TR_None; + QString flexstr; + + if (cpap->machine->GetClass() == STR_MACH_ResMed) { + // this is temporary.. + flexstr = QString(tr("EPR:%1 EPR_LEVEL:%2")).arg(cpap->settings_max(RMS9_EPR)).arg(cpap->settings_max(RMS9_EPRLevel)); + } else { + flexstr = (i>1) ? schema::channel[CPAP_PresReliefType].option(i)+" x"+QString::number(j) : STR_TR_None; + } + html+=QString("%1%2%3") .arg(STR_TR_PrRelief) .arg(schema::channel[CPAP_PresReliefType].description()) diff --git a/sleepyhead/docs/channels.xml b/sleepyhead/docs/channels.xml index dcbad23b..6531a479 100644 --- a/sleepyhead/docs/channels.xml +++ b/sleepyhead/docs/channels.xml @@ -162,7 +162,7 @@ Important: One id code per item, DO NOT CHANGE ID NUMBERS!!!