From e365cac54ec5e9bd00e97d6d977684c9cd7474ef Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Thu, 2 Nov 2017 21:26:30 +1100 Subject: VPMB in profile: deepest ceiling occurs just after bottom time This lets us calculate deco_time for real dives closer to the planner value. Signed-off-by: Rick Walsh --- core/profile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/profile.c b/core/profile.c index 83ff20055..419c60584 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1085,8 +1085,10 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru deco_time = pi->maxtime + final_tts - time_deep_ceiling; else if (time_clear_ceiling > 0) /* Consistent with planner, deco_time ends after ascending (20s @9m/min from 3m) - at end of whole minute after clearing ceiling */ - deco_time = ROUND_UP(time_clear_ceiling, 60) + 20 - time_deep_ceiling; + * at end of whole minute after clearing ceiling. The deepest ceiling when planning a dive + * comes typically 10-60s after the end of the bottom time, so add 20s to the calculated + * deco time. */ + deco_time = ROUND_UP(time_clear_ceiling - time_deep_ceiling + 20, 60) + 20; vpmb_next_gradient(deco_time, surface_pressure / 1000.0); final_tts = 0; last_ndl_tts_calc_time = 0; -- cgit v1.2.3-70-g09d2