summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-08 21:20:00 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-08 21:23:45 -0800
commit8dfc4dccc5b74626100952cf78fec8b10751fa33 (patch)
tree430b7d8469205f9521361ab556e82a761e23beb1
parent07b74007f1731b6557ec05300d5734970fb9d29c (diff)
downloadsubsurface-8dfc4dccc5b74626100952cf78fec8b10751fa33.tar.gz
Don't print an initial gaschange event that just tells us the gas used
Some dive computers appear to tell us the gas used in a gaschange event right at the beginning of the dive. We arbitrary have a cut-off that says "a gas change in the first 30 seconds shouldn't get a marker". Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--profile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index 290638d6a..7e42c6083 100644
--- a/profile.c
+++ b/profile.c
@@ -357,6 +357,11 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st
}
}
}
+ if (event->time.seconds < 30 && !strcmp(event->name, "gaschange"))
+ /* a gas change in the first 30 seconds is the way of some dive computers
+ * to tell us the gas that is used; let's not plot a marker for that */
+ return;
+
for (i = 0; i < pi->nr; i++) {
struct plot_data *data = pi->entry + i;
if (event->time.seconds < data->sec)