mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 03:30:44 +00:00
Added Large Leak flagging where not present using redline
This commit is contained in:
parent
68b4e7bba4
commit
7679c3daeb
@ -1683,6 +1683,53 @@ void zMaskProfile::updateProfile(Session *session)
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void flagLargeLeaks(Session *session)
|
||||||
|
{
|
||||||
|
if (session->eventlist.contains(CPAP_LargeLeak))
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
EventDataType threshold = p_profile->cpap->leakRedline();
|
||||||
|
|
||||||
|
if (threshold <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVector<EventList *> & EVL = session->eventlist[CPAP_Leak];
|
||||||
|
int evlsize = EVL.size();
|
||||||
|
EventList * LL = nullptr;
|
||||||
|
|
||||||
|
for (int ec = 0; ec < evlsize; ++ec) {
|
||||||
|
EventList &el = *EVL[ec];
|
||||||
|
int count = el.count();
|
||||||
|
if (!count) continue;
|
||||||
|
|
||||||
|
qint64 leaktime = 0;
|
||||||
|
EventDataType leakvalue = 0, lastvalue = -1;
|
||||||
|
|
||||||
|
|
||||||
|
for (int i=0; i < count; ++i) {
|
||||||
|
qint64 time = el.time(i);
|
||||||
|
EventDataType value = el.data(i);
|
||||||
|
if (value >= threshold) {
|
||||||
|
if (lastvalue < threshold) {
|
||||||
|
leaktime = time;
|
||||||
|
leakvalue = value;
|
||||||
|
}
|
||||||
|
} else if (lastvalue > threshold) {
|
||||||
|
if (!LL) {
|
||||||
|
LL=session->AddEventList(CPAP_LargeLeak, EVL_Event);
|
||||||
|
}
|
||||||
|
int duration = (time - leaktime) / 1000L;
|
||||||
|
LL->AddEvent(time, duration);
|
||||||
|
}
|
||||||
|
lastvalue = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QMutex zMaskmutex;
|
QMutex zMaskmutex;
|
||||||
zMaskProfile mmaskProfile(Mask_NasalPillows, "ResMed Swift FX");
|
zMaskProfile mmaskProfile(Mask_NasalPillows, "ResMed Swift FX");
|
||||||
bool mmaskFirst = true;
|
bool mmaskFirst = true;
|
||||||
@ -1784,6 +1831,7 @@ int calcLeaks(Session *session)
|
|||||||
}
|
}
|
||||||
|
|
||||||
zMaskmutex.unlock();
|
zMaskmutex.unlock();
|
||||||
|
|
||||||
return leak->count();
|
return leak->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,6 +151,9 @@ int calcAHIGraph(Session *session);
|
|||||||
//! \brief Calculates AHI for a session between start & end (a support function for the sliding window graph)
|
//! \brief Calculates AHI for a session between start & end (a support function for the sliding window graph)
|
||||||
EventDataType calcAHI(Session *session, qint64 start = -1, qint64 end = -1);
|
EventDataType calcAHI(Session *session, qint64 start = -1, qint64 end = -1);
|
||||||
|
|
||||||
|
//! \brief Scans for leaks over Redline and flags as large leaks, unless machine provided them already
|
||||||
|
void flagLargeLeaks(Session *session);
|
||||||
|
|
||||||
//! \brief Leaks calculations for PRS1
|
//! \brief Leaks calculations for PRS1
|
||||||
int calcLeaks(Session *session);
|
int calcLeaks(Session *session);
|
||||||
|
|
||||||
|
@ -907,6 +907,8 @@ void Session::UpdateSummaries()
|
|||||||
calcRespRate(this);
|
calcRespRate(this);
|
||||||
|
|
||||||
calcLeaks(this);
|
calcLeaks(this);
|
||||||
|
flagLargeLeaks(this);
|
||||||
|
|
||||||
calcSPO2Drop(this);
|
calcSPO2Drop(this);
|
||||||
calcPulseChange(this);
|
calcPulseChange(this);
|
||||||
|
|
||||||
|
@ -1415,7 +1415,7 @@ void Daily::Load(QDate date)
|
|||||||
int c = 0;
|
int c = 0;
|
||||||
for (fit = flags.begin(); fit != flags.end(); ++fit) {
|
for (fit = flags.begin(); fit != flags.end(); ++fit) {
|
||||||
ui->eventsCombo->addItem(fit.value()->enabled() ? *icon_on : * icon_off, fit.key(), fit.value()->id());
|
ui->eventsCombo->addItem(fit.value()->enabled() ? *icon_on : * icon_off, fit.key(), fit.value()->id());
|
||||||
ui->eventsCombo->setItemData(c, fit.value()->description(), Qt::ToolTipRole);
|
ui->eventsCombo->setItemData(c, fit.value()->fullname(), Qt::ToolTipRole);
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user