Add support for the tank field.
The air integrated uwatec aladin models do record the total consumption, and not the begin/end pressure. Returning the total consumption as the begin pressure, combined with a zero end pressure is strictly speaking not correct, but it still provides useful information.
This commit is contained in:
parent
ddbcdeecbb
commit
52453f080d
@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <libdivecomputer/uwatec_memomouse.h>
|
||||
#include <libdivecomputer/units.h>
|
||||
|
||||
#include "context-private.h"
|
||||
#include "parser-private.h"
|
||||
@ -141,6 +142,7 @@ uwatec_memomouse_parser_get_field (dc_parser_t *abstract, dc_field_type_t type,
|
||||
header += 3;
|
||||
|
||||
dc_gasmix_t *gasmix = (dc_gasmix_t *) value;
|
||||
dc_tank_t *tank = (dc_tank_t *) value;
|
||||
|
||||
if (value) {
|
||||
switch (type) {
|
||||
@ -167,6 +169,25 @@ uwatec_memomouse_parser_get_field (dc_parser_t *abstract, dc_field_type_t type,
|
||||
}
|
||||
gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium;
|
||||
break;
|
||||
case DC_FIELD_TANK_COUNT:
|
||||
if (data[10]) {
|
||||
*((unsigned int *) value) = 1;
|
||||
} else {
|
||||
*((unsigned int *) value) = 0;
|
||||
}
|
||||
break;
|
||||
case DC_FIELD_TANK:
|
||||
tank->type = DC_TANKVOLUME_NONE;
|
||||
tank->volume = 0.0;
|
||||
tank->workpressure = 0.0;
|
||||
if (model == 0x1C) {
|
||||
tank->beginpressure = data[10] * 20.0 * PSI / BAR;
|
||||
} else {
|
||||
tank->beginpressure = data[10];
|
||||
}
|
||||
tank->endpressure = 0.0;
|
||||
tank->gasmix = 0;
|
||||
break;
|
||||
case DC_FIELD_TEMPERATURE_MINIMUM:
|
||||
*((double *) value) = (signed char) data[15] / 4.0;
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user