mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 11:10:44 +00:00
Clean up AVAPS pressure settings
This commit is contained in:
parent
150bc3a3bc
commit
96f3b6c658
@ -848,11 +848,13 @@ ChannelID Day::getPressureChannelID() {
|
|||||||
for (auto & preferredID : preferredIDs) {
|
for (auto & preferredID : preferredIDs) {
|
||||||
// If preferred channel has data, return it
|
// If preferred channel has data, return it
|
||||||
if (channelHasData(preferredID)) {
|
if (channelHasData(preferredID)) {
|
||||||
//qDebug() << QString("Found pressure channel 0x%1").arg(preferredID, 4, 16, QChar('0'));
|
// if ( cpapmode == MODE_AVAPS )
|
||||||
|
// qDebug() << QString("Found pressure channel 0x%1").arg(preferredID, 4, 16, QChar('0'));
|
||||||
return preferredID;
|
return preferredID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qDebug() << "No pressure channel for " << getCPAPModeStr();
|
||||||
return NoChannel;
|
return NoChannel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1582,13 +1584,21 @@ QString Day::getPressureSettings()
|
|||||||
QString units = schema::channel[CPAP_Pressure].units();
|
QString units = schema::channel[CPAP_Pressure].units();
|
||||||
|
|
||||||
if (mode == MODE_CPAP) {
|
if (mode == MODE_CPAP) {
|
||||||
return QObject::tr("Fixed %1 (%2)").arg(validPressure(settings_min(CPAP_Pressure))).arg(units);
|
return QObject::tr("Fixed %1 (%2)").arg(validPressure(settings_min(CPAP_Pressure))).
|
||||||
|
arg(units);
|
||||||
} else if (mode == MODE_APAP) {
|
} else if (mode == MODE_APAP) {
|
||||||
return QObject::tr("Min %1 Max %2 (%3)").arg(validPressure(settings_min(CPAP_PressureMin))).arg(validPressure(settings_max(CPAP_PressureMax))).arg(units);
|
return QObject::tr("Min %1 Max %2 (%3)").arg(validPressure(settings_min(CPAP_PressureMin))).
|
||||||
|
arg(validPressure(settings_max(CPAP_PressureMax))).
|
||||||
|
arg(units);
|
||||||
} else if (mode == MODE_BILEVEL_FIXED ) {
|
} else if (mode == MODE_BILEVEL_FIXED ) {
|
||||||
return QObject::tr("EPAP %1 IPAP %2 (%3)").arg(validPressure(settings_min(CPAP_EPAP))).arg(validPressure(settings_max(CPAP_IPAP))).arg(units);
|
return QObject::tr("EPAP %1 IPAP %2 (%3)").arg(validPressure(settings_min(CPAP_EPAP))).
|
||||||
|
arg(validPressure(settings_max(CPAP_IPAP))).
|
||||||
|
arg(units);
|
||||||
} else if (mode == MODE_BILEVEL_AUTO_FIXED_PS) {
|
} else if (mode == MODE_BILEVEL_AUTO_FIXED_PS) {
|
||||||
return QObject::tr("PS %1 over %2-%3 (%4)").arg(validPressure(settings_max(CPAP_PS))).arg(validPressure(settings_min(CPAP_EPAPLo))).arg(validPressure(settings_max(CPAP_IPAPHi))).arg(units);
|
return QObject::tr("PS %1 over %2-%3 (%4)").arg(validPressure(settings_max(CPAP_PS))).
|
||||||
|
arg(validPressure(settings_min(CPAP_EPAPLo))).
|
||||||
|
arg(validPressure(settings_max(CPAP_IPAPHi))).
|
||||||
|
arg(units);
|
||||||
} else if (mode == MODE_BILEVEL_AUTO_VARIABLE_PS) {
|
} else if (mode == MODE_BILEVEL_AUTO_VARIABLE_PS) {
|
||||||
return QObject::tr("Min EPAP %1 Max IPAP %2 PS %3-%4 (%5)").arg(validPressure(settings_min(CPAP_EPAPLo))).
|
return QObject::tr("Min EPAP %1 Max IPAP %2 PS %3-%4 (%5)").arg(validPressure(settings_min(CPAP_EPAPLo))).
|
||||||
arg(validPressure(settings_max(CPAP_IPAPHi))).
|
arg(validPressure(settings_max(CPAP_IPAPHi))).
|
||||||
@ -1606,11 +1616,25 @@ QString Day::getPressureSettings()
|
|||||||
arg(validPressure(settings_min(CPAP_PSMax))).
|
arg(validPressure(settings_min(CPAP_PSMax))).
|
||||||
arg(units);
|
arg(units);
|
||||||
} else if (mode == MODE_AVAPS) {
|
} else if (mode == MODE_AVAPS) {
|
||||||
return QObject::tr("EPAP %1 IPAP %2-%3 (%4)").
|
// qDebug() << "AVAPS: EPAP" << settings_min(CPAP_EPAP) << "IPAP min" << settings_max(CPAP_IPAPLo) <<
|
||||||
|
// "IPAP max" << settings_max(CPAP_IPAPHi);
|
||||||
|
QString retStr;
|
||||||
|
if (settings_min(CPAP_EPAPLo) == settings_max(CPAP_EPAPHi))
|
||||||
|
retStr = QObject::tr("EPAP %1 IPAP %2-%3 (%4)").
|
||||||
arg(validPressure(settings_min(CPAP_EPAP))).
|
arg(validPressure(settings_min(CPAP_EPAP))).
|
||||||
arg(validPressure(settings_max(CPAP_IPAPLo))).
|
arg(validPressure(settings_max(CPAP_IPAPLo))).
|
||||||
arg(validPressure(settings_max(CPAP_IPAPHi))).
|
arg(validPressure(settings_max(CPAP_IPAPHi))).
|
||||||
arg(units);
|
arg(units);
|
||||||
|
else
|
||||||
|
retStr = QObject::tr("EPAP %1-%2 IPAP %3-%4 (%5)").
|
||||||
|
arg(validPressure(settings_min(CPAP_EPAPLo))).
|
||||||
|
arg(validPressure(settings_min(CPAP_EPAPHi))).
|
||||||
|
arg(validPressure(settings_max(CPAP_IPAPLo))).
|
||||||
|
arg(validPressure(settings_max(CPAP_IPAPHi))).
|
||||||
|
arg(units);
|
||||||
|
|
||||||
|
// qDebug() << "AVAPS mode:" << retStr;
|
||||||
|
return retStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return STR_TR_Unknown;
|
return STR_TR_Unknown;
|
||||||
|
@ -1527,13 +1527,16 @@ bool ResmedLoader::ProcessSTRfiles(Machine *mach, QMap<QDate, STRFile> & STRmap,
|
|||||||
if ((sig = str.lookupLabel("S.i.MaxPS"))) {
|
if ((sig = str.lookupLabel("S.i.MaxPS"))) {
|
||||||
R.max_ps = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
|
R.max_ps = EventDataType(sig->dataArray[rec]) * sig->gain + sig->offset;
|
||||||
}
|
}
|
||||||
if ( R.epap >= 0 ) {
|
if ( (R.epap >= 0) && (R.max_epap == R.epap) ) {
|
||||||
R.max_ipap = R.epap + R.max_ps;
|
R.max_ipap = R.epap + R.max_ps;
|
||||||
R.min_ipap = R.epap + R.min_ps;
|
R.min_ipap = R.epap + R.min_ps;
|
||||||
} else {
|
} else {
|
||||||
R.max_ipap = R.max_epap + R.max_ps;
|
R.max_ipap = R.max_epap + R.max_ps;
|
||||||
R.min_ipap = R.min_epap + R.min_ps;
|
R.min_ipap = R.min_epap + R.min_ps;
|
||||||
}
|
}
|
||||||
|
// qDebug() << "AVAPS mode; Ramp" << R.ramp_pressure << "Min EPAP" << R.min_epap <<
|
||||||
|
// "Max EPAP" << R.max_epap << "Min PS" << R.min_ps << "Max PS" << R.max_ps <<
|
||||||
|
// "Min IPAP" << R.min_ipap << "Max_IPAP" << R.max_ipap;
|
||||||
}
|
}
|
||||||
if (R.mode == MODE_ASV) {
|
if (R.mode == MODE_ASV) {
|
||||||
if ((sig = str.lookupLabel("S.AV.StartPress"))) {
|
if ((sig = str.lookupLabel("S.AV.StartPress"))) {
|
||||||
@ -2280,8 +2283,8 @@ void StoreSettings(Session * sess, STRRecord & R)
|
|||||||
if (R.min_ipap >= 0) sess->settings[CPAP_IPAPLo] = R.min_ipap;
|
if (R.min_ipap >= 0) sess->settings[CPAP_IPAPLo] = R.min_ipap;
|
||||||
if (R.min_ps >= 0) sess->settings[CPAP_PSMin] = R.min_ps;
|
if (R.min_ps >= 0) sess->settings[CPAP_PSMin] = R.min_ps;
|
||||||
if (R.max_ps >= 0) sess->settings[CPAP_PSMax] = R.max_ps;
|
if (R.max_ps >= 0) sess->settings[CPAP_PSMax] = R.max_ps;
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
// qDebug() << "Setting session pressures for random mode";
|
||||||
if (R.set_pressure >= 0) sess->settings[CPAP_Pressure] = R.set_pressure;
|
if (R.set_pressure >= 0) sess->settings[CPAP_Pressure] = R.set_pressure;
|
||||||
if (R.min_pressure >= 0) sess->settings[CPAP_PressureMin] = R.min_pressure;
|
if (R.min_pressure >= 0) sess->settings[CPAP_PressureMin] = R.min_pressure;
|
||||||
if (R.max_pressure >= 0) sess->settings[CPAP_PressureMax] = R.max_pressure;
|
if (R.max_pressure >= 0) sess->settings[CPAP_PressureMax] = R.max_pressure;
|
||||||
@ -2295,6 +2298,7 @@ void StoreSettings(Session * sess, STRRecord & R)
|
|||||||
if (R.epap >= 0) sess->settings[CPAP_EPAP] = R.epap;
|
if (R.epap >= 0) sess->settings[CPAP_EPAP] = R.epap;
|
||||||
if (R.ipap >= 0) sess->settings[CPAP_IPAP] = R.ipap;
|
if (R.ipap >= 0) sess->settings[CPAP_IPAP] = R.ipap;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (R.epr >= 0) {
|
if (R.epr >= 0) {
|
||||||
sess->settings[RMS9_EPR] = (int)R.epr;
|
sess->settings[RMS9_EPR] = (int)R.epr;
|
||||||
@ -3095,7 +3099,7 @@ bool ResmedLoader::LoadPLD(Session *sess, const QString & path)
|
|||||||
time.start();
|
time.start();
|
||||||
#endif
|
#endif
|
||||||
QString filename = path.section(-2, -1);
|
QString filename = path.section(-2, -1);
|
||||||
qDebug() << "LoadPLD opening" << filename.section("/", -2, -1);
|
// qDebug() << "LoadPLD opening" << filename.section("/", -2, -1);
|
||||||
ResMedEDFInfo edf;
|
ResMedEDFInfo edf;
|
||||||
if ( ! edf.Open(path) ) {
|
if ( ! edf.Open(path) ) {
|
||||||
qDebug() << "LoadPLD failed to open" << filename.section("/", -2, -1);
|
qDebug() << "LoadPLD failed to open" << filename.section("/", -2, -1);
|
||||||
@ -3461,6 +3465,7 @@ EventList * buildEventList( EventStoreType est, EventDataType t_min, EventDataTy
|
|||||||
|
|
||||||
el->AddEvent(tt, est);
|
el->AddEvent(tt, est);
|
||||||
} else {
|
} else {
|
||||||
|
if ( tmp > 0 )
|
||||||
qDebug() << "Value:" << tmp << "Out of range: t_min:" << t_min << "t_max:" << t_max << "EL count:" << el->count();
|
qDebug() << "Value:" << tmp << "Out of range: t_min:" << t_min << "t_max:" << t_max << "EL count:" << el->count();
|
||||||
// Out of bounds value, start a new eventlist
|
// Out of bounds value, start a new eventlist
|
||||||
// But first drop a closing value that repeats the last one
|
// But first drop a closing value that repeats the last one
|
||||||
|
Loading…
Reference in New Issue
Block a user