summaryrefslogtreecommitdiffstats
path: root/uemis.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-10 09:37:23 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-11-10 11:54:14 +0100
commitcc53a0cf5c4748853884eb92b100f0e406b015ae (patch)
treebe7f89e921058162ca654dc02f699b1b62688e95 /uemis.c
parent4da31687688da9f89a5ef6288ea8920736f2ec1b (diff)
downloadsubsurface-cc53a0cf5c4748853884eb92b100f0e406b015ae.tar.gz
Use correct surface pressure to detect ceiling with Uemis Zurich
The dive data contains the surface pressure prior to the dive, and that is what we need to compare p_amb_tol to, not the standard 1013mbar. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis.c')
-rw-r--r--uemis.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/uemis.c b/uemis.c
index 8758b7f38..c12b53c8e 100644
--- a/uemis.c
+++ b/uemis.c
@@ -180,7 +180,9 @@ void uemis_event(struct dive *dive, struct sample *sample, uemis_sample_t *u_sam
* warnings / alerts - not useful for events */
/* now add deco / ceiling events */
- if (u_sample->p_amb_tol > 1013 && u_sample->hold_time && u_sample->hold_time < 99) {
+ if (u_sample->p_amb_tol > dive->surface_pressure.mbar &&
+ u_sample->hold_time &&
+ u_sample->hold_time < 99) {
add_event(dive, sample->time.seconds, SAMPLE_EVENT_CEILING, SAMPLE_FLAGS_BEGIN,
u_sample->hold_depth * 10, N_("ceiling"));
add_event(dive, sample->time.seconds, SAMPLE_EVENT_DECOSTOP, 0,
@@ -210,7 +212,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
datalen = uemis_convert_base64(base64, &data);
dive->airtemp.mkelvin = *(uint16_t *)(data + 45) * 100 + 273150;
-
+ dive->surface_pressure.mbar = *(uint16_t *)(data +43);
/* dive template in use:
0 = air
1 = nitrox (B)