From 6509f2ed9f5fe59dc75b94c645fddeb3758f5242 Mon Sep 17 00:00:00 2001 From: Seppo Takalo Date: Wed, 13 Sep 2017 17:45:58 +0300 Subject: Ignore missing pressure values when importing from Shearwater Shearwater seems to report missing AI sensors as a pressure reading 4092 (raw) which is 564 bar. Signed-off-by: Seppo Takalo --- core/parse-xml.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/parse-xml.c b/core/parse-xml.c index 0e7b93ae8..50962aac2 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -2759,11 +2759,12 @@ extern int shearwater_ai_profile_sample(void *handle, int columns, char **data, if (data[6]) cur_sample->stopdepth.mm = metric ? atoi(data[6]) * 1000 : feet_to_mm(atoi(data[6])); - /* Weird unit conversion but seems to produce correct results */ - if (data[7]) { + /* Weird unit conversion but seems to produce correct results. + * Also missing values seems to be reported as a 4092 (564 bar) */ + if (data[7] && atoi(data[7]) != 4092) { cur_sample->pressure[0].mbar = psi_to_mbar(atoi(data[7])) * 2; } - if (data[8]) + if (data[8] && atoi(data[8]) != 4092) cur_sample->pressure[1].mbar = psi_to_mbar(atoi(data[8])) * 2; sample_end(); -- cgit v1.2.3-70-g09d2