mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 02:30:44 +00:00
Resmed Session splitting improvements and preference
This commit is contained in:
parent
ade1b5e906
commit
8617b1634c
@ -39,7 +39,7 @@ Q_OBJECT
|
||||
virtual const QString &loaderName() { return cms50_class_name; }
|
||||
|
||||
virtual MachineInfo newInfo() {
|
||||
return MachineInfo(MT_OXIMETER, cms50_class_name, QObject::tr("Contec"), QString(), QString(), QString(), QObject::tr("CMS50"), QDateTime::currentDateTime(), cms50_data_version);
|
||||
return MachineInfo(MT_OXIMETER, cms50_class_name, QObject::tr("Contec"), QObject::tr("CMS50"), QString(), QString(), QObject::tr("CMS50"), QDateTime::currentDateTime(), cms50_data_version);
|
||||
}
|
||||
|
||||
|
||||
|
@ -293,6 +293,8 @@ int FPIconLoader::OpenMachine(Machine *mach, QString &path)
|
||||
int c = Sessions.size();
|
||||
mach->Save();
|
||||
|
||||
finishAddingSessions();
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -595,7 +597,7 @@ bool FPIconLoader::OpenFLW(Machine *mach, QString filename)
|
||||
}
|
||||
|
||||
if (newsess) {
|
||||
mach->AddSession(sess);
|
||||
addSession(sess);
|
||||
}
|
||||
|
||||
if (p_profile->session->backupCardData()) {
|
||||
@ -748,7 +750,7 @@ bool FPIconLoader::OpenSummary(Machine *mach, QString filename)
|
||||
sess->settings[CPAP_HumidSetting] = x2;
|
||||
//sess->settings[CPAP_PresReliefType]=PR_SENSAWAKE;
|
||||
Sessions[ts] = sess;
|
||||
mach->AddSession(sess);
|
||||
addSession(sess);
|
||||
}
|
||||
} while (!in.atEnd());
|
||||
|
||||
@ -913,7 +915,7 @@ bool FPIconLoader::OpenDetail(Machine *mach, QString filename)
|
||||
|
||||
// sess->really_set_last(ti-360000L);
|
||||
// sess->SetChanged(true);
|
||||
// mach->AddSession(sess,profile);
|
||||
// addSession(sess,profile);
|
||||
}
|
||||
if (p_profile->session->backupCardData()) {
|
||||
unsigned char *data = (unsigned char *)index.data();
|
||||
|
@ -518,7 +518,7 @@ int IntellipapLoader::Open(QString path)
|
||||
quint64 last = qint64(SessionEnd[i]) * 1000L;
|
||||
|
||||
if (sess->last() > 0) {
|
||||
sess->really_set_last(last);
|
||||
// sess->really_set_last(last);
|
||||
|
||||
|
||||
sess->settings[CPAP_PresReliefType] = (PRTypes)PR_SMARTFLEX;
|
||||
|
@ -282,6 +282,9 @@ bool PRS1Loader::ParseProperties(Machine *m, QString filename)
|
||||
QChar sep = '=';
|
||||
QString key, value;
|
||||
|
||||
MachineInfo info = newInfo();
|
||||
bool ok;
|
||||
|
||||
while (!f.atEnd()) {
|
||||
key = s.section(sep, 0, 0);
|
||||
|
||||
@ -291,23 +294,29 @@ bool PRS1Loader::ParseProperties(Machine *m, QString filename)
|
||||
|
||||
if (value == s) { continue; }
|
||||
|
||||
prop[key] = value;
|
||||
if (key.toLower() == "serialnumber") {
|
||||
info.serial = value;
|
||||
} else if (key.toLower() == "modelnumber") {
|
||||
info.modelnumber = value;
|
||||
} else {
|
||||
if (key.toLower() == "producttype") {
|
||||
int i = value.toInt(&ok, 16);
|
||||
|
||||
if (ok) {
|
||||
if (ModelMap.find(i) != ModelMap.end()) {
|
||||
info.model = ModelMap[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
prop[key] = value;
|
||||
}
|
||||
s = f.readLine();
|
||||
}
|
||||
|
||||
bool ok;
|
||||
QString pt = prop["ProductType"];
|
||||
int i = pt.toInt(&ok, 16);
|
||||
|
||||
if (ok) {
|
||||
if (ModelMap.find(i) != ModelMap.end()) {
|
||||
m->setModel(ModelMap[i]);
|
||||
}
|
||||
if (info.serial != m->serial()) {
|
||||
qDebug() << "Serial Number in PRS1 properties.txt doesn't match machine record";
|
||||
}
|
||||
|
||||
if (prop["SerialNumber"] != m->serial()) {
|
||||
qDebug() << "Serial Number in PRS1 properties.txt doesn't match directory structure";
|
||||
} else { prop.erase(prop.find("SerialNumber")); } // already got it stored.
|
||||
m->setInfo(info);
|
||||
|
||||
for (QHash<QString, QString>::iterator i = prop.begin(); i != prop.end(); i++) {
|
||||
m->properties[i.key()] = i.value();
|
||||
@ -466,6 +475,7 @@ int PRS1Loader::OpenMachine(Machine *m, QString path)
|
||||
|
||||
int tasks = countTasks();
|
||||
runTasks(p_profile->session->multithreading());
|
||||
finishAddingSessions();
|
||||
return tasks;
|
||||
}
|
||||
|
||||
@ -1423,9 +1433,7 @@ void PRS1Import::run()
|
||||
}
|
||||
sg->session->SetChanged(true);
|
||||
|
||||
loader->sessionMutex.lock();
|
||||
mach->AddSession(sg->session);
|
||||
loader->sessionMutex.unlock();
|
||||
loader->addSession(sg->session);
|
||||
|
||||
// Update indexes, process waveform and perform flagging
|
||||
sg->session->UpdateSummaries();
|
||||
|
@ -731,14 +731,7 @@ void ResmedImport::run()
|
||||
// Ignore all the rest of the sumary data, because there is enough available to calculate it with higher accuracy.
|
||||
|
||||
if (sess->length() > 0) {
|
||||
loader->saveMutex.lock();
|
||||
|
||||
if (!mach->AddSession(sess)) {
|
||||
delete sess;
|
||||
loader->saveMutex.unlock();
|
||||
return;
|
||||
}
|
||||
loader->saveMutex.unlock();
|
||||
loader->addSession(sess);
|
||||
} else {
|
||||
delete sess;
|
||||
return;
|
||||
@ -862,8 +855,8 @@ void ResmedImportStage2::run()
|
||||
}
|
||||
}
|
||||
|
||||
loader->addSession(sess);
|
||||
loader->saveMutex.lock();
|
||||
mach->AddSession(sess);
|
||||
sess->Store(mach->getDataPath());
|
||||
loader->saveMutex.unlock();
|
||||
}
|
||||
@ -922,8 +915,8 @@ MachineInfo ResmedLoader::PeekInfo(const QString & path)
|
||||
|
||||
} else if (key == "PNA") { // Product Name
|
||||
value.replace("_"," ");
|
||||
value.replace("S9 ", "");
|
||||
info.model = value;
|
||||
|
||||
} else if (key == "PCD") { // Product Code
|
||||
info.modelnumber = value;
|
||||
}
|
||||
@ -1340,8 +1333,16 @@ int ResmedLoader::Open(QString path)
|
||||
continue;
|
||||
|
||||
} else if (key == "PNA") { // Product Name
|
||||
value.replace("S9", "");
|
||||
value.replace("_"," ");
|
||||
info.model = value;
|
||||
value.replace("(","");
|
||||
value.replace(")","");
|
||||
if (value.contains("Adapt", Qt::CaseInsensitive)) {
|
||||
if (!value.contains("VPAP")) {
|
||||
value.replace("Adapt", QObject::tr("VPAP Adapt"));
|
||||
}
|
||||
}
|
||||
info.model = value.trimmed();
|
||||
continue;
|
||||
|
||||
} else if (key == "PCD") { // Product Code
|
||||
@ -1511,13 +1512,6 @@ int ResmedLoader::Open(QString path)
|
||||
// Scan DATALOG files, sort, and import any new sessions
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef LOCK_RESMED_SESSIONS
|
||||
// Have to sacrifice these features to get access to summary data.
|
||||
p_profile->session->setCombineCloseSessions(0);
|
||||
p_profile->session->setDaySplitTime(QTime(12,0,0));
|
||||
p_profile->session->setIgnoreShortSessions(false);
|
||||
#endif
|
||||
|
||||
int new_sessions = scanFiles(m, newpath);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -1578,6 +1572,8 @@ int ResmedLoader::Open(QString path)
|
||||
new_sessions += countTasks();
|
||||
runTasks();
|
||||
|
||||
finishAddingSessions();
|
||||
|
||||
#ifdef DEBUG_EFFICIENCY
|
||||
{
|
||||
qint64 totalbytes = 0;
|
||||
|
@ -116,11 +116,19 @@ bool Machine::AddSession(Session *s)
|
||||
highest_sessionid = s->session();
|
||||
}
|
||||
|
||||
QTime split_time = p_profile->session->daySplitTime();
|
||||
int combine_sessions = p_profile->session->combineCloseSessions();
|
||||
int ignore_sessions = p_profile->session->ignoreShortSessions();
|
||||
QTime split_time;
|
||||
int combine_sessions;
|
||||
bool locksessions = p_profile->session->lockSummarySessions();
|
||||
|
||||
// ResMed machines can't do this.. but don't really want to do a slow string compare here
|
||||
if (locksessions) {
|
||||
split_time = s->summaryOnly() ? QTime(12,0,0) : p_profile->session->daySplitTime();
|
||||
combine_sessions = s->summaryOnly() ? 0 : p_profile->session->combineCloseSessions();
|
||||
} else {
|
||||
split_time = p_profile->session->daySplitTime();
|
||||
combine_sessions = p_profile->session->combineCloseSessions();
|
||||
}
|
||||
|
||||
int ignore_sessions = p_profile->session->ignoreShortSessions();
|
||||
|
||||
int session_length = s->last() - s->first();
|
||||
session_length /= 60000;
|
||||
@ -139,6 +147,9 @@ bool Machine::AddSession(Session *s)
|
||||
bool combine_next_day = false;
|
||||
int closest_session = 0;
|
||||
|
||||
|
||||
// Multithreaded import screws this up. :(
|
||||
|
||||
if (time < split_time) {
|
||||
date = date.addDays(-1);
|
||||
} else if (combine_sessions > 0) {
|
||||
@ -150,6 +161,12 @@ bool Machine::AddSession(Session *s)
|
||||
|
||||
if (closest_session < combine_sessions) {
|
||||
date = date.addDays(-1);
|
||||
} else {
|
||||
if ((split_time < time) && (split_time.secsTo(time) < 2)) {
|
||||
if (s->machine()->loaderName() == STR_MACH_ResMed) {
|
||||
date = date.addDays(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
nextday = day.find(date.addDays(1)); // Check Day Afterwards
|
||||
@ -200,6 +217,7 @@ bool Machine::AddSession(Session *s)
|
||||
if (combine_next_day) {
|
||||
for (QList<Session *>::iterator i = nextday.value()->begin(); i != nextday.value()->end(); i++) {
|
||||
// i may need to do something here
|
||||
if (locksessions && (*i)->summaryOnly()) continue; // can't move summary only sessions..
|
||||
unlinkSession(*i);
|
||||
// Add it back
|
||||
|
||||
|
@ -127,6 +127,20 @@ MachineLoader::~MachineLoader()
|
||||
}
|
||||
}
|
||||
|
||||
void MachineLoader::finishAddingSessions()
|
||||
{
|
||||
QMap<SessionID, Session *>::iterator it;
|
||||
QMap<SessionID, Session *>::iterator it_end = new_sessions.end();
|
||||
|
||||
// Using a map specifically so they are inserted in order.
|
||||
for (it = new_sessions.begin(); it != it_end; ++it) {
|
||||
Session * sess = it.value();
|
||||
Machine * mach = sess->machine();
|
||||
mach->AddSession(sess);
|
||||
}
|
||||
new_sessions.clear();
|
||||
}
|
||||
|
||||
bool compressFile(QString inpath, QString outpath)
|
||||
{
|
||||
if (outpath.isEmpty()) {
|
||||
|
@ -70,6 +70,14 @@ class MachineLoader: public QObject
|
||||
|
||||
void queTask(ImportTask * task);
|
||||
|
||||
void addSession(Session * sess)
|
||||
{
|
||||
sessionMutex.lock();
|
||||
new_sessions[sess->session()] = sess;
|
||||
sessionMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
//! \brief Process Task list using all available threads.
|
||||
void runTasks(bool threaded=true);
|
||||
|
||||
@ -114,9 +122,12 @@ signals:
|
||||
|
||||
DeviceStatus m_status;
|
||||
|
||||
void finishAddingSessions();
|
||||
QMap<SessionID, Session *> new_sessions;
|
||||
|
||||
private:
|
||||
QList<ImportTask *> m_tasklist;
|
||||
|
||||
};
|
||||
|
||||
struct ImportPath
|
||||
|
@ -299,6 +299,7 @@ const QString STR_IS_CompressBackupData = "CompressBackupData";
|
||||
const QString STR_IS_CompressSessionData = "CompressSessionData";
|
||||
const QString STR_IS_IgnoreOlderSessions = "IgnoreOlderSessions";
|
||||
const QString STR_IS_IgnoreOlderSessionsDate = "IgnoreOlderSessionsDate";
|
||||
const QString STR_IS_LockSummarySessions = "LockSummarySessions";
|
||||
|
||||
// AppearanceSettings Strings
|
||||
const QString STR_AS_GraphHeight = "GraphHeight";
|
||||
@ -621,6 +622,8 @@ class SessionSettings : public ProfileSettings
|
||||
initPref(STR_IS_CompressSessionData, false);
|
||||
initPref(STR_IS_IgnoreOlderSessions, false);
|
||||
initPref(STR_IS_IgnoreOlderSessionsDate, QDateTime(QDate::currentDate().addYears(-1), daySplitTime()) );
|
||||
initPref(STR_IS_LockSummarySessions, true);
|
||||
|
||||
}
|
||||
|
||||
QTime daySplitTime() const { return getPref(STR_IS_DaySplitTime).toTime(); }
|
||||
@ -633,6 +636,7 @@ class SessionSettings : public ProfileSettings
|
||||
bool backupCardData() const { return getPref(STR_IS_BackupCardData).toBool(); }
|
||||
bool ignoreOlderSessions() const { return getPref(STR_IS_IgnoreOlderSessions).toBool(); }
|
||||
QDateTime ignoreOlderSessionsDate() const { return getPref(STR_IS_IgnoreOlderSessionsDate).toDateTime(); }
|
||||
bool lockSummarySessions() const { return getPref(STR_IS_LockSummarySessions).toBool(); }
|
||||
|
||||
void setDaySplitTime(QTime time) { setPref(STR_IS_DaySplitTime, time); }
|
||||
void setCacheSessions(bool c) { setPref(STR_IS_CacheSessions, c); }
|
||||
@ -644,6 +648,8 @@ class SessionSettings : public ProfileSettings
|
||||
void setCompressSessionData(bool enabled) { setPref(STR_IS_CompressSessionData, enabled); }
|
||||
void setIgnoreOlderSessions(bool enabled) { setPref(STR_IS_IgnoreOlderSessions, enabled); }
|
||||
void setIgnoreOlderSessionsDate(QDate date) { setPref(STR_IS_IgnoreOlderSessionsDate, QDateTime(date, daySplitTime())); }
|
||||
void setLockSummarySessions(bool b) { setPref(STR_IS_LockSummarySessions, b); }
|
||||
|
||||
};
|
||||
|
||||
/*! \class AppearanceSettings
|
||||
|
@ -1004,7 +1004,7 @@ QString Daily::getOximeterInformation(Day * oxi)
|
||||
html="<table cellpadding=0 cellspacing=0 border=0 width=100%>";
|
||||
html+=QString("<tr><td colspan=5 align=center><b>%1</b></td></tr>\n").arg(tr("Oximeter Information"));
|
||||
html+="<tr><td colspan=5 align=center> </td></tr>";
|
||||
html+="<tr><td colspan=5 align=center>"+oxi->machine->brand()+" "+oxi->machine->model()+"</td></tr>\n";
|
||||
html+="<tr><td colspan=5 align=center>"+oxi->machine->brand()+" "+oxi->machine->series()+"</td></tr>\n";
|
||||
html+="<tr><td colspan=5 align=center> </td></tr>";
|
||||
html+=QString("<tr><td colspan=5 align=center>%1: %2 (%3%)</td></tr>").arg(tr("SpO2 Desaturations")).arg(oxi->count(OXI_SPO2Drop)).arg((100.0/oxi->hours()) * (oxi->sum(OXI_SPO2Drop)/3600.0),0,'f',2);
|
||||
html+=QString("<tr><td colspan=5 align=center>%1: %2 (%3%)</td></tr>").arg(tr("Pulse Change events")).arg(oxi->count(OXI_PulseChange)).arg((100.0/oxi->hours()) * (oxi->sum(OXI_PulseChange)/3600.0),0,'f',2);
|
||||
@ -1025,7 +1025,7 @@ QString Daily::getCPAPInformation(Day * cpap)
|
||||
|
||||
html="<table cellspacing=0 cellpadding=0 border=0 width='100%'>\n";
|
||||
|
||||
html+="<tr><td align=center><a class=info2 href='#'>"+info.model+"<span>";
|
||||
html+="<tr><td align=center><a class=info2 href='#'>"+info.series+" "+info.model+"<span>";
|
||||
QString tooltip=(info.brand+"\n"+info.series+" "+info.modelnumber+"\n"+info.serial);
|
||||
tooltip=tooltip.replace(" "," ");
|
||||
|
||||
@ -1166,23 +1166,23 @@ QString Daily::getStatisticsInfo(Day * cpap,Day * oxi,Day *pos)
|
||||
}
|
||||
|
||||
if (cpap) {
|
||||
int l = cpap->sum(CPAP_Ramp) - (15*60);
|
||||
int l = cpap->sum(CPAP_Ramp);
|
||||
|
||||
if (l > 0) {
|
||||
html+="<tr><td colspan=3 align='left' bgcolor='white'><b>"+tr("Total ramp time")+
|
||||
QString("</b></td><td colspan=2 bgcolor='white'>%1:%2:%3</td></tr>").arg(l / 3600, 2, 10, QChar('0')).arg((l / 60) % 60, 2, 10, QChar('0')).arg(l % 60, 2, 10, QChar('0'));
|
||||
html+="<tr><td colspan=3 align='left' bgcolor='white'>"+tr("Total ramp time")+
|
||||
QString("</td><td colspan=2 bgcolor='white'>%1:%2:%3</td></tr>").arg(l / 3600, 2, 10, QChar('0')).arg((l / 60) % 60, 2, 10, QChar('0')).arg(l % 60, 2, 10, QChar('0'));
|
||||
float v = (cpap->hours() - (float(l) / 3600.0));
|
||||
int q = v * 3600.0;
|
||||
html+="<tr><td colspan=3 align='left' bgcolor='white'><b>"+tr("Time outside of ramp")+
|
||||
QString("</b></td><td colspan=2 bgcolor='white'>%1:%2:%3</td></tr>").arg(q / 3600, 2, 10, QChar('0')).arg((q / 60) % 60, 2, 10, QChar('0')).arg(q % 60, 2, 10, QChar('0'));
|
||||
html+="<tr><td colspan=3 align='left' bgcolor='white'>"+tr("Time outside of ramp")+
|
||||
QString("</td><td colspan=2 bgcolor='white'>%1:%2:%3</td></tr>").arg(q / 3600, 2, 10, QChar('0')).arg((q / 60) % 60, 2, 10, QChar('0')).arg(q % 60, 2, 10, QChar('0'));
|
||||
|
||||
EventDataType hc = cpap->count(CPAP_Hypopnea) - cpap->countInsideSpan(CPAP_Ramp, CPAP_Hypopnea);
|
||||
EventDataType oc = cpap->count(CPAP_Obstructive) - cpap->countInsideSpan(CPAP_Ramp, CPAP_Obstructive);
|
||||
|
||||
EventDataType tc = cpap->count(CPAP_Hypopnea) + cpap->count(CPAP_Obstructive);
|
||||
EventDataType ahi = (hc+oc) / (float(l)/3600.0);
|
||||
html+="<tr><td colspan=3 align='left' bgcolor='white'><b>"+tr("AHI excluding ramp")+
|
||||
QString("</b></td><td colspan=2 bgcolor='white'>%1</td></tr>").arg(ahi, 0, 'f', 2);
|
||||
EventDataType ahi = (hc+oc) / v;
|
||||
html+="<tr><td colspan=3 align='left' bgcolor='white'>"+tr("AHI excluding ramp")+
|
||||
QString("</td><td colspan=2 bgcolor='white'>%1</td></tr>").arg(ahi, 0, 'f', 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@
|
||||
<br/>
|
||||
<b>New features & bug fixes in v0.9.7</b><br/>
|
||||
<list>
|
||||
<li>Fixed inverted CMS50 .spoR file pulse and spo2</l>
|
||||
<li>Added CMS50i .spo2 file import support</li>
|
||||
<li>New Feature: Added a Welcome page to make things a little friendlier</li>
|
||||
<li>Fixes another issue that caused session dupplicates on ResMed machines</li>
|
||||
<li>Improved support for Intellipap BiLevel machines</li>
|
||||
@ -17,8 +19,7 @@
|
||||
<li>New Feature: Preference option to Realign machine detected codes and fix dodgy PRS1 durations using user event flagging.</li>
|
||||
<li>New Feature: Added second set of User Flags detection and preferences.</li>
|
||||
<li>New Feature: Hit Escape key to go back through previous graph selection history</li>
|
||||
<li>New Feature: Holding Alt shows a vertical line, and the current time position when hovering over LineCharts</li>
|
||||
<li>New Feature: Hold Alt while selecting a graph area to allow you to take another attempt</li>
|
||||
<li>New Feature: Hold Alt while selecting a graph area with the mouse, pauses till you release the key, to allow you to take another attempt.</li>
|
||||
<li>Fixed changing languages clobbering graph settings</li>
|
||||
<li>Import now remembers last place you imported from</li>
|
||||
<li>Lock files are now used to help protect the same profiles being open multiple times</li>
|
||||
|
@ -169,21 +169,21 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LOCK_RESMED_SESSIONS
|
||||
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||
for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
|
||||
QString mclass=(*it)->loaderName();
|
||||
if (mclass == STR_MACH_ResMed) {
|
||||
qDebug() << "ResMed machine found.. locking Session splitting capabilities";
|
||||
//#ifdef LOCK_RESMED_SESSIONS
|
||||
// QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||
// for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
|
||||
// QString mclass=(*it)->loaderName();
|
||||
// if (mclass == STR_MACH_ResMed) {
|
||||
// qDebug() << "ResMed machine found.. locking Session splitting capabilities";
|
||||
|
||||
// Have to sacrifice these features to get access to summary data.
|
||||
p_profile->session->setCombineCloseSessions(0);
|
||||
p_profile->session->setDaySplitTime(QTime(12,0,0));
|
||||
p_profile->session->setIgnoreShortSessions(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// // Have to sacrifice these features to get access to summary data.
|
||||
// p_profile->session->setCombineCloseSessions(0);
|
||||
// p_profile->session->setDaySplitTime(QTime(12,0,0));
|
||||
// p_profile->session->setIgnoreShortSessions(false);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//#endif
|
||||
|
||||
ui->actionToggle_Line_Cursor->setChecked(p_profile->appearance->lineCursorMode());
|
||||
|
||||
|
@ -71,18 +71,18 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
|
||||
}*/
|
||||
}
|
||||
|
||||
#ifdef LOCK_RESMED_SESSIONS
|
||||
QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||
for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
|
||||
const QString & mclass=(*it)->loaderName();
|
||||
if (mclass == STR_MACH_ResMed) {
|
||||
ui->combineSlider->setEnabled(false);
|
||||
ui->IgnoreSlider->setEnabled(false);
|
||||
ui->timeEdit->setEnabled(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
//#ifdef LOCK_RESMED_SESSIONS
|
||||
// QList<Machine *> machines = p_profile->GetMachines(MT_CPAP);
|
||||
// for (QList<Machine *>::iterator it = machines.begin(); it != machines.end(); ++it) {
|
||||
// const QString & mclass=(*it)->loaderName();
|
||||
// if (mclass == STR_MACH_ResMed) {
|
||||
// ui->combineSlider->setEnabled(false);
|
||||
// ui->IgnoreSlider->setEnabled(false);
|
||||
// ui->timeEdit->setEnabled(false);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//#endif
|
||||
|
||||
QLocale locale = QLocale::system();
|
||||
QString shortformat = locale.dateFormat(QLocale::ShortFormat);
|
||||
@ -137,6 +137,8 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
|
||||
ui->IgnoreLCD->display(val);
|
||||
} else { ui->IgnoreLCD->display(STR_GEN_Off); }
|
||||
|
||||
ui->LockSummarySessionSplitting->setChecked(profile->session->lockSummarySessions());
|
||||
|
||||
ui->applicationFont->setCurrentFont(QApplication::font());
|
||||
//ui->applicationFont->setFont(QApplication::font());
|
||||
ui->applicationFontSize->setValue(QApplication::font().pointSize());
|
||||
@ -348,6 +350,10 @@ bool PreferencesDialog::Save()
|
||||
needs_restart = true;
|
||||
}
|
||||
|
||||
if (profile->session->lockSummarySessions() != ui->LockSummarySessionSplitting->isChecked()) {
|
||||
needs_restart = true;
|
||||
}
|
||||
|
||||
if (profile->cpap->userEventPieChart() != ui->showUserFlagsInPie->isChecked()) {
|
||||
// lazy.. fix me
|
||||
needs_restart = true;
|
||||
@ -403,6 +409,7 @@ bool PreferencesDialog::Save()
|
||||
}
|
||||
|
||||
profile->cpap->setUserEventPieChart(ui->showUserFlagsInPie->isChecked());
|
||||
profile->session->setLockSummarySessions(ui->LockSummarySessionSplitting->isChecked());
|
||||
|
||||
profile->appearance->setAllowYAxisScaling(ui->allowYAxisScaling->isChecked());
|
||||
profile->appearance->setGraphTooltips(ui->graphTooltips->isChecked());
|
||||
|
@ -368,6 +368,16 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="LockSummarySessionSplitting">
|
||||
<property name="toolTip">
|
||||
<string>Summary only data is more accurate for ResMed users if this is left on.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Lock Summary Session Splitting</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
Loading…
Reference in New Issue
Block a user