From 5b631e2c83240de81d72f7fc85efa77eda6cbd43 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Thu, 30 Jun 2011 07:23:00 +1000 Subject: [PATCH] ResMed overlapping 1 second out session fix --- Graphs/graphdata_custom.cpp | 4 ++-- SleepLib/loader_plugins/resmed_loader.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Graphs/graphdata_custom.cpp b/Graphs/graphdata_custom.cpp index 670df47f..52e115a4 100644 --- a/Graphs/graphdata_custom.cpp +++ b/Graphs/graphdata_custom.cpp @@ -222,10 +222,10 @@ void TAPData::Reload(Day *day) } else { double d=last.msecsTo(ev.time())/1000.0; - //assert(lastvalmax_slots) { int i=0; - throw BoundsError(); + // throw BoundsError(); } pTime[lastval]+=d; } diff --git a/SleepLib/loader_plugins/resmed_loader.cpp b/SleepLib/loader_plugins/resmed_loader.cpp index 206f851c..f4ae5df2 100644 --- a/SleepLib/loader_plugins/resmed_loader.cpp +++ b/SleepLib/loader_plugins/resmed_loader.cpp @@ -241,6 +241,11 @@ bool ResmedLoader::Open(QString & path,Profile *profile) datestr=filename.section("_",0,1); date=QDateTime::fromString(datestr,"yyyyMMdd_HHmmss"); sessionid=date.toTime_t(); + // Resmed bugs up on the session filenames.. 1 second either way + if (sessfiles.find(sessionid)==sessfiles.end()) { + if (sessfiles.find(sessionid+1)!=sessfiles.end()) sessionid++; + if (sessfiles.find(sessionid-1)!=sessfiles.end()) sessionid--; + } sessfiles[sessionid].push_back(fi.canonicalFilePath()); }