Correct: Handle more tanks than gasmixes

When Suunto Vytecs are used in gauge mode they don't record gasmixes.
If a tank pressure sensor is present they nevertheless record the
pressures. This patch handles this situation by assuming the tanks
contain air (and warning the user about this).

[Dirk Hohndel: I had mistakenly pushed out an earlier version of this
               commit, so this fixes things up to the final version]

Reported-by: antonnorth@gmail.com
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert Helling 2017-02-03 07:32:27 -08:00 committed by Dirk Hohndel
parent 8a8315d6fe
commit 67de8f3a49

View file

@ -96,10 +96,10 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
if (rc == DC_STATUS_SUCCESS) {
if (ntanks && ntanks < ngases) {
shown_warning = true;
report_error("Warning: different number of gases (%d) and tanks (%d)", ngases, ntanks);
report_error("Warning: different number of gases (%d) and cylinders (%d)", ngases, ntanks);
} else if (ntanks > ngases) {
shown_warning = true;
report_error("Warning: smaller number of gases (%d) than tanks (%d). Assuming air.", ngases, ntanks);
report_error("Warning: smaller number of gases (%d) than cylinders (%d). Assuming air.", ngases, ntanks);
}
}
#endif