summaryrefslogtreecommitdiffstats
path: root/statistics.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-28 13:48:15 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-28 14:04:19 -0700
commite32ba4d6d8115176e1ce0f4960926985b52164ca (patch)
tree8b45963724d70eaf69d2af61b81c27c836a1213e /statistics.c
parent874754e22b8678ab3d5314c56fda860ea844fc55 (diff)
downloadsubsurface-e32ba4d6d8115176e1ce0f4960926985b52164ca.tar.gz
Improve tank handling for Cobalt
This isn't Cobalt specific, this is specific to dive computers that indicate the first tank that's in use with a gaschange event that coincides with the first sample. We need to make sure that we suppress showing that gas change event (regardless which cylinder it goes to) and instead set the correct cylinder index from the very start of the dive. This works with the test data I have and doesn't seem to break thing with any of the files that I tried... but I'm worried that this is not the right way to do things. Fixes #742 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'statistics.c')
-rw-r--r--statistics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/statistics.c b/statistics.c
index 01adf4f14..d78e4a862 100644
--- a/statistics.c
+++ b/statistics.c
@@ -302,7 +302,7 @@ bool is_cylinder_used(struct dive *dive, int idx)
for_each_dc(dive, dc) {
struct event *event = get_next_event(dc->events, "gaschange");
while (event) {
- if (event->time.seconds < 30)
+ if (event->time.seconds < 30 || event->time.seconds == dc->sample[0].time.seconds)
firstGasExplicit = true;
if (get_cylinder_index(dive, event) == idx)
return true;