diff --git a/sleepyhead/Resources.qrc b/sleepyhead/Resources.qrc index 5eb0d2f4..145044e7 100644 --- a/sleepyhead/Resources.qrc +++ b/sleepyhead/Resources.qrc @@ -26,8 +26,6 @@ icons/smileyface.png icons/sadface.png icons/mask.png - icons/brick.png - icons/nodata.png icons/cubeoximeter.png icons/trophy.png icons/bookmark.png @@ -37,10 +35,7 @@ icons/session-on.png icons/bob-v3.0.png docs/script.js - icons/nographs.png - icons/sheep.png docs/sheep.png - icons/Bob Strikes Back.png icons/Jedimark.png COPYING icons/sdcard-lock.png diff --git a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp index bcc49a1b..779211c3 100644 --- a/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/resmed_loader.cpp @@ -520,8 +520,7 @@ bool EDFParser::Parse() serialnumber += recordingident[i]; } - QDateTime startDate = QDateTime::fromString(QString::fromLatin1(header.datetime, 16), - "dd.MM.yyHH.mm.ss"); + QDateTime startDate = QDateTime::fromString(QString::fromLatin1(header.datetime, 16), "dd.MM.yyHH.mm.ss"); //startDate.toTimeSpec(Qt::UTC); QDate d2 = startDate.date(); @@ -930,7 +929,7 @@ void ResmedImport::run() ResmedLoader::ResmedLoader() { const QString RMS9_ICON = ":/icons/rms9.png"; - const QString RM10_ICON = ":/icons/sheep.png"; + const QString RM10_ICON = ":/icons/rms9.png"; m_pixmaps[STR_ResMed_S9] = QPixmap(RMS9_ICON); m_pixmaps[STR_ResMed_AirSense10] = QPixmap(RM10_ICON); diff --git a/sleepyhead/SleepLib/machine.cpp b/sleepyhead/SleepLib/machine.cpp index b1316723..270f5d69 100644 --- a/sleepyhead/SleepLib/machine.cpp +++ b/sleepyhead/SleepLib/machine.cpp @@ -76,7 +76,7 @@ Session *Machine::SessionExists(SessionID session) } } -const quint16 sessinfo_version = 1; +const quint16 sessinfo_version = 2; bool Machine::saveSessionInfo() { @@ -98,8 +98,6 @@ bool Machine::saveSessionInfo() out << filetype_sessenabled; out << sessinfo_version; - out << m_availableChannels; - QHash::iterator s; out << (int)sessionlist.size(); @@ -148,8 +146,10 @@ bool Machine::loadSessionInfo() in >> ft16; in >> version; - if (version >= 1) { - in >> m_availableChannels; + if (version == 1) { + // was available channels + QHash crap; + in >> crap; } int size; @@ -161,10 +161,6 @@ bool Machine::loadSessionInfo() for (int i=0; i< size; ++i) { in >> sid; in >> b; -// QList avail_channels; -// if (version >= 2) { -// in >> avail_channels; -// } s = sessionlist.find(sid); @@ -172,9 +168,6 @@ bool Machine::loadSessionInfo() Session * sess = s.value(); sess->setEnabled(b); -// if (version >= 2) { -// sess->m_availableChannels = avail_channels; -// } } } return true; @@ -217,6 +210,11 @@ bool Machine::AddSession(Session *s) Q_ASSERT(p_profile); Q_ASSERT(p_profile->isOpen()); + if (s->type() == MT_OXIMETER) { + int i=5; + } + updateChannels(s); + if (p_profile->session->ignoreOlderSessions()) { qint64 ignorebefore = p_profile->session->ignoreOlderSessionsDate().toMSecsSinceEpoch(); if (s->last() < ignorebefore) { @@ -1114,6 +1112,12 @@ void Machine::updateChannels(Session * sess) ChannelID code = sess->m_availableChannels.at(i); m_availableChannels[code] = true; } + + size = sess->m_availableSettings.size(); + for (int i=0; i < size; ++i) { + ChannelID code = sess->m_availableSettings.at(i); + m_availableSettings[code] = true; + } } QList Machine::availableChannels(quint32 chantype) diff --git a/sleepyhead/SleepLib/machine.h b/sleepyhead/SleepLib/machine.h index 4389e3e8..da99d558 100644 --- a/sleepyhead/SleepLib/machine.h +++ b/sleepyhead/SleepLib/machine.h @@ -109,6 +109,10 @@ class Machine return m_availableChannels.contains(code); } + inline bool hasSetting(ChannelID code) { + return m_availableSettings.contains(code); + } + //! \brief Contains a secondary index of day data, containing just this machines sessions QMap day; @@ -253,6 +257,7 @@ class Machine QList m_tasklist; QHash m_availableChannels; + QHash m_availableSettings; QString m_summaryPath; QString m_eventsPath; diff --git a/sleepyhead/SleepLib/profiles.h b/sleepyhead/SleepLib/profiles.h index 29fae44c..618cfb3f 100644 --- a/sleepyhead/SleepLib/profiles.h +++ b/sleepyhead/SleepLib/profiles.h @@ -696,17 +696,17 @@ class AppearanceSettings : public ProfileSettings : ProfileSettings(profile) { initPref(STR_AS_GraphHeight, 180.0); - initPref(STR_AS_AntiAliasing, false); // I think it's ugly. + initPref(STR_AS_AntiAliasing, true); initPref(STR_AS_GraphSnapshots, true); initPref(STR_AS_Animations, true); initPref(STR_AS_SquareWave, false); initPref(STR_AS_AllowYAxisScaling, true); initPref(STR_AS_GraphTooltips, true); - initPref(STR_AS_UsePixmapCaching, true); + initPref(STR_AS_UsePixmapCaching, false); initPref(STR_AS_OverlayType, ODT_Bars); initPref(STR_AS_OverviewLinechartMode, OLC_Bartop); initPref(STR_AS_LineThickness, 1.0); - initPref(STR_AS_LineCursorMode, false); + initPref(STR_AS_LineCursorMode, true); initPref(STR_AS_CalendarVisible, true); initPref(STR_AS_RightSidebarVisible, true); } diff --git a/sleepyhead/icons/Bob Strikes Back.png b/sleepyhead/icons/Bob Strikes Back.png deleted file mode 100644 index accec98b..00000000 Binary files a/sleepyhead/icons/Bob Strikes Back.png and /dev/null differ diff --git a/sleepyhead/icons/brick.png b/sleepyhead/icons/brick.png deleted file mode 100644 index d5513610..00000000 Binary files a/sleepyhead/icons/brick.png and /dev/null differ diff --git a/sleepyhead/icons/nodata.png b/sleepyhead/icons/nodata.png deleted file mode 100644 index 43b5b4c5..00000000 Binary files a/sleepyhead/icons/nodata.png and /dev/null differ diff --git a/sleepyhead/icons/nographs.png b/sleepyhead/icons/nographs.png deleted file mode 100644 index f9ae898b..00000000 Binary files a/sleepyhead/icons/nographs.png and /dev/null differ diff --git a/sleepyhead/icons/sheep.png b/sleepyhead/icons/sheep.png deleted file mode 100644 index 8e911ef1..00000000 Binary files a/sleepyhead/icons/sheep.png and /dev/null differ diff --git a/sleepyhead/statistics.cpp b/sleepyhead/statistics.cpp index 1259b308..32b182de 100644 --- a/sleepyhead/statistics.cpp +++ b/sleepyhead/statistics.cpp @@ -641,11 +641,11 @@ struct RXChange { short highlight; }; -enum RXSortMode { RX_first, RX_last, RX_days, RX_ahi, RX_mode, RX_min, RX_max, RX_ps, RX_pshi, RX_maxipap, RX_per1, RX_per2, RX_weighted }; -RXSortMode RXsort = RX_first; -bool RXorder = false; +//enum RXSortMode { RX_first, RX_last, RX_days, RX_ahi, RX_mode, RX_min, RX_max, RX_ps, RX_pshi, RX_maxipap, RX_per1, RX_per2, RX_weighted }; +//RXSortMode RXsort = RX_first; +//bool RXorder = false; -bool operator<(const RXChange &c1, const RXChange &c2) +/*bool operator<(const RXChange &c1, const RXChange &c2) { const RXChange *comp1 = &c1; const RXChange *comp2 = &c2; @@ -824,7 +824,7 @@ bool RXSort(const RXChange *comp1, const RXChange *comp2) } return true; -} +} */ struct UsageData { UsageData() { ahi = 0; hours = 0; } UsageData(QDate d, EventDataType v, EventDataType h) { date = d; ahi = v; hours = h; } @@ -865,7 +865,7 @@ struct Period { const QString heading_color="#ffffff"; const QString subheading_color="#e0e0e0"; -const int rxthresh = 5; +//const int rxthresh = 5; QString Statistics::GenerateMachineList() { @@ -1066,11 +1066,11 @@ QString Statistics::GenerateHTML() } - int cpapdays = p_profile->countDays(MT_CPAP, firstcpap, lastcpap); + // int cpapdays = p_profile->countDays(MT_CPAP, firstcpap, lastcpap); // CPAPMode cpapmode = (CPAPMode)(int)p_profile->calcSettingsMax(CPAP_Mode, MT_CPAP, firstcpap, lastcpap); - float percentile = p_profile->general->prefCalcPercentile() / 100.0; + // float percentile = p_profile->general->prefCalcPercentile() / 100.0; // int mididx=p_profile->general->prefCalcMiddle(); // SummaryType ST_mid; @@ -1086,7 +1086,7 @@ QString Statistics::GenerateHTML() ahitxt = STR_TR_AHI; } - int decimals = 2; + // int decimals = 2; html += "
"; html += QString("");