From c0006879ceed1f16d5bcb7da21be77b47363a7b9 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 28 Feb 2016 08:03:11 +1000 Subject: [PATCH] DreamStation PRS1 second hypopnea code 0x15 Not being Parsed (bug-284) --- .../SleepLib/loader_plugins/prs1_loader.cpp | 30 +++++++++++++++++-- sleepyhead/SleepLib/machine_common.cpp | 2 +- sleepyhead/SleepLib/machine_common.h | 2 +- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index b24e066e..a3045488 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -1107,6 +1107,8 @@ bool PRS1Import::ParseF0Events() EventList *IPAP = nullptr; EventList *PS = nullptr; + EventList *Code15 = nullptr; + //session->AddEventList(CPAP_VSnore, EVL_Event); //EventList * VS=session->AddEventList(CPAP_Obstructive, EVL_Event); unsigned char lastcode3 = 0, lastcode2 = 0, lastcode = 0; @@ -1130,7 +1132,7 @@ bool PRS1Import::ParseF0Events() startpos = pos; code = buffer[pos++]; - if (code > 0x14) { + if (code > 0x15) { qDebug() << "Illegal PRS1 code " << hex << int(code) << " appeared at " << hex << startpos; qDebug() << "1: (" << hex << int(lastcode) << hex << lastpos << ")"; qDebug() << "2: (" << hex << int(lastcode2) << hex << lastpos2 << ")"; @@ -1357,6 +1359,22 @@ bool PRS1Import::ParseF0Events() HY->AddEvent(tt, data[0]); break; + case 0x15: // DreamStation Hypopnea // Also a hypopnea.. Hmmm. grouped together by encore. + data[0] = buffer[pos++]; + tt = t - (qint64(data[0]) * 1000L); + HY->AddEvent(tt, data[0]); + + + // This will create an ugly overlay... :/ +// if (!Code15) { +// Code15 = session->AddEventList(CPAP_Pressure, EVL_Event, 0.1F); + +// if (!Code15) { return false; } +// } +// Code15->AddEvent(t, data[0]); + + break; + default: // ERROR!!! qWarning() << "Some new fandangled PRS1 code detected in" << event->sessionid << hex @@ -1951,7 +1969,8 @@ bool PRS1Import::ParseSummaryF0V6() // break; default: // have not found this before - qDebug() << "PRS1Loader::ParseSummaryF0V6=" << "Unknown datablock value:" << (zero + *dataPtr) ; + ; + // qDebug() << "PRS1Loader::ParseSummaryF0V6=" << "Unknown datablock value:" << (zero + *dataPtr) ; } } // now we encounter yet a different format of data @@ -2896,6 +2915,13 @@ void PRS1Loader::initChannels() // QString(unknownshort).arg(0x12,2,16,QChar('0')), // STR_UNIT_Unknown, // DEFAULT, QColor("black"))); + channel.add(GRP_CPAP, new Channel(PRS1_15 = 0x115A, UNKNOWN, MT_CPAP, SESSION, + "PRS1_15", + QString(unknownname).arg(0x15,2,16,QChar('0')), + QString(unknowndesc).arg(0x15,2,16,QChar('0')), + QString(unknownshort).arg(0x15,2,16,QChar('0')), + STR_UNIT_Unknown, + DEFAULT, QColor("black"))); channel.add(GRP_CPAP, new Channel(PRS1_TimedBreath = 0x1180, MINOR_FLAG, MT_CPAP, SESSION, diff --git a/sleepyhead/SleepLib/machine_common.cpp b/sleepyhead/SleepLib/machine_common.cpp index e1310a33..ea3d73bc 100644 --- a/sleepyhead/SleepLib/machine_common.cpp +++ b/sleepyhead/SleepLib/machine_common.cpp @@ -29,7 +29,7 @@ ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CPAP_EPAP ChannelID RMS9_E01, RMS9_E02, RMS9_SetPressure, RMS9_MaskOnTime; ChannelID INTELLIPAP_Unknown1, INTELLIPAP_Unknown2; -ChannelID PRS1_00, PRS1_01, PRS1_08, PRS1_0A, PRS1_0B, PRS1_0C, PRS1_0E, PRS1_0F, CPAP_LargeLeak, PRS1_12, +ChannelID PRS1_00, PRS1_01, PRS1_08, PRS1_0A, PRS1_0B, PRS1_0C, PRS1_0E, PRS1_0F, CPAP_LargeLeak, PRS1_12, PRS1_15, PRS1_FlexMode, PRS1_FlexLevel, PRS1_HumidStatus, PRS1_HumidLevel, PRS1_SysLock, PRS1_SysOneResistStat, PRS1_SysOneResistSet, PRS1_HoseDiam, PRS1_AutoOn, PRS1_AutoOff, PRS1_MaskAlert, PRS1_ShowAHI; diff --git a/sleepyhead/SleepLib/machine_common.h b/sleepyhead/SleepLib/machine_common.h index 434f5049..d9683755 100644 --- a/sleepyhead/SleepLib/machine_common.h +++ b/sleepyhead/SleepLib/machine_common.h @@ -150,7 +150,7 @@ extern ChannelID CPAP_IPAP, CPAP_IPAPLo, CPAP_IPAPHi, CPAP_EPAP, CPAP_EPAPLo, CP extern ChannelID RMS9_E01, RMS9_E02, RMS9_SetPressure, RMS9_MaskOnTime; extern ChannelID PRS1_00, PRS1_01, PRS1_08, PRS1_0A, PRS1_0B, PRS1_0C, PRS1_0E, PRS1_0F, CPAP_LargeLeak, - PRS1_12, + PRS1_12, PRS1_15, PRS1_FlexMode, PRS1_FlexLevel, PRS1_HumidStatus, PRS1_HumidLevel, CPAP_HumidSetting, PRS1_SysLock, PRS1_SysOneResistStat, PRS1_SysOneResistSet, PRS1_HoseDiam, PRS1_AutoOn, PRS1_AutoOff, PRS1_MaskAlert, PRS1_ShowAHI;