From 8dfc4dccc5b74626100952cf78fec8b10751fa33 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 8 Dec 2012 21:20:00 -0800 Subject: 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 --- profile.c | 5 +++++ 1 file changed, 5 insertions(+) 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) -- cgit v1.2.3-70-g09d2