mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Finish cleaning up ParseSettingsF0V4.
This commit is contained in:
parent
8f49633131
commit
13395d9c35
@ -4196,35 +4196,19 @@ bool PRS1DataChunk::ParseSettingsF0V4(const unsigned char* data, int /*size*/)
|
||||
quint8 flex = data[0x0a];
|
||||
this->ParseFlexSetting(flex, cpapmode);
|
||||
|
||||
//qWarning() << this->sessionid << hex(data[0x0b]) << hex(data[0x0c]);
|
||||
// 333 90 05 = system one humid, humidifier off, (22mm hose)
|
||||
// 307 B3 0A = system one humid, tube temp 5, humidity 3, humidity 3 on tube disconnect (15mm hose)
|
||||
// 57 B3 0A = system one humid, tube temp 5, humidity 3, humidity 3 on tube disconnect
|
||||
// 405 33 0A = system one humid, tube temp 4, humidity 3, humidity 3 on tube disconnect
|
||||
// 406 B3 09 = system one humid, tube temp 3, humidity 3, humidity 3 on tube disconnect
|
||||
// 83 33 09 = system one humid, tube temp 2, humidity 3, humidity 3 on tube disconnect
|
||||
// 339 B5 08 = system one humid, tube temp 1, humidity 3, humidity 3 on tube disconnect [even though humidlevel is 5; maybe always 3 on disconnect?]
|
||||
// 200 A4 09 = system one humid, tube temp 3, humidity 2, humidity 3 on tube disconnect [even though humidlevel is 4]
|
||||
// 10 22 09 = system one humid, tube temp 2, humidity 2, humidity 3 on tube disconnect [even though humidlevel is 2]
|
||||
// 9 21 09 = system one humid, tube temp 2, humidity 2, humidity 3 on tube disconnect [even though humidlevel is 1]
|
||||
// 27 A3 0A = system one humid, tube temp 5, humidity 2, humidity 3 on tube disconnect
|
||||
// 6 03 08 = system one humid, tube temp 0=off, humidity 3 on tube disconnect
|
||||
// 7 95 06 = system one humid, no tube [22mm hose], humidity 5 [on tube disconnect?]
|
||||
// 150 A3 61 = classic humid [no tube/22mm hose], humidity 3
|
||||
// 2 93 11 = system one humid, no tube [22mm hose], humidity 3 [on tube disconnect?]
|
||||
// 3 95 41 = classic humid [no tube/22mm hose], humidity 5
|
||||
|
||||
// 7 = humidity level without tube [on tube disconnect / system one with 22mm hose / classic] [0 = humidifier off?]
|
||||
// 8 = ???
|
||||
// 3 = humidity level with tube
|
||||
// 4 = maybe part of humidity level? [never seen]
|
||||
// 8 3 = tube temperature (high bit of humid 1 is low bit of temp)
|
||||
// 4 = ??? [90 05?, 95 06?] humidifier off? [TODO: search for other examples of this]
|
||||
// 8 = tube present
|
||||
// 10 = ??? [93 11?] [TODO: search for other examples of this]
|
||||
// 20 = ??? [41 vs 61? no visible difference in report, but it's in classic mode; TODO: search for other examples of this bit]
|
||||
// 40 = classic
|
||||
// 80 = ??? [never seen]
|
||||
// XX XX = F0V4 Humidifier bytes
|
||||
// 7 = humidity level without tube [on tube disconnect / system one with 22mm hose / classic] [0 = humidifier off?]
|
||||
// 8 = [never seen]
|
||||
// 3 = humidity level with tube
|
||||
// 4 = maybe part of humidity level? [never seen]
|
||||
// 8 3 = tube temperature (high bit of humid 1 is low bit of temp)
|
||||
// 4 = "System One" mode
|
||||
// 8 = tube present
|
||||
// 10 = no data in chart, maybe no humidifier attached?
|
||||
// 20 = unknown, something tube related since whenever it's set tubepresent is false
|
||||
// 40 = "Classic" mode
|
||||
// 80 = [never seen]
|
||||
|
||||
int humid1 = data[0x0b];
|
||||
int humid2 = data[0x0c];
|
||||
@ -4250,7 +4234,7 @@ bool PRS1DataChunk::ParseSettingsF0V4(const unsigned char* data, int /*size*/)
|
||||
if (humidsystemone + tubepresent + no_data > 1) UNEXPECTED_VALUE(humid2, "one bit set"); // Only one of these ever seems to be set at a time
|
||||
if (tubepresent && tubetemp == 0) CHECK_VALUE(tubehumidlevel, 0); // When the heated tube is off, tube humidity seems to be 0
|
||||
|
||||
qWarning() << this->sessionid << (humidclassic ? "C" : ".") << (humid2 & 0x20 ? "?" : ".") << (tubepresent ? "T" : ".") << (no_data ? "X" : ".") << (humidsystemone ? "1" : ".");
|
||||
//qWarning() << this->sessionid << (humidclassic ? "C" : ".") << (humid2 & 0x20 ? "?" : ".") << (tubepresent ? "T" : ".") << (no_data ? "X" : ".") << (humidsystemone ? "1" : ".");
|
||||
/*
|
||||
if (tubepresent) {
|
||||
if (tubetemp) {
|
||||
@ -4266,22 +4250,9 @@ bool PRS1DataChunk::ParseSettingsF0V4(const unsigned char* data, int /*size*/)
|
||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HEATED_TUBING, tubepresent));
|
||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, tubepresent ? tubehumidlevel : humidlevel)); // TODO: we also need tubetemp
|
||||
|
||||
/*
|
||||
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??
|
||||
// TODO: 0x20 is seen on machines with System One humidification & heated tubing, not sure which setting it represents.
|
||||
} else {
|
||||
CHECK_VALUE(humid & 0x30, 0);
|
||||
}
|
||||
int humidlevel = humid & 7;
|
||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HUMID_LEVEL, humidlevel)); // Humidifier Value
|
||||
|
||||
if (humidlevel > 5) UNEXPECTED_VALUE(humidlevel, "<= 5");
|
||||
*/
|
||||
|
||||
int resist_level = (data[0x0d] >> 3) & 7; // 0x18 resist=3, 0x11 resist=2
|
||||
CHECK_VALUE(data[0x0d] & 0x20, 0); // TODO: flag sessions so we can confirm whether the above mask is correct
|
||||
CHECK_VALUE(data[0x0d] & 0x20, 0); // never seen, but would clarify whether above mask is correct
|
||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_MASK_RESIST_LOCK, (data[0x0d] & 0x40) != 0));
|
||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_MASK_RESIST_SETTING, resist_level));
|
||||
this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_HOSE_DIAMETER, (data[0x0d] & 0x01) ? 15 : 22));
|
||||
|
Loading…
Reference in New Issue
Block a user