summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Seppo Takalo <seppo.takalo@iki.fi>2017-09-13 17:45:58 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-09-13 07:57:45 -0700
commit6509f2ed9f5fe59dc75b94c645fddeb3758f5242 (patch)
tree321763a463e0f10fa3019121fd05d76848b0c666 /core
parente25cecf37caa9d526de5dab102411798f42fd5e9 (diff)
downloadsubsurface-6509f2ed9f5fe59dc75b94c645fddeb3758f5242.tar.gz
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 <seppo.takalo@iki.fi>
Diffstat (limited to 'core')
-rw-r--r--core/parse-xml.c7
1 files changed, 4 insertions, 3 deletions
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();