From 5632c0b357bef09555b475212b619cb2eaddd7d5 Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Tue, 17 Feb 2015 19:27:59 +0200 Subject: Add limits to cylinder maximum pressures on DM5 import DM5 seems to have occasionally bogus data for cylinder start and end pressures. Need to validate that. Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- parse-xml.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parse-xml.c b/parse-xml.c index 5a49e2af8..b11970137 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -2220,11 +2220,11 @@ extern int dm5_dive(void *param, int columns, char **data, char **column) * TODO: handle multiple cylinders */ cylinder_start(); - if (data[22] && atoi(data[22]) > 0) + if (data[22] && atoi(data[22]) > 0 && atoi(data[22]) < 350000) cur_dive->cylinder[cur_cylinder_index].start.mbar = atoi(data[22]); else if (data[10] && atoi(data[10]) > 0) cur_dive->cylinder[cur_cylinder_index].start.mbar = atoi(data[10]); - if (data[23] && atoi(data[23]) > 0) + if (data[23] && atoi(data[23]) > 0 && atoi(data[23]) < 350000) cur_dive->cylinder[cur_cylinder_index].end.mbar = (atoi(data[23])); if (data[11] && atoi(data[11]) > 0) cur_dive->cylinder[cur_cylinder_index].end.mbar = (atoi(data[11])); -- cgit v1.2.3-70-g09d2