mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-17 03:00:46 +00:00
Merge redundant code into single PRS1DataChunk::ParseHumidifierSetting function.
This commit is contained in:
parent
d13b417d5b
commit
44558e4c06
@ -2953,8 +2953,7 @@ bool PRS1DataChunk::ParseCompliance(void)
|
|||||||
this->ParseFlexSetting(flex, MODE_CPAP);
|
this->ParseFlexSetting(flex, MODE_CPAP);
|
||||||
|
|
||||||
int humid = data[0x0A];
|
int humid = data[0x0A];
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_STATUS, (humid & 0x80) != 0)); // Humidifier Connected
|
this->ParseHumidifierSetting(humid, false);
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, (humid & 7))); // Humidifier Value
|
|
||||||
|
|
||||||
// TODO: What are slices, and why would only bricks have them? That seems very weird.
|
// TODO: What are slices, and why would only bricks have them? That seems very weird.
|
||||||
// TODO: The below seems not to work on 200X models.
|
// TODO: The below seems not to work on 200X models.
|
||||||
@ -3168,8 +3167,7 @@ bool PRS1DataChunk::ParseSummaryF0V23()
|
|||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_MASK_ALERT, (data[0x0c] & 0x08) != 0));
|
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_MASK_ALERT, (data[0x0c] & 0x08) != 0));
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_SHOW_AHI, (data[0x0c] & 0x04) != 0));
|
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_SHOW_AHI, (data[0x0c] & 0x04) != 0));
|
||||||
int humid = data[0x09];
|
int humid = data[0x09];
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_STATUS, (humid & 0x80) != 0)); // Humidifier Connected
|
this->ParseHumidifierSetting(humid, false);
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, (humid & 7))); // Humidifier Value
|
|
||||||
|
|
||||||
// session->
|
// session->
|
||||||
|
|
||||||
@ -3324,10 +3322,7 @@ bool PRS1DataChunk::ParseSummaryF0V4(void)
|
|||||||
this->AddEvent(new PRS1PressureSettingEvent(PRS1_SETTING_RAMP_PRESSURE, ramp_pressure));
|
this->AddEvent(new PRS1PressureSettingEvent(PRS1_SETTING_RAMP_PRESSURE, ramp_pressure));
|
||||||
|
|
||||||
int humid = data[0x0b];
|
int humid = data[0x0b];
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_STATUS, (humid & 0x80) != 0)); // Humidifier Connected
|
this->ParseHumidifierSetting(humid);
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HEATED_TUBING, (humid & 0x10) != 0)); // Heated Hose??
|
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, (humid & 7))); // Humidifier Value
|
|
||||||
|
|
||||||
|
|
||||||
this->duration = data[0x14] | data[0x15] << 8;
|
this->duration = data[0x14] | data[0x15] << 8;
|
||||||
|
|
||||||
@ -3548,9 +3543,8 @@ bool PRS1DataChunk::ParseSummaryF5V012(void)
|
|||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_RAMP_TIME, ramp_time));
|
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_RAMP_TIME, ramp_time));
|
||||||
this->AddEvent(new PRS1PressureSettingEvent(PRS1_SETTING_RAMP_PRESSURE, ramp_pressure));
|
this->AddEvent(new PRS1PressureSettingEvent(PRS1_SETTING_RAMP_PRESSURE, ramp_pressure));
|
||||||
|
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_STATUS, (data[0x0d] & 0x80) != 0)); // Humidifier Connected
|
int humid = data[0x0d];
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HEATED_TUBING, (data[0x0d] & 0x10) != 0)); // Heated Hose??
|
this->ParseHumidifierSetting(humid);
|
||||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, (data[0x0d] & 7))); // Humidifier Value
|
|
||||||
|
|
||||||
this->duration = data[0x18] | data[0x19] << 8;
|
this->duration = data[0x18] | data[0x19] << 8;
|
||||||
|
|
||||||
@ -3595,6 +3589,16 @@ void PRS1DataChunk::ParseFlexSetting(quint8 flex, CPAPMode cpapmode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void PRS1DataChunk::ParseHumidifierSetting(int humid, bool supportsHeatedTubing)
|
||||||
|
{
|
||||||
|
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_STATUS, (humid & 0x80) != 0)); // Humidifier Connected
|
||||||
|
if (supportsHeatedTubing) {
|
||||||
|
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HEATED_TUBING, (humid & 0x10) != 0)); // Heated Hose??
|
||||||
|
}
|
||||||
|
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, (humid & 7))); // Humidifier Value
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PRS1Import::ParseSummaryF5V3()
|
bool PRS1Import::ParseSummaryF5V3()
|
||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
|
@ -151,6 +151,9 @@ public:
|
|||||||
//! \brief Parse a flex setting byte from a .000 or .001 containing compliance/summary data
|
//! \brief Parse a flex setting byte from a .000 or .001 containing compliance/summary data
|
||||||
void ParseFlexSetting(quint8 flex, CPAPMode cpapmode);
|
void ParseFlexSetting(quint8 flex, CPAPMode cpapmode);
|
||||||
|
|
||||||
|
//! \brief Parse an humidifier setting byte from a .000 or .001 containing compliance/summary data
|
||||||
|
void ParseHumidifierSetting(int humid, bool supportsHeatedTubing=true);
|
||||||
|
|
||||||
//! \brief Parse a single data chunk from a .002 file containing event data for a family 0 CPAP/APAP machine
|
//! \brief Parse a single data chunk from a .002 file containing event data for a family 0 CPAP/APAP machine
|
||||||
bool ParseEventsF0(CPAPMode mode);
|
bool ParseEventsF0(CPAPMode mode);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user