Improve accuracy of the 'unlikely dive gas' warning.

Change the values supplied in the warning to be fractions. This is what
is actually reported by libdivecomputer. The currently used thousandths
are hard to interpret for users, as they are only used internally in
Subsurface.

Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
Michael Keller 2023-02-09 20:19:38 +13:00 committed by Dirk Hohndel
parent a1a834568a
commit b4af03751d

View file

@ -135,14 +135,14 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
if (o2 + he <= O2_IN_AIR || o2 > 1000) {
if (!shown_warning) {
shown_warning = true;
report_error("unlikely dive gas data from libdivecomputer: o2 = %d he = %d", o2, he);
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
}
o2 = 0;
}
if (he < 0 || o2 + he > 1000) {
if (!shown_warning) {
shown_warning = true;
report_error("unlikely dive gas data from libdivecomputer: o2 = %d he = %d", o2, he);
report_error("unlikely dive gas data from libdivecomputer: o2 = %.3f he = %.3f", gasmix.oxygen, gasmix.helium);
}
he = 0;
}