mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 18:50:44 +00:00
Disable CombineSessions, IgnoreShortSessions and force day split time to noon when ResMed data present
This has been done because it's the only way access to Summary data is possible This is in preperation for a little rework of the STR.edf parser
This commit is contained in:
parent
b530f27ca0
commit
66e7b48abd
@ -421,7 +421,8 @@ qint64 Day::total_time()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (total != d_totaltime) {
|
if (total != d_totaltime) {
|
||||||
qDebug() << "Sessions Times overlaps!" << total << d_totaltime;
|
// They can overlap.. tough.
|
||||||
|
// qDebug() << "Sessions Times overlaps!" << total << d_totaltime;
|
||||||
}
|
}
|
||||||
|
|
||||||
return total; //d_totaltime;
|
return total; //d_totaltime;
|
||||||
|
@ -1267,6 +1267,12 @@ int ResmedLoader::Open(QString &path, Profile *profile)
|
|||||||
|
|
||||||
QString backupfile, backfile, crcfile, yearstr, bkuppath;
|
QString backupfile, backfile, crcfile, yearstr, bkuppath;
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Scan through new file list and import sessions
|
// Scan through new file list and import sessions
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -118,6 +118,8 @@ QDate Machine::AddSession(Session *s, Profile *p)
|
|||||||
int combine_sessions = PROFILE.session->combineCloseSessions();
|
int combine_sessions = PROFILE.session->combineCloseSessions();
|
||||||
int ignore_sessions = PROFILE.session->ignoreShortSessions();
|
int ignore_sessions = PROFILE.session->ignoreShortSessions();
|
||||||
|
|
||||||
|
// ResMed machines can't do this.. but don't really want to do a slow string compare here
|
||||||
|
|
||||||
int session_length = s->last() - s->first();
|
int session_length = s->last() - s->first();
|
||||||
session_length /= 60000;
|
session_length /= 60000;
|
||||||
|
|
||||||
|
@ -114,6 +114,20 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
ui->action_Screenshot->setEnabled(false);
|
ui->action_Screenshot->setEnabled(false);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
auto machines = p_profile->GetMachines(MT_CPAP);
|
||||||
|
for (auto it = machines.begin(); it != machines.end(); ++it) {
|
||||||
|
QString mclass=(*it)->GetClass();
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
overview = nullptr;
|
overview = nullptr;
|
||||||
daily = nullptr;
|
daily = nullptr;
|
||||||
|
@ -70,6 +70,18 @@ PreferencesDialog::PreferencesDialog(QWidget *parent, Profile *_profile) :
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto machines = p_profile->GetMachines(MT_CPAP);
|
||||||
|
for (auto it = machines.begin(); it != machines.end(); ++it) {
|
||||||
|
QString mclass=(*it)->GetClass();
|
||||||
|
if (mclass == STR_MACH_ResMed) {
|
||||||
|
ui->combineSlider->setEnabled(false);
|
||||||
|
ui->IgnoreSlider->setEnabled(false);
|
||||||
|
ui->timeEdit->setEnabled(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QLocale locale = QLocale::system();
|
QLocale locale = QLocale::system();
|
||||||
QString shortformat = locale.dateFormat(QLocale::ShortFormat);
|
QString shortformat = locale.dateFormat(QLocale::ShortFormat);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user