Fix the gas mixes for the Oceanic OCi.

The Oceanic OCi supports 4 gas mixes instead of just 3, and they are
stored at a different offset.
This commit is contained in:
Janice McLaughlin 2014-03-14 08:53:48 +01:00 committed by Jef Driesen
parent db79a63c0d
commit f923ec3889

View File

@ -324,7 +324,7 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns
case DC_FIELD_GASMIX_COUNT: case DC_FIELD_GASMIX_COUNT:
if (parser->model == DATAMASK || parser->model == COMPUMASK) if (parser->model == DATAMASK || parser->model == COMPUMASK)
*((unsigned int *) value) = 1; *((unsigned int *) value) = 1;
else if (parser->model == VT4 || parser->model == VT41) else if (parser->model == VT4 || parser->model == VT41 || parser->model == OCI)
*((unsigned int *) value) = 4; *((unsigned int *) value) = 4;
else else
*((unsigned int *) value) = 3; *((unsigned int *) value) = 3;
@ -332,6 +332,8 @@ oceanic_atom2_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, uns
case DC_FIELD_GASMIX: case DC_FIELD_GASMIX:
if (parser->model == DATAMASK || parser->model == COMPUMASK) if (parser->model == DATAMASK || parser->model == COMPUMASK)
nitrox = data[header + 3]; nitrox = data[header + 3];
else if (parser->model == OCI)
nitrox = data[0x28 + flags];
else else
nitrox = data[header + 4 + flags]; nitrox = data[header + 4 + flags];
gasmix->helium = 0.0; gasmix->helium = 0.0;