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:
Jef Driesen 2016-05-11 10:49:15 +02:00 committed by Dirk Hohndel
parent 87facc940b
commit 5361bc06bd

View File

@ -156,7 +156,11 @@ mares_darwin_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi
break; break;
case DC_FIELD_GASMIX: case DC_FIELD_GASMIX:
gasmix->helium = 0.0; 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; gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium;
break; break;
case DC_FIELD_TEMPERATURE_MINIMUM: case DC_FIELD_TEMPERATURE_MINIMUM: