Add a function for detecting CCR dives
This commit is contained in:
parent
ceaaba3e77
commit
f818a5a92a
@ -179,6 +179,12 @@ static const dc_parser_vtable_t shearwater_petrel_parser_vtable = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static unsigned int
|
||||||
|
shearwater_predator_is_ccr (unsigned int divemode)
|
||||||
|
{
|
||||||
|
return divemode == M_CC || divemode == M_CC2 || divemode == M_SC;
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
shearwater_predator_find_gasmix (shearwater_predator_parser_t *parser, unsigned int o2, unsigned int he, unsigned int dil)
|
shearwater_predator_find_gasmix (shearwater_predator_parser_t *parser, unsigned int o2, unsigned int he, unsigned int dil)
|
||||||
{
|
{
|
||||||
@ -659,8 +665,7 @@ shearwater_predator_parser_cache (shearwater_predator_parser_t *parser)
|
|||||||
for (unsigned int i = 0; i < ngasmixes; ++i) {
|
for (unsigned int i = 0; i < ngasmixes; ++i) {
|
||||||
if (gasmix[i].oxygen == 0 && gasmix[i].helium == 0)
|
if (gasmix[i].oxygen == 0 && gasmix[i].helium == 0)
|
||||||
continue;
|
continue;
|
||||||
if (gasmix[i].diluent &&
|
if (gasmix[i].diluent && !shearwater_predator_is_ccr (divemode))
|
||||||
(divemode != M_CC && divemode != M_CC2 && divemode != M_SC))
|
|
||||||
continue;
|
continue;
|
||||||
parser->gasmix[parser->ngasmixes] = gasmix[i];
|
parser->gasmix[parser->ngasmixes] = gasmix[i];
|
||||||
parser->ngasmixes++;
|
parser->ngasmixes++;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user