[PATCH 2/2] Don't ignore surface events from libdivecomputer

Linus Torvalds torvalds at linux-foundation.org
Tue May 31 10:14:24 PDT 2016


From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Tue, 31 May 2016 09:57:20 -0700
Subject: [PATCH 2/2] Don't ignore surface events from libdivecomputer

There are cases where we actually want to keep them, as exemplified by
this situation from Richard Yorke:

  "I have just come across a situation when ignoring the surface marker
   is a disadvantage.  I have just had a problem with my BC feed
   seeping, slowly filling my BC and as I control my buoyancy on the
   bottom using the air in my drysuit, I did not notice, so that when I
   came to ascend the expanding air in my BC caused a loss of control.

   Fortunately not from a great depth and no untoward consequences.
   However, the Subsurface profile only shows me rising to 4m and
   descending to 5.5m for my safety stop.  However I actually broke the
   surface and descented to 5.5 but the frequency of recording depth was
   not fast enough to show this as it was so brief"

so remove the code that ignores the surface events entirely.

I think we'll have to come up with some smarter filtering model for
showing them, but that is predicated on getting these events to come
through in the first place.

Reported-by: Richard Yorke <yorke.richard at gmail.com>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

Richard - if you build your own subsurface I'd love to see that dive as an 
xml file with this patch in place, so that I'll have a test-case for it.

And if not, hopefully Dirk will have a daily build with this at some 
point.


 core/libdivecomputer.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c
index 549b894ce76a..e7f88a517b5b 100644
--- a/core/libdivecomputer.c
+++ b/core/libdivecomputer.c
@@ -208,14 +208,6 @@ static void handle_event(struct divecomputer *dc, struct sample *sample, dc_samp
 	};
 	const int nr_events = sizeof(events) / sizeof(const char *);
 	const char *name;
-	/*
-	 * Just ignore surface events.  They are pointless.  What "surface"
-	 * means depends on the dive computer (and possibly even settings
-	 * in the dive computer). It does *not* necessarily mean "depth 0",
-	 * so don't even turn it into that.
-	 */
-	if (value.event.type == SAMPLE_EVENT_SURFACE)
-		return;
 
 	/*
 	 * Other evens might be more interesting, but for now we just print them out.
-- 
2.9.0.rc0.21.g7777322



More information about the subsurface mailing list