aboutsummaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-30 18:11:01 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-30 18:17:21 -0800
commite3ab1c0701fceffa370d56bff187d0c0e90d5d21 (patch)
treea4c3dec2c1de47494f4ceec9e82b8f994c596455 /dive.c
parent46b64d8e21bd770c908cc883f3627f4f08a2c0a7 (diff)
downloadsubsurface-e3ab1c0701fceffa370d56bff187d0c0e90d5d21.tar.gz
Update deco handling
This commit makes deco handling in Subsurface more compatible with the way libdivecomputer creates the data. Previously we assumed that having a stopdepth or stoptime and no ndl meant that we were in deco. But libdivecomputer supports many dive computers that provide the deco state of the diver but with no information about the next stop or the time needed there. In order to be able to model this in Subsurface this adds an in_deco flag to the samples. This is only stored to the XML file when it changes so it doesn't add much overhead but will allow us to display some deco information on dive computers like the Atomic Aquatics Cobalt or many of the Suuntos (among others). The commit also removes the old event based deco code that was commented out already. And fixes the code so that the deco / ndl information is stored for the very last sample as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index 1c7e140d4..081c7eb25 100644
--- a/dive.c
+++ b/dive.c
@@ -721,6 +721,8 @@ add_sample_b:
sample.stoptime = as->stoptime;
if (as->stopdepth.mm)
sample.stopdepth = as->stopdepth;
+ if (as->in_deco)
+ sample.in_deco = TRUE;
merge_one_sample(&sample, at, res);