From 35778aa1dfbaa834ad70c8f8a4892d56eac89102 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 24 Aug 2014 15:00:51 +1000 Subject: [PATCH] Basic S10 import capability --- .../loader_plugins/cms50f37_loader.cpp | 3 ++ .../SleepLib/loader_plugins/resmed_loader.cpp | 29 +++++++++++++++++-- .../SleepLib/loader_plugins/resmed_loader.h | 2 +- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp index fd6ad2ce..76cad9a6 100644 --- a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp @@ -216,6 +216,9 @@ QString CMS50F37Loader::getModel() QApplication::processEvents(); } while (model.isEmpty() && (time.elapsed() < TIMEOUT)); + QThread::msleep(100); + QApplication::processEvents(); + if (model.startsWith("CMS50I")) { duration_divisor = 4; } else { diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index 6d989c96..416864c9 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -142,7 +142,13 @@ void ResmedLoader::ParseSTR(Machine *mach, QStringList strfiles) qDebug() << "Parsing" << *it << date << str.GetNumDataRecords() << str.GetNumSignals(); EDFSignal *maskon = str.lookupLabel("Mask On"); + if (!maskon) { + maskon = str.lookupLabel("MaskOn"); + } EDFSignal *maskoff = str.lookupLabel("Mask Off"); + if (!maskoff) { + maskoff = str.lookupLabel("MaskOff"); + } EDFSignal *sig = nullptr; quint32 laston = 0; @@ -1123,7 +1129,7 @@ EDFduration getEDFDuration(QString filename) start = qMin(st2, start); - if (end < start) end = qMax(st2, start)+1; // This alone should really cover the EVE.EDF condition + if (end < start) end = qMax(st2, start)+10; // This alone should really cover the EVE.EDF condition // if (ext == "EVE") { // // This is an unavoidable kludge, because there genuinely is no duration given for EVE files. @@ -1203,6 +1209,13 @@ int ResmedLoader::scanFiles(Machine * mach, QString datalog_path) if (filename.length() == 4) { filename.toInt(&ok); + if (ok) { + dirs.push_back(fi.canonicalFilePath()); + } + } else if (filename.length() == 8) { + // S10 stores sessions per day folders + filename.toInt(&ok); + if (ok) { dirs.push_back(fi.canonicalFilePath()); } @@ -1805,7 +1818,7 @@ bool ResmedLoader::LoadEVE(Session *sess, const QString & path) double tt; // Notes: Event records have useless duration record. - sess->updateFirst(edf.startdate); + // sess->updateFirst(edf.startdate); EventList *OA = nullptr, *HY = nullptr, *CA = nullptr, *UA = nullptr; @@ -2461,6 +2474,18 @@ void ResInitModelMap() resmed_codes[CPAP_Snore].push_back("Snore.2s"); resmed_codes[CPAP_FLG].push_back("FlowLim.2s"); + //S.AS.StartPress + resmed_codes[CPAP_PressureMin].push_back("S.AS.MinPress"); + resmed_codes[CPAP_PressureMax].push_back("S.AS.MaxPress"); + + resmed_codes[RMS9_SetPressure].push_back("S.C.Press"); + + resmed_codes[RMS9_EPRLevel].push_back("S.EPR.Level"); + + + + + } diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.h b/sleepyhead/SleepLib/loader_plugins/resmed_loader.h index 0d2dbe70..855ebb5d 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.h +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.h @@ -374,7 +374,7 @@ class ResmedLoader : public CPAPLoader bool LoadPLD(Session *sess, const QString & path); virtual MachineInfo newInfo() { - return MachineInfo(MT_CPAP, 0, resmed_class_name, QObject::tr("ResMed"), QString(), QString(), QString(), QObject::tr("S9"), QDateTime::currentDateTime(), resmed_data_version); + return MachineInfo(MT_CPAP, 0, resmed_class_name, QObject::tr("ResMed"), QString(), QString(), QString(), QObject::tr("ResMed"), QDateTime::currentDateTime(), resmed_data_version); } virtual void initChannels();