From f53788e5e4066f0ef36041031de6bc2726274fc9 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 10 Nov 2012 19:18:10 +0100 Subject: Add support for obtaining salinity from libdivecomputer This requires a patched libdivecomputer that can return salinity of the water the dive was conducted in. Experimental patches exist that implement this for the OSTC. The code is designed so that it simply defaults to salt water if libdivecomputer doesn't include the feature. The patch also fixes the dive merge code to merge two other recent additions to the dive structure (surface_pressure and visibility). Signed-off-by: Dirk Hohndel --- dive.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dive.c') diff --git a/dive.c b/dive.c index d9193e398..19d3cc5b0 100644 --- a/dive.c +++ b/dive.c @@ -1082,6 +1082,9 @@ struct dive *try_to_merge(struct dive *a, struct dive *b, struct dive *next) MERGE_MAX(res, a, b, number); MERGE_MAX(res, a, b, maxdepth.mm); res->meandepth.mm = 0; + MERGE_NONZERO(res, a, b, salinity); + MERGE_NONZERO(res, a, b, visibility); + MERGE_NONZERO(res, a, b, surface_pressure.mbar); MERGE_MAX(res, a, b, duration.seconds); MERGE_MAX(res, a, b, surfacetime.seconds); MERGE_MAX(res, a, b, airtemp.mkelvin); -- cgit v1.2.3-70-g09d2