diff --git a/sleepyhead/Graphs/gLineChart.cpp b/sleepyhead/Graphs/gLineChart.cpp index ca429c22..31238123 100644 --- a/sleepyhead/Graphs/gLineChart.cpp +++ b/sleepyhead/Graphs/gLineChart.cpp @@ -119,6 +119,14 @@ void gLineChart::SetDay(Day *d) Session *sess = d->sessions[i]; if (!sess->enabled()) continue; + CPAPMode mode = (CPAPMode)sess->settings[CPAP_Mode].toInt(); + + if (mode >= MODE_BILEVEL_FIXED) { + m_enabled[CPAP_Pressure] = false; + m_enabled[CPAP_IPAP] = true; + m_enabled[CPAP_EPAP] = true; + } + if (code == CPAP_MaskPressure) { if (sess->channelExists(CPAP_MaskPressureHi)) { code = m_codes[j] = CPAP_MaskPressureHi; diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index 1604fbdd..ffc43693 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -1006,6 +1006,18 @@ void ResmedImport::run() return; } } + CPAPMode mode = (CPAPMode)sess->settings[CPAP_Mode].toInt(); + + if ((mode >= MODE_BILEVEL_FIXED) && (!sess->eventlist.contains(CPAP_IPAP))) { + QVector & evl = sess->eventlist[CPAP_Pressure]; + + for (int i=0; ieventlist[CPAP_IPAP].push_back(el); + } + + sess->eventlist.remove(CPAP_Pressure); + } // Update indexes, process waveform and perform flagging sess->UpdateSummaries(); @@ -3131,6 +3143,7 @@ void ResInitModelMap() resmed_codes[CPAP_IPAP].push_back("IPAP"); resmed_codes[CPAP_IPAP].push_back("S.BL.IPAP"); resmed_codes[CPAP_EPAP].push_back("Exp Pres"); + resmed_codes[CPAP_EPAP].push_back("EprPress.2s"); resmed_codes[CPAP_EPAP].push_back("EPAP"); resmed_codes[CPAP_EPAP].push_back("S.BL.EPAP"); resmed_codes[CPAP_EPAPHi].push_back("Max EPAP"); @@ -3230,7 +3243,7 @@ void ResInitModelMap() // PLD file resmed_codes[CPAP_MaskPressure].push_back("MaskPress.2s"); - resmed_codes[CPAP_Pressure].push_back("Press.2s"); + resmed_codes[CPAP_Pressure].push_back("Press.2s"); // Un problemo... IPAP also uses this.. :/ resmed_codes[CPAP_EPAP].push_back("EPRPress.2s"); resmed_codes[CPAP_Leak].push_back("Leak.2s"); resmed_codes[CPAP_RespRate].push_back("RespRate.2s"); diff --git a/sleepyhead/statistics.cpp b/sleepyhead/statistics.cpp index cf2c6e97..86094159 100644 --- a/sleepyhead/statistics.cpp +++ b/sleepyhead/statistics.cpp @@ -240,7 +240,7 @@ void Statistics::updateRXChanges() rx1.relief = relief; rx1.mode = mode; rx1.pressure = pressure; - rx1.machine = day->machine(MT_CPAP); + rx1.machine = mach; rx1.dates[date] = day; // Insert new entry into rx cache @@ -391,7 +391,7 @@ void Statistics::updateRXChanges() RXItem & rx = lastri.value(); // Does it match here? - if ((rx.relief == relief) && (rx.mode == mode) && (rx.pressure == pressure) && (rx.machine == day->machine(MT_CPAP)) ) { + if ((rx.relief == relief) && (rx.mode == mode) && (rx.pressure == pressure) && (rx.machine == mach) ) { // Update AHI/RDI tmp = day->count(CPAP_Hypopnea) + day->count(CPAP_Obstructive) + day->count(CPAP_Apnea) + day->count(CPAP_ClearAirway); @@ -443,7 +443,7 @@ void Statistics::updateRXChanges() rx.relief = relief; rx.mode = mode; rx.pressure = pressure; - rx.machine = day->machine(MT_CPAP); + rx.machine = mach; // add this day to this rx record rx.dates.insert(date, day);