Add support for semi-closed circuit diving
Add a new type to distinguish between closed circuit (CCR) and semi-closed circuit (SCR) diving. Some dive computers from HW and DiveSystem/Ratio support this. Because the CCR/SCR abbreviations are more commonly used, let's take the opportunity to also rename the existing DC_DIVEMODE_CC. To preserve backwards compatibility, a macro is added to map the old name to the new one. Reported-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
parent
76187c550a
commit
f87720dff9
@ -172,8 +172,10 @@ for gauge (i.e., running as a record and not computing, say,
|
||||
decompression events),
|
||||
.Dv DC_DIVEMODE_OC
|
||||
for standard open-circuit diving, and
|
||||
.Dv DC_DIVEMODE_CC
|
||||
for closed-circuit
|
||||
.Dv DC_DIVEMODE_CCR
|
||||
and
|
||||
.Dv DC_DIVEMODE_SCR
|
||||
for respectively closed circuit and semi closed circuit
|
||||
.Dq rebreather
|
||||
diving.
|
||||
.El
|
||||
|
||||
@ -367,7 +367,7 @@ dctool_xml_output_write (dctool_output_t *abstract, dc_parser_t *parser, const u
|
||||
}
|
||||
|
||||
if (status != DC_STATUS_UNSUPPORTED) {
|
||||
const char *names[] = {"freedive", "gauge", "oc", "cc"};
|
||||
const char *names[] = {"freedive", "gauge", "oc", "ccr", "scr"};
|
||||
fprintf (output->ostream, "<divemode>%s</divemode>\n",
|
||||
names[divemode]);
|
||||
}
|
||||
|
||||
@ -121,9 +121,13 @@ typedef enum dc_divemode_t {
|
||||
DC_DIVEMODE_FREEDIVE,
|
||||
DC_DIVEMODE_GAUGE,
|
||||
DC_DIVEMODE_OC, /* Open circuit */
|
||||
DC_DIVEMODE_CC /* Closed circuit */
|
||||
DC_DIVEMODE_CCR, /* Closed circuit rebreather */
|
||||
DC_DIVEMODE_SCR /* Semi-closed circuit rebreather */
|
||||
} dc_divemode_t;
|
||||
|
||||
/* For backwards compatibility */
|
||||
#define DC_DIVEMODE_CC DC_DIVEMODE_CCR
|
||||
|
||||
typedef enum dc_deco_type_t {
|
||||
DC_DECO_NDL,
|
||||
DC_DECO_SAFETYSTOP,
|
||||
|
||||
@ -202,7 +202,7 @@ atomics_cobalt_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, un
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_OC;
|
||||
break;
|
||||
case 1: // Closed Circuit
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CC;
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CCR;
|
||||
break;
|
||||
default:
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
|
||||
@ -230,8 +230,10 @@ divesystem_idive_parser_get_field (dc_parser_t *abstract, dc_field_type_t type,
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_OC;
|
||||
break;
|
||||
case SCR:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_SCR;
|
||||
break;
|
||||
case CCR:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CC;
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CCR;
|
||||
break;
|
||||
case GAUGE:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_GAUGE;
|
||||
|
||||
@ -59,6 +59,7 @@
|
||||
#define OSTC3_CC 1
|
||||
#define OSTC3_GAUGE 2
|
||||
#define OSTC3_APNEA 3
|
||||
#define OSTC3_PSCR 4
|
||||
|
||||
#define OSTC4 0x3B
|
||||
|
||||
@ -505,8 +506,10 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
|
||||
break;
|
||||
case OSTC_ZHL16_CC:
|
||||
case OSTC_ZHL16_CC_GF:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CCR;
|
||||
break;
|
||||
case OSTC_PSCR_GF:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CC;
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_SCR;
|
||||
break;
|
||||
default:
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
@ -529,7 +532,7 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_OC;
|
||||
break;
|
||||
case OSTC3_CC:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CC;
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CCR;
|
||||
break;
|
||||
case OSTC3_GAUGE:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_GAUGE;
|
||||
@ -537,6 +540,9 @@ hw_ostc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigned
|
||||
case OSTC3_APNEA:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_FREEDIVE;
|
||||
break;
|
||||
case OSTC3_PSCR:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_SCR;
|
||||
break;
|
||||
default:
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ shearwater_predator_parser_cache (shearwater_predator_parser_t *parser)
|
||||
// Status flags.
|
||||
unsigned int status = data[offset + 11];
|
||||
if ((status & OC) == 0) {
|
||||
mode = DC_DIVEMODE_CC;
|
||||
mode = DC_DIVEMODE_CCR;
|
||||
}
|
||||
|
||||
// Gaschange.
|
||||
|
||||
@ -382,7 +382,7 @@ suunto_d9_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsigne
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_FREEDIVE;
|
||||
break;
|
||||
case CCR:
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CC;
|
||||
*((dc_divemode_t *) value) = DC_DIVEMODE_CCR;
|
||||
break;
|
||||
default:
|
||||
return DC_STATUS_DATAFORMAT;
|
||||
|
||||
@ -1328,7 +1328,7 @@ static int traverse_diving_fields(suunto_eonsteel_parser_t *eon, const struct ty
|
||||
|
||||
if (!strcmp(name, "DiveMode")) {
|
||||
if (!strncmp((const char *)data, "CCR", 3)) {
|
||||
eon->cache.divemode = DC_DIVEMODE_CC;
|
||||
eon->cache.divemode = DC_DIVEMODE_CCR;
|
||||
eon->cache.initialized |= 1 << DC_FIELD_DIVEMODE;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user