diff --git a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp index e540899c..9adc6285 100644 --- a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.cpp @@ -581,16 +581,8 @@ int IntellipapLoader::Open(QString path) return c; } -bool intellipap_initialized = false; -void IntellipapLoader::Register() +void IntellipapLoader::initChannels() { - if (intellipap_initialized) { return; } - - qDebug() << "Registering IntellipapLoader"; - RegisterLoader(new IntellipapLoader()); - //InitModelMap(); - intellipap_initialized = true; - using namespace schema; Channel * chan = nullptr; channel.add(GRP_CPAP, chan = new Channel(INTP_SmartFlexMode = 0x1165, SETTING, SESSION, @@ -610,3 +602,15 @@ void IntellipapLoader::Register() QObject::tr("SmartFlex Level"), "", DEFAULT, Qt::green)); } + +bool intellipap_initialized = false; +void IntellipapLoader::Register() +{ + if (intellipap_initialized) { return; } + + qDebug() << "Registering IntellipapLoader"; + RegisterLoader(new IntellipapLoader()); + //InitModelMap(); + intellipap_initialized = true; + +} diff --git a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.h b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.h index 45adc508..4e3eb8e2 100644 --- a/sleepyhead/SleepLib/loader_plugins/intellipap_loader.h +++ b/sleepyhead/SleepLib/loader_plugins/intellipap_loader.h @@ -75,6 +75,8 @@ class IntellipapLoader : public CPAPLoader virtual MachineInfo newInfo() { return MachineInfo(MT_CPAP, 0, intellipap_class_name, QObject::tr("DeVilbiss"), QString(), QString(), QString(), QObject::tr("Intellipap"), QDateTime::currentDateTime(), intellipap_data_version); } + virtual void initChannels(); + //////////////////////////////////////////////////////////////////////////////////////////////////////////// // Now for some CPAPLoader overrides diff --git a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp index 74bfd5df..92828a59 100644 --- a/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/prs1_loader.cpp @@ -1447,7 +1447,7 @@ bool PRS1Import::ParseSummaryF5() session->settings[CPAP_RampPressure] = ramp_pressure; - int duration=data[0x1B] | data[0x1C] << 8; + int duration=data[0x18] | data[0x19] << 8; session->set_last(qint64(summary->timestamp+duration) * 1000L); return true; @@ -1985,14 +1985,9 @@ using namespace schema; Channel PRS1Channels; -void PRS1Loader::Register() +void PRS1Loader::initChannels() { - if (initialized) { return; } - - qDebug() << "Registering PRS1Loader"; - RegisterLoader(new PRS1Loader()); - InitModelMap(); - initialized = true; + Channel * chan = nullptr; channel.add(GRP_CPAP, new Channel(CPAP_PressurePulse = 0x1009, MINOR_FLAG, SESSION, "PressurePulse", @@ -2001,9 +1996,6 @@ void PRS1Loader::Register() QObject::tr("PP"), STR_UNIT_EventsPerHour, DEFAULT, QColor("dark red"))); - - - Channel * chan = nullptr; channel.add(GRP_CPAP, chan = new Channel(PRS1_FlexMode = 0xe105, SETTING, SESSION, "PRS1FlexMode", QObject::tr("Flex Mode"), QObject::tr("PRS1 pressure relief mode."), @@ -2137,8 +2129,6 @@ void PRS1Loader::Register() //