diff options
author | Robert C. Helling <helling@atdotde.de> | 2019-03-20 16:29:27 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-03-29 06:51:12 -0700 |
commit | 5e494ce76106fe16f614e163c2bc6b8bf6903c86 (patch) | |
tree | 5162c2523e8a731eda22ce464e72c1d42124616d /core/plannernotes.c | |
parent | 7635ee3e776f7adb96dda70ea21920569368ae30 (diff) | |
download | subsurface-5e494ce76106fe16f614e163c2bc6b8bf6903c86.tar.gz |
Show a bit of surface degassing in the planner
to display the deco parameters at the surface,
in particular tissue saturation and heat map.
Suggeted-by: Matthias Heinrichs <info@heinrichsweikamp.com>
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'core/plannernotes.c')
-rw-r--r-- | core/plannernotes.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/core/plannernotes.c b/core/plannernotes.c index 90f37add7..99f456393 100644 --- a/core/plannernotes.c +++ b/core/plannernotes.c @@ -24,9 +24,12 @@ static int diveplan_duration(struct diveplan *diveplan) { struct divedatapoint *dp = diveplan->dp; int duration = 0; + int lastdepth = 0; while(dp) { - if (dp->time > duration) + if (dp->time > duration && (dp->depth.mm > SURFACE_THRESHOLD || lastdepth > SURFACE_THRESHOLD)) { duration = dp->time; + lastdepth = dp->depth.mm; + } dp = dp->next; } return (duration + 30) / 60; @@ -193,6 +196,9 @@ void add_plan_to_notes(struct diveplan *diveplan, struct dive *dive, bool show_d !rebreatherchange_before && !rebreatherchange_after) continue; + // Ignore final surface segment for notes + if (lastdepth == 0 && dp->depth.mm == 0 && !dp->next) + continue; if ((dp->time - lasttime < 10 && lastdepth == dp->depth.mm) && !(gaschange_after && dp->next && dp->depth.mm != dp->next->depth.mm)) continue; |