From 2e2b7d269c92445cf6409b678da0626d332dc612 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Mon, 4 Apr 2016 01:00:36 +1000 Subject: [PATCH] Issue #0005 EPR on/off glitch --- sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index c8332177..b5fabce5 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -403,6 +403,7 @@ void ResmedLoader::ParseSTR(Machine *mach, QStringList strfiles) } EventDataType epr = -1, epr_level = -1; + bool a10 = false; if ((mode == MODE_CPAP) || (mode == MODE_APAP)) { if ((sig = str.lookupSignal(RMS9_EPR))) { epr= EventDataType(sig->data[rec]) * sig->gain + sig->offset; @@ -412,17 +413,20 @@ void ResmedLoader::ParseSTR(Machine *mach, QStringList strfiles) } if ((sig = str.lookupLabel("S.EPR.EPRType"))) { + a10 = true; epr = EventDataType(sig->data[rec]) * sig->gain + sig->offset; epr += 1; } int epr_on=0, clin_epr_on=0; if ((sig = str.lookupLabel("S.EPR.EPREnable"))) { // first check machines opinion + a10 = true; epr_on = EventDataType(sig->data[rec]) * sig->gain + sig->offset; } if (epr_on && (sig = str.lookupLabel("S.EPR.ClinEnable"))) { + a10 = true; clin_epr_on = EventDataType(sig->data[rec]) * sig->gain + sig->offset; } - if (!(epr_on && clin_epr_on)) { + if (a10 && !(epr_on && clin_epr_on)) { epr = 0; epr_level = 0; }