From 68c2b10161fb8bfb7572a058586b33f652aea47c Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Sun, 29 Oct 2017 17:48:30 +1100 Subject: VPM-B ceiling: calculate deco_time similar to planned VPM-B dives When planning a VPM-B dive, the "deco time" ends at surfacing, which is after ascending after a full-minute deco stop is complete, after ceiling clears. We should take this into account when calculating the ceiling outside of the planner. Signed-off-by: Rick Walsh --- core/profile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/profile.c b/core/profile.c index d62caab93..ce053a67c 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1085,7 +1085,9 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru if (final_tts > 0) deco_time = pi->maxtime + final_tts - time_deep_ceiling; else if (time_clear_ceiling > 0) - deco_time = time_clear_ceiling - time_deep_ceiling; + /* Consistent with planner, deco_time ends after ascending (20-40s @9m/min from 3-6m) + at end of whole minute after clearing ceiling */ + deco_time = ROUND_UP(time_clear_ceiling, 60) + 30 - time_deep_ceiling; vpmb_next_gradient(deco_time, surface_pressure / 1000.0); final_tts = 0; last_ndl_tts_calc_time = 0; -- cgit v1.2.3-70-g09d2