mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Fix dodgy code assignment in ResMed code, Fix for automatic re-import after purge
This commit is contained in:
parent
1f4bf4c510
commit
59b6700a50
@ -2262,12 +2262,14 @@ bool ResmedLoader::LoadSAD(Session *sess, EDFParser &edf)
|
||||
}
|
||||
if (!hasdata) continue;
|
||||
|
||||
if (matchSignal(code = OXI_Pulse, es.label)) {
|
||||
if (matchSignal(OXI_Pulse, es.label)) {
|
||||
code = OXI_Pulse;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration);
|
||||
sess->setPhysMax(code, 180);
|
||||
sess->setPhysMin(code, 18);
|
||||
|
||||
} else if (matchSignal(code = OXI_SPO2, es.label)) {
|
||||
} else if (matchSignal(OXI_SPO2, es.label)) {
|
||||
code = OXI_SPO2;
|
||||
es.physical_minimum = 60;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration);
|
||||
sess->setPhysMax(code, 100);
|
||||
@ -2307,30 +2309,37 @@ bool ResmedLoader::LoadPLD(Session *sess, EDFParser &edf)
|
||||
rate = double(duration) / double(recs);
|
||||
|
||||
//qDebug() << "EVE:" << es.digital_maximum << es.digital_minimum << es.physical_maximum << es.physical_minimum << es.gain;
|
||||
if (matchSignal(code = CPAP_Snore, es.label)) {
|
||||
if (matchSignal(CPAP_Snore, es.label)) {
|
||||
code = CPAP_Snore;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_Pressure, es.label)) {
|
||||
} else if (matchSignal(CPAP_Pressure, es.label)) {
|
||||
code = CPAP_Pressure;
|
||||
es.physical_maximum = 25;
|
||||
es.physical_minimum = 4;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_IPAP, es.label)) {
|
||||
} else if (matchSignal(CPAP_IPAP, es.label)) {
|
||||
code = CPAP_IPAP;
|
||||
sess->settings[CPAP_Mode] = MODE_BIPAP;
|
||||
es.physical_maximum = 25;
|
||||
es.physical_minimum = 4;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_MinuteVent,es.label)) {
|
||||
} else if (matchSignal(CPAP_MinuteVent,es.label)) {
|
||||
code = CPAP_MinuteVent;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_RespRate, es.label)) {
|
||||
} else if (matchSignal(CPAP_RespRate, es.label)) {
|
||||
code = CPAP_RespRate;
|
||||
a = sess->AddEventList(code, EVL_Waveform, es.gain, es.offset, 0, 0, rate);
|
||||
a->AddWaveform(edf.startdate, es.data, recs, duration);
|
||||
} else if (matchSignal(code = CPAP_TidalVolume, es.label)) {
|
||||
} else if (matchSignal(CPAP_TidalVolume, es.label)) {
|
||||
code = CPAP_TidalVolume;
|
||||
es.gain *= 1000.0;
|
||||
es.physical_maximum *= 1000.0;
|
||||
es.physical_minimum *= 1000.0;
|
||||
// es.digital_maximum*=1000.0;
|
||||
// es.digital_minimum*=1000.0;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_Leak, es.label)) {
|
||||
} else if (matchSignal(CPAP_Leak, es.label)) {
|
||||
code = CPAP_Leak;
|
||||
es.gain *= 60.0;
|
||||
es.physical_maximum *= 60.0;
|
||||
es.physical_minimum *= 60.0;
|
||||
@ -2340,31 +2349,38 @@ bool ResmedLoader::LoadPLD(Session *sess, EDFParser &edf)
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0, true);
|
||||
sess->setPhysMax(code, 120.0);
|
||||
sess->setPhysMin(code, 0);
|
||||
} else if (matchSignal(code = CPAP_FLG, es.label)) {
|
||||
} else if (matchSignal(CPAP_FLG, es.label)) {
|
||||
code = CPAP_FLG;
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_MaskPressure, es.label)) {
|
||||
} else if (matchSignal(CPAP_MaskPressure, es.label)) {
|
||||
code = CPAP_MaskPressure;
|
||||
es.physical_maximum = 25;
|
||||
es.physical_minimum = 4;
|
||||
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_EPAP, es.label)) { // Expiratory Pressure
|
||||
} else if (matchSignal(CPAP_EPAP, es.label)) { // Expiratory Pressure
|
||||
code = CPAP_EPAP;
|
||||
es.physical_maximum = 25;
|
||||
es.physical_minimum = 4;
|
||||
|
||||
ToTimeDelta(sess, edf, es, code, recs, duration, 0, 0);
|
||||
} else if (matchSignal(code = CPAP_IE, es.label)) { //I:E ratio
|
||||
} else if (matchSignal(CPAP_IE, es.label)) { //I:E ratio
|
||||
code = CPAP_IE;
|
||||
a = sess->AddEventList(code, EVL_Waveform, es.gain, es.offset, 0, 0, rate);
|
||||
a->AddWaveform(edf.startdate, es.data, recs, duration);
|
||||
//a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
|
||||
} else if (matchSignal(code = CPAP_Ti, es.label)) {
|
||||
} else if (matchSignal(CPAP_Ti, es.label)) {
|
||||
code = CPAP_Ti;
|
||||
a = sess->AddEventList(code, EVL_Waveform, es.gain, es.offset, 0, 0, rate);
|
||||
a->AddWaveform(edf.startdate, es.data, recs, duration);
|
||||
//a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
|
||||
} else if (matchSignal(code = CPAP_Te, es.label)) {
|
||||
} else if (matchSignal(CPAP_Te, es.label)) {
|
||||
code = CPAP_Te;
|
||||
a = sess->AddEventList(code, EVL_Waveform, es.gain, es.offset, 0, 0, rate);
|
||||
a->AddWaveform(edf.startdate, es.data, recs, duration);
|
||||
//a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
|
||||
} else if (matchSignal(code = CPAP_TgMV, es.label)) {
|
||||
} else if (matchSignal(CPAP_TgMV, es.label)) {
|
||||
code = CPAP_TgMV;
|
||||
a = sess->AddEventList(code, EVL_Waveform, es.gain, es.offset, 0, 0, rate);
|
||||
a->AddWaveform(edf.startdate, es.data, recs, duration);
|
||||
//a=ToTimeDelta(sess,edf,es, code,recs,duration,0,0);
|
||||
|
@ -223,7 +223,6 @@ bool Machine::Purge(int secret)
|
||||
|
||||
// FIXME: should really clear out the majority of the machine properties here
|
||||
|
||||
|
||||
// It would be joyous if this function screwed up..
|
||||
|
||||
QString path = profile->Get(properties[STR_PROP_Path]); //STR_GEN_DataFolder)+"/"+m_class+"_";
|
||||
@ -270,6 +269,8 @@ bool Machine::Purge(int secret)
|
||||
}
|
||||
// PROFILE.machlist.erase(PROFILE.machlist.find(m->id()));
|
||||
|
||||
PROFILE.p_preferences[STR_PREF_ReimportBackup] = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -350,6 +350,7 @@ void MainWindow::Startup()
|
||||
qstatus->setText("");
|
||||
|
||||
if (PROFILE.p_preferences[STR_PREF_ReimportBackup].toBool()) {
|
||||
importCPAPBackups();
|
||||
PROFILE.p_preferences[STR_PREF_ReimportBackup]=false;
|
||||
}
|
||||
|
||||
@ -394,7 +395,15 @@ void MainWindow::importCPAPBackups()
|
||||
}
|
||||
|
||||
if (paths.size() > 0) {
|
||||
if (QMessageBox::question(this,"Question","Recently CPAP data was purged.\n\nWould you like to automatically reimport from Backup folder?",QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) {
|
||||
if (QMessageBox::question(
|
||||
this,
|
||||
tr("Question"),
|
||||
tr("CPAP data was recently purged and needs to be re-imported.")+"\n\n"+
|
||||
tr("Would you like this done automatically from the Backup Folder?")+"\n\n"+
|
||||
paths.join("\n"),
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::Yes) == QMessageBox::Yes)
|
||||
{
|
||||
int c=0;
|
||||
Q_FOREACH(QString path, paths) {
|
||||
c+=importCPAP(path,tr("Please wait, importing from backup folder(s)..."));
|
||||
@ -1682,7 +1691,7 @@ void MainWindow::on_actionAll_Data_for_current_CPAP_machine_triggered()
|
||||
|
||||
if (QMessageBox::question(this,
|
||||
tr("Are you sure?"),
|
||||
tr("Are you sure you want to purge all CPAP data for the following machine:\n") +
|
||||
tr("Are you sure you want to purge all CPAP data for the following machine:\n\n") +
|
||||
m->properties[STR_PROP_Brand] + " " + m->properties[STR_PROP_Model] + " " +
|
||||
m->properties[STR_PROP_ModelNumber] + " (" + m->properties[STR_PROP_Serial] + ")",
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
@ -1692,7 +1701,6 @@ void MainWindow::on_actionAll_Data_for_current_CPAP_machine_triggered()
|
||||
if (m->Purge(3478216)) {
|
||||
// Turn on automatic re-import
|
||||
// Note: I deliberately haven't added a Profile help for this
|
||||
PROFILE.p_preferences[STR_PREF_ReimportBackup] = true;
|
||||
PROFILE.Save();
|
||||
}
|
||||
// delete or not to delete.. this needs to delete later.. :/
|
||||
|
Loading…
Reference in New Issue
Block a user