From ff0328537ec18ee92bd4f0538f629b1795a52772 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Wed, 5 Jul 2023 23:54:16 +0200 Subject: [PATCH] Ignore the diluents for open-circuit dives For open-circuit dives it makes no sense to also include the configured diluents. Usually those diluents are only present because the diver uses the same dive computer for both open and closed circuit dives. --- src/shearwater_predator_parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/shearwater_predator_parser.c b/src/shearwater_predator_parser.c index 749fe3c..b6aa7e2 100644 --- a/src/shearwater_predator_parser.c +++ b/src/shearwater_predator_parser.c @@ -659,6 +659,9 @@ shearwater_predator_parser_cache (shearwater_predator_parser_t *parser) for (unsigned int i = 0; i < ngasmixes; ++i) { if (gasmix[i].oxygen == 0 && gasmix[i].helium == 0) continue; + if (gasmix[i].diluent && + (divemode != M_CC && divemode != M_CC2 && divemode != M_SC)) + continue; parser->gasmix[parser->ngasmixes] = gasmix[i]; parser->ngasmixes++; }