mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-07 11:40:42 +00:00
Clean up PRS1 F0 importers to minimize their differences.
450P through 960P no longer report the snore count in parentheses in their VS2 flags.
This commit is contained in:
parent
a41debc57b
commit
e948a45baa
@ -3346,17 +3346,7 @@ bool PRS1Import::ParseF0Events()
|
|||||||
|
|
||||||
|
|
||||||
// On-demand channels
|
// On-demand channels
|
||||||
/*
|
//Code[0x0e] = session->AddEventList(PRS1_0E, EVL_Event);
|
||||||
ChannelID Codes[] = {
|
|
||||||
PRS1_00, PRS1_01, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
PRS1_0B, 0, 0, PRS1_0E
|
|
||||||
};
|
|
||||||
|
|
||||||
int ncodes = sizeof(Codes) / sizeof(ChannelID);
|
|
||||||
*/
|
|
||||||
EventList *Code[0x20] = {0};
|
|
||||||
|
|
||||||
Code[0x0e] = session->AddEventList(PRS1_0E, EVL_Event);
|
|
||||||
|
|
||||||
EventList *PRESSURE = nullptr;
|
EventList *PRESSURE = nullptr;
|
||||||
EventList *EPAP = nullptr;
|
EventList *EPAP = nullptr;
|
||||||
@ -3389,7 +3379,7 @@ bool PRS1Import::ParseF0Events()
|
|||||||
|
|
||||||
switch (e->m_type) {
|
switch (e->m_type) {
|
||||||
case PRS1SnoresAtPressureEvent::TYPE:
|
case PRS1SnoresAtPressureEvent::TYPE:
|
||||||
case PRS1UnknownDurationEvent::TYPE: // TODO: we should import and graph this
|
case PRS1UnknownDurationEvent::TYPE: // TODO: We should import and graph this as PRS1_0E
|
||||||
case PRS1AutoPressureSetEvent::TYPE:
|
case PRS1AutoPressureSetEvent::TYPE:
|
||||||
break; // not imported or displayed
|
break; // not imported or displayed
|
||||||
case PRS1PressureSetEvent::TYPE:
|
case PRS1PressureSetEvent::TYPE:
|
||||||
@ -3445,19 +3435,29 @@ bool PRS1Import::ParseF0Events()
|
|||||||
case PRS1TotalLeakEvent::TYPE:
|
case PRS1TotalLeakEvent::TYPE:
|
||||||
TOTLEAK->AddEvent(t, e->m_value);
|
TOTLEAK->AddEvent(t, e->m_value);
|
||||||
leak = e->m_value;
|
leak = e->m_value;
|
||||||
|
// F0 doesn't appear to report unintentional leak
|
||||||
if (calcLeaks) { // Much Quicker doing this here than the recalc method.
|
if (calcLeaks) { // Much Quicker doing this here than the recalc method.
|
||||||
leak -= (((currentPressure/10.0f) - 4.0) * ppm + lpm4);
|
leak -= (((currentPressure/10.0f) - 4.0) * ppm + lpm4);
|
||||||
if (leak < 0) leak = 0;
|
if (leak < 0) leak = 0;
|
||||||
LEAK->AddEvent(t, leak);
|
LEAK->AddEvent(t, leak);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PRS1SnoreEvent::TYPE:
|
case PRS1SnoreEvent::TYPE: // snore count that shows up in flags but not waveform
|
||||||
|
// TODO: The numeric snore graph is the right way to present this information,
|
||||||
|
// but it needs to be shifted left 2 minutes, since it's not a starting value
|
||||||
|
// but a past statistic.
|
||||||
SNORE->AddEvent(t, e->m_value);
|
SNORE->AddEvent(t, e->m_value);
|
||||||
if (e->m_value > 0) {
|
if (e->m_value > 0) {
|
||||||
VS2->AddEvent(t, e->m_value);
|
// TODO: currently these get drawn on our waveforms, but they probably shouldn't,
|
||||||
|
// since they don't have a precise timestamp. They should continue to be drawn
|
||||||
|
// on the flags overview.
|
||||||
|
VS2->AddEvent(t, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PRS1VibratorySnoreEvent::TYPE: // F0: Is this really distinct from SNORE and VS2?
|
case PRS1VibratorySnoreEvent::TYPE: // real VS marker on waveform
|
||||||
|
// TODO: These don't need to be drawn separately on the flag overview, since
|
||||||
|
// they're presumably included in the overall snore count statistic. They should
|
||||||
|
// continue to be drawn on the waveform, due to their precise timestamp.
|
||||||
VS->AddEvent(t, 0);
|
VS->AddEvent(t, 0);
|
||||||
break;
|
break;
|
||||||
case PRS1RERAEvent::TYPE:
|
case PRS1RERAEvent::TYPE:
|
||||||
@ -3466,20 +3466,6 @@ bool PRS1Import::ParseF0Events()
|
|||||||
case PRS1PressurePulseEvent::TYPE:
|
case PRS1PressurePulseEvent::TYPE:
|
||||||
PP->AddEvent(t, e->m_value);
|
PP->AddEvent(t, e->m_value);
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
case PRS1UnknownValueEvent::TYPE:
|
|
||||||
{
|
|
||||||
int code = ((PRS1UnknownValueEvent*) e)->m_code;
|
|
||||||
Q_ASSERT(code < ncodes);
|
|
||||||
if (!Code[code]) {
|
|
||||||
ChannelID cpapcode = Codes[(int)code];
|
|
||||||
Q_ASSERT(cpapcode); // any unknown codes returned by chunk parser should be given a channel above
|
|
||||||
if (!(Code[code] = session->AddEventList(cpapcode, EVL_Event, e->m_gain))) { return false; }
|
|
||||||
}
|
|
||||||
Code[code]->AddEvent(t, e->m_value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
default:
|
default:
|
||||||
qWarning() << "Unknown PRS1 event type" << (int) e->m_type;
|
qWarning() << "Unknown PRS1 event type" << (int) e->m_type;
|
||||||
break;
|
break;
|
||||||
@ -3878,7 +3864,7 @@ bool PRS1Import::ParseEventsF0V6()
|
|||||||
EventList *PB = session->AddEventList(CPAP_PB, EVL_Event);
|
EventList *PB = session->AddEventList(CPAP_PB, EVL_Event);
|
||||||
EventList *LL = session->AddEventList(CPAP_LargeLeak, EVL_Event);
|
EventList *LL = session->AddEventList(CPAP_LargeLeak, EVL_Event);
|
||||||
EventList *TOTLEAK = session->AddEventList(CPAP_LeakTotal, EVL_Event);
|
EventList *TOTLEAK = session->AddEventList(CPAP_LeakTotal, EVL_Event);
|
||||||
EventList *LEAK = session->AddEventList(CPAP_Leak, EVL_Event);
|
EventList *LEAK = session->AddEventList(CPAP_Leak, EVL_Event); // always calculated for F0V2 through F0V6
|
||||||
|
|
||||||
// Pressure initialized on demand due to possibility of bilevel vs. single pressure
|
// Pressure initialized on demand due to possibility of bilevel vs. single pressure
|
||||||
|
|
||||||
@ -3887,17 +3873,7 @@ bool PRS1Import::ParseEventsF0V6()
|
|||||||
|
|
||||||
|
|
||||||
// On-demand channels
|
// On-demand channels
|
||||||
/*
|
//Code[0x0e] = session->AddEventList(PRS1_0E, EVL_Event);
|
||||||
ChannelID Codes[] = {
|
|
||||||
PRS1_00, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|
||||||
0, 0, 0, PRS1_0E
|
|
||||||
};
|
|
||||||
|
|
||||||
int ncodes = sizeof(Codes) / sizeof(ChannelID);
|
|
||||||
*/
|
|
||||||
EventList *Code[0x20] = {0};
|
|
||||||
|
|
||||||
Code[0x0e] = session->AddEventList(PRS1_0E, EVL_Event);
|
|
||||||
|
|
||||||
EventList *PRESSURE = nullptr;
|
EventList *PRESSURE = nullptr;
|
||||||
EventList *EPAP = nullptr;
|
EventList *EPAP = nullptr;
|
||||||
@ -3930,7 +3906,7 @@ bool PRS1Import::ParseEventsF0V6()
|
|||||||
|
|
||||||
switch (e->m_type) {
|
switch (e->m_type) {
|
||||||
case PRS1SnoresAtPressureEvent::TYPE:
|
case PRS1SnoresAtPressureEvent::TYPE:
|
||||||
case PRS1UnknownDurationEvent::TYPE: // TODO: We should import and graph this
|
case PRS1UnknownDurationEvent::TYPE: // TODO: We should import and graph this as PRS1_0E
|
||||||
case PRS1AutoPressureSetEvent::TYPE:
|
case PRS1AutoPressureSetEvent::TYPE:
|
||||||
break; // not imported or displayed
|
break; // not imported or displayed
|
||||||
case PRS1PressureSetEvent::TYPE:
|
case PRS1PressureSetEvent::TYPE:
|
||||||
@ -3986,7 +3962,7 @@ bool PRS1Import::ParseEventsF0V6()
|
|||||||
case PRS1TotalLeakEvent::TYPE:
|
case PRS1TotalLeakEvent::TYPE:
|
||||||
TOTLEAK->AddEvent(t, e->m_value);
|
TOTLEAK->AddEvent(t, e->m_value);
|
||||||
leak = e->m_value;
|
leak = e->m_value;
|
||||||
// F0V6 doesn't appear to report non-total leak
|
// F0 doesn't appear to report unintentional leak
|
||||||
if (calcLeaks) { // Much Quicker doing this here than the recalc method.
|
if (calcLeaks) { // Much Quicker doing this here than the recalc method.
|
||||||
leak -= (((currentPressure/10.0f) - 4.0) * ppm + lpm4);
|
leak -= (((currentPressure/10.0f) - 4.0) * ppm + lpm4);
|
||||||
if (leak < 0) leak = 0;
|
if (leak < 0) leak = 0;
|
||||||
@ -4017,20 +3993,6 @@ bool PRS1Import::ParseEventsF0V6()
|
|||||||
case PRS1PressurePulseEvent::TYPE:
|
case PRS1PressurePulseEvent::TYPE:
|
||||||
PP->AddEvent(t, e->m_value);
|
PP->AddEvent(t, e->m_value);
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
case PRS1UnknownValueEvent::TYPE:
|
|
||||||
{
|
|
||||||
int code = ((PRS1UnknownValueEvent*) e)->m_code;
|
|
||||||
Q_ASSERT(code < ncodes);
|
|
||||||
if (!Code[code]) {
|
|
||||||
ChannelID cpapcode = Codes[(int)code];
|
|
||||||
Q_ASSERT(cpapcode); // any unknown codes returned by chunk parser should be given a channel above
|
|
||||||
if (!(Code[code] = session->AddEventList(cpapcode, EVL_Event, e->m_gain))) { return false; }
|
|
||||||
}
|
|
||||||
Code[code]->AddEvent(t, e->m_value);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
default:
|
default:
|
||||||
qWarning() << "Unknown PRS1 event type" << (int) e->m_type;
|
qWarning() << "Unknown PRS1 event type" << (int) e->m_type;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user