Fix the nitrox gas mix parsing.
Mares Darwin compatible devices support a nitrox mode. The nitrogen percentage should only be taken into account when the dive mode is set to nitrox, because the last used value remains in place for air dives.
This commit is contained in:
parent
cb3b372b5b
commit
375fe2f6a7
@ -156,7 +156,11 @@ mares_darwin_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi
|
||||
break;
|
||||
case DC_FIELD_GASMIX:
|
||||
gasmix->helium = 0.0;
|
||||
gasmix->oxygen = 0.21;
|
||||
if (mode == NITROX) {
|
||||
gasmix->oxygen = p[0x0E] / 100.0;
|
||||
} else {
|
||||
gasmix->oxygen = 0.21;
|
||||
}
|
||||
gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium;
|
||||
break;
|
||||
case DC_FIELD_TEMPERATURE_MINIMUM:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user