Restrict the oxygen/diluent usage to CCR dives

For open-circuit dives, the oxygen and diluent usage doesn't make any
sense at all. But when an open-circuit diver uses the letter 'D' to
indicate a tank for decompression use, it will get incorrectly labeled
as a diluent tank.

Fixed by restricting the oxygen/diluent usage to CCR dives only.
This commit is contained in:
Jef Driesen 2023-07-10 17:53:13 +02:00
parent f818a5a92a
commit f77e9c03fc

View File

@ -746,21 +746,24 @@ shearwater_predator_parser_get_field (dc_parser_t *abstract, dc_field_type_t typ
tank->beginpressure = parser->tank[flags].beginpressure * 2 * PSI / BAR;
tank->endpressure = parser->tank[flags].endpressure * 2 * PSI / BAR;
tank->gasmix = DC_GASMIX_UNKNOWN;
switch (parser->tank[flags].name[0]) {
case 'S':
tank->usage = DC_USAGE_SIDEMOUNT;
break;
case 'O':
tank->usage = DC_USAGE_OXYGEN;
break;
case 'D':
tank->usage = DC_USAGE_DILUENT;
break;
case 'T':
case 'B':
default:
tank->usage = DC_USAGE_NONE;
break;
if (shearwater_predator_is_ccr (parser->divemode)) {
switch (parser->tank[flags].name[0]) {
case 'O':
tank->usage = DC_USAGE_OXYGEN;
break;
case 'D':
tank->usage = DC_USAGE_DILUENT;
break;
default:
tank->usage = DC_USAGE_NONE;
break;
}
} else {
if (parser->tank[flags].name[0] == 'S') {
tank->usage = DC_USAGE_SIDEMOUNT;
} else {
tank->usage = DC_USAGE_NONE;
}
}
break;
case DC_FIELD_SALINITY: