mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-17 11:10:45 +00:00
Support more F0V6 events based on all sessions from a single 400X machine.
This commit is contained in:
parent
4e863ba484
commit
84f1389d51
@ -3258,16 +3258,18 @@ bool PRS1DataChunk::ParseEventsF0V6(CPAPMode /*mode*/)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
startpos = pos;
|
startpos = pos;
|
||||||
t += data[pos] | (data[pos+1] << 8);
|
if (code != 0x12) { // TODO: Some events have no timestamp?
|
||||||
pos += 2;
|
t += data[pos] | (data[pos+1] << 8);
|
||||||
|
pos += 2;
|
||||||
|
}
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
/*
|
|
||||||
case 1: // Pressure adjustment
|
case 1: // Pressure adjustment
|
||||||
|
// Matches pressure setting, both initial and when ramp button pressed.
|
||||||
// TODO: Have OSCAR treat EPAP adjustment events differently than (average?) stats below.
|
// TODO: Have OSCAR treat EPAP adjustment events differently than (average?) stats below.
|
||||||
//this->AddEvent(new PRS1EPAPEvent(t, data[pos++], GAIN));
|
//this->AddEvent(new PRS1EPAPEvent(t, data[pos++]));
|
||||||
this->AddEvent(new PRS1UnknownDataEvent(m_data, startpos-1, size+1));
|
|
||||||
break;
|
break;
|
||||||
|
/*
|
||||||
case 2: // Timed Breath
|
case 2: // Timed Breath
|
||||||
// TB events have a duration in 0.1s, based on the review of pressure waveforms.
|
// TB events have a duration in 0.1s, based on the review of pressure waveforms.
|
||||||
// TODO: Ideally the starting time here would be adjusted here, but PRS1ParsedEvents
|
// TODO: Ideally the starting time here would be adjusted here, but PRS1ParsedEvents
|
||||||
@ -3277,7 +3279,11 @@ bool PRS1DataChunk::ParseEventsF0V6(CPAPMode /*mode*/)
|
|||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
case 0x11: // Statistics
|
case 0x11: // Statistics
|
||||||
this->AddEvent(new PRS1UnknownDataEvent(m_data, startpos-1, size+1));
|
this->AddEvent(new PRS1TotalLeakEvent(t, data[pos++]));
|
||||||
|
this->AddEvent(new PRS1SnoreEvent(t, data[pos++]));
|
||||||
|
// pressure? usually lower, but on a brief session was exactly set pressure
|
||||||
|
// also lower on session where pressure was at ramp most of the time
|
||||||
|
//this->AddEvent(new PRS1EPAPEvent(t, data[pos++]));
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
case 3: // Statistics
|
case 3: // Statistics
|
||||||
@ -3341,6 +3347,14 @@ bool PRS1DataChunk::ParseEventsF0V6(CPAPMode /*mode*/)
|
|||||||
this->AddEvent(new PRS1VibratorySnoreEvent(t, 0));
|
this->AddEvent(new PRS1VibratorySnoreEvent(t, 0));
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
case 0x0e: // ???
|
||||||
|
// 5 bytes like PB and LL, but what is it?
|
||||||
|
duration = 2 * (data[pos] | (data[pos+1] << 8)); // this looks like a 16-bit value, so may be duration like PB?
|
||||||
|
pos += 2;
|
||||||
|
elapsed = data[pos++]; // this is always 60 seconds unless it's at the end, so it seems like elapsed
|
||||||
|
CHECK_VALUES(elapsed, 60, 0);
|
||||||
|
//this->AddEvent(new PRS1PeriodicBreathingEvent(t - elapsed - duration, duration));
|
||||||
|
break;
|
||||||
case 0x0f: // Periodic Breathing
|
case 0x0f: // Periodic Breathing
|
||||||
// PB events are reported some time after they conclude, and they do have a reported duration.
|
// PB events are reported some time after they conclude, and they do have a reported duration.
|
||||||
duration = 2 * (data[pos] | (data[pos+1] << 8));
|
duration = 2 * (data[pos] | (data[pos+1] << 8));
|
||||||
@ -3355,12 +3369,10 @@ bool PRS1DataChunk::ParseEventsF0V6(CPAPMode /*mode*/)
|
|||||||
elapsed = data[pos++];
|
elapsed = data[pos++];
|
||||||
this->AddEvent(new PRS1LargeLeakEvent(t - elapsed - duration, duration));
|
this->AddEvent(new PRS1LargeLeakEvent(t - elapsed - duration, duration));
|
||||||
break;
|
break;
|
||||||
/*
|
case 0x14: // Hypopnea
|
||||||
case 0x0d: // Hypopnea
|
|
||||||
// TODO: Why does this hypopnea have a different event code?
|
// TODO: Why does this hypopnea have a different event code?
|
||||||
// fall through
|
// fall through
|
||||||
*/
|
case 0x15: // Hypopnea
|
||||||
case 0x14: // Hypopnea
|
|
||||||
// TODO: We should revisit whether this is elapsed or duration once (if)
|
// TODO: We should revisit whether this is elapsed or duration once (if)
|
||||||
// we start calculating hypopneas ourselves. Their official definition
|
// we start calculating hypopneas ourselves. Their official definition
|
||||||
// is 40% reduction in flow lasting at least 10s.
|
// is 40% reduction in flow lasting at least 10s.
|
||||||
@ -3375,6 +3387,12 @@ bool PRS1DataChunk::ParseEventsF0V6(CPAPMode /*mode*/)
|
|||||||
this->AddEvent(new PRS1UnknownDataEvent(m_data, startpos-1, size+1));
|
this->AddEvent(new PRS1UnknownDataEvent(m_data, startpos-1, size+1));
|
||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
|
case 0x12: // Summary
|
||||||
|
CHECK_VALUE(data[pos], 0);
|
||||||
|
CHECK_VALUE(data[pos+1], 0x78); // pressure?
|
||||||
|
//CHECK_VALUE(data[pos+2], 1); // Total snore count
|
||||||
|
CHECK_VALUE(data[pos+3], 0);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
qWarning() << "Unknown event:" << code << "in" << this->sessionid << "at" << startpos-1;
|
qWarning() << "Unknown event:" << code << "in" << this->sessionid << "at" << startpos-1;
|
||||||
this->AddEvent(new PRS1UnknownDataEvent(m_data, startpos-1, size+1));
|
this->AddEvent(new PRS1UnknownDataEvent(m_data, startpos-1, size+1));
|
||||||
|
Loading…
Reference in New Issue
Block a user