diff --git a/oscar/SleepLib/loader_plugins/edfparser.cpp b/oscar/SleepLib/loader_plugins/edfparser.cpp index 02232826..15ed0a2d 100644 --- a/oscar/SleepLib/loader_plugins/edfparser.cpp +++ b/oscar/SleepLib/loader_plugins/edfparser.cpp @@ -7,6 +7,9 @@ * License. See the file COPYING in the main directory of the source code * for more details. */ +#define TEST_MACROS_ENABLEDoff +#include + #include #include #include @@ -305,6 +308,11 @@ bool EDFInfo::ParseSignalData() { for (int j=0;j AS11TestedModels {39463, 39420, 39421, 39423, 39483, 39485, 39517, 39520, 0}; +static const QVector AS11TestedModels {39463, 39420, 39421, 39423, 39483, 39485, 39517, 39520, 39494, 39491, 0}; ResmedLoader::ResmedLoader() { #ifndef UNITTEST_MODE @@ -1413,10 +1413,15 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap & STRmap, R.maskevents = maskeventcount->dataArray[rec]; CPAPMode mode = MODE_UNKNOWN; + IF (AS_eleven) + DEBUGFC Q(AS_eleven) Q(mode) Q(CPAP_Mode) Q(MODE_CPAP) Q((void*)str.lookupSignal(CPAP_Mode)) O("___________________________________"); if ((sig = str.lookupSignal(CPAP_Mode))) { int mod = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; R.rms9_mode = mod; + // Convert AirCurve 11 and AirSense 11 to appropiate resmed 10 modes. + DEBUGFC Q(rec) Q(sig->label) Q(sig->transducer_type); + DEBUGFC Q(mod) O("=") Q(sig->dataArray[rec]) O("*") Q(sig->gain) Q("+") Q(sig->offset); if ( AS_eleven ) { // translate AS11 mode values back to S9 / AS10 values switch ( mod ) { case 0: @@ -1431,6 +1436,12 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap & STRmap, case 3: R.rms9_mode = 0; // make it be CPAP break; + case 7: // Added for ASV . + case 8: // Added for vAuto . + //case 9: + //case 10: + //case 11: // will 11 (A4Her) ever be generated by AS/AC 11? + break; // no change these are the same as in aircurve 10 default: R.rms9_mode = 16; // unknown for now break; @@ -1866,7 +1877,7 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap & STRmap, R.s_SmartStop = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; if ( AS_eleven ) R.s_SmartStop--; - qDebug() << "SmartStop is set to" << R.s_SmartStop; + //qDebug() << "SmartStop is set to" << R.s_SmartStop; } if ((sig = str.lookupLabel("S.HumEnable"))) { R.s_HumEnable = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; @@ -1888,7 +1899,7 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap & STRmap, R.s_Tube = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; } if ((R.rms9_mode >= 2) && (R.rms9_mode <= 5)) { // S, ST, or T modes - qDebug() << "BiLevel Mode found" << R.rms9_mode; + //qDebug() << "BiLevel Mode found" << R.rms9_mode; if (R.rms9_mode == 3) { // S mode only if ((sig = str.lookupLabel("S.EasyBreathe"))) { R.s_EasyBreathe = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; @@ -1919,19 +1930,19 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap & STRmap, qDebug() << "vAuto mode found" << 6; if ((sig = str.lookupLabel("S.Cycle"))) { R.s_Cycle = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; - qDebug() << "Cycle" << R.s_Cycle; + // qDebug() << "Cycle" << R.s_Cycle; } if ((sig = str.lookupLabel("S.Trigger"))) { R.s_Trigger = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; - qDebug() << "Trigger" << R.s_Trigger; + // qDebug() << "Trigger" << R.s_Trigger; } if ((sig = str.lookupLabel("S.TiMax"))) { R.s_TiMax = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; - qDebug() << QString("TiMax %1").arg( R.s_TiMax, 0, 'f', 1); + // qDebug() << QString("TiMax %1").arg( R.s_TiMax, 0, 'f', 1); } if ((sig = str.lookupLabel("S.TiMin"))) { R.s_TiMin = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset; - qDebug() << QString("TiMin %1").arg( R.s_TiMin, 0, 'f', 1); + // qDebug() << QString("TiMin %1").arg( R.s_TiMin, 0, 'f', 1); } } if ( R.min_pressure == 0 ) { @@ -3571,9 +3582,10 @@ void ResmedLoader::ToTimeDelta(Session *sess, ResMedEDFInfo &edf, EDFSignal &es, el->AddEvent(tt, c); if (forceDebug && ((code == CPAP_Pressure) || (code == CPAP_IPAP) || (code == CPAP_EPAP)) ) qDebug() << "Last Event:" << tmp << QDateTime::fromMSecsSinceEpoch(tt).toString() << "Pos:" << (sptr-1) - es.dataArray; - } else + } else { qDebug() << "Failed to add last event - Code:" << QString::number(code, 16) << "Value:" << tmp << QDateTime::fromMSecsSinceEpoch(tt).toString() << "Pos:" << (sptr-1) - es.dataArray; + } sess->updateMin(code, min); sess->updateMax(code, max);