From a8bcfb998b9c400e42b98db437cbf1aba6c13bfc Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 28 Sep 2021 12:28:14 +0200 Subject: [PATCH] Restore the original standard gravity factor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Uwatec/Scubapro dive computers are confirmed to internally use the approximated standard gravity (10.0 m/s²) for the depth conversion. Allthough this is technically wrong, users expect to get the same depth values as their dive computer shows. This partially reverts commit cfc9ddc380bdc5616893fc2af4e05204b5500ea2. --- src/uwatec_smart_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uwatec_smart_parser.c b/src/uwatec_smart_parser.c index 7a12a4e..3e4ed09 100644 --- a/src/uwatec_smart_parser.c +++ b/src/uwatec_smart_parser.c @@ -801,7 +801,7 @@ uwatec_smart_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi *((unsigned int *) value) = array_uint16_le (data + table->divetime) * 60; break; case DC_FIELD_MAXDEPTH: - *((double *) value) = array_uint16_le (data + table->maxdepth) * (BAR / 1000.0) / (density * GRAVITY); + *((double *) value) = array_uint16_le (data + table->maxdepth) * (BAR / 1000.0) / (density * 10.0); break; case DC_FIELD_GASMIX_COUNT: *((unsigned int *) value) = parser->ngasmixes; @@ -1233,7 +1233,7 @@ uwatec_smart_parse (uwatec_smart_parser_t *parser, dc_sample_callback_t callback } if (have_depth) { - sample.depth = (signed int)(depth - depth_calibration) * (2.0 * BAR / 1000.0) / (density * GRAVITY); + sample.depth = (signed int)(depth - depth_calibration) * (2.0 * BAR / 1000.0) / (density * 10.0); if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata); }