From c1a99850c6302d37dde86c68b4d57f5d8c9cf755 Mon Sep 17 00:00:00 2001 From: Guy Scharf Date: Thu, 8 Jul 2021 10:35:44 -0700 Subject: [PATCH] EDFParser - add option to handle EDF files with UTC timestamps Needed for SleepStyle CPAP as dates in the data files are UTC and not local --- oscar/SleepLib/loader_plugins/edfparser.cpp | 6 ++++++ oscar/SleepLib/loader_plugins/edfparser.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/oscar/SleepLib/loader_plugins/edfparser.cpp b/oscar/SleepLib/loader_plugins/edfparser.cpp index f9944568..e1c64926 100644 --- a/oscar/SleepLib/loader_plugins/edfparser.cpp +++ b/oscar/SleepLib/loader_plugins/edfparser.cpp @@ -58,6 +58,12 @@ EDFInfo::~EDFInfo() // delete a; } +// Set timezone to UTC +void EDFInfo::setTimeZoneUTC () { + TZ_offset = 0; + EDFInfo::localNoDST = QTimeZone(TZ_offset); +} + bool EDFInfo::Open(const QString & name) { if (hdrPtr != nullptr) { diff --git a/oscar/SleepLib/loader_plugins/edfparser.h b/oscar/SleepLib/loader_plugins/edfparser.h index 1fc5eaf3..c84c49fe 100644 --- a/oscar/SleepLib/loader_plugins/edfparser.h +++ b/oscar/SleepLib/loader_plugins/edfparser.h @@ -142,6 +142,9 @@ class EDFInfo static QDateTime getStartDT(const QString str); //! \brief Returns the start time using noLocalDST + static void setTimeZoneUTC(); //! \brief Sets noLocalDST to UTC (for EDF files using UTC time) + + // The data members follow static int TZ_offset;