diff options
author | Rick Walsh <rickmwalsh@gmail.com> | 2017-11-02 21:26:30 +1100 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2017-11-08 15:22:32 +0100 |
commit | e365cac54ec5e9bd00e97d6d977684c9cd7474ef (patch) | |
tree | 2173ed631b474ee01334183e848f15acecd5dece /core/profile.c | |
parent | 4a727c64d9ac56e926eea43ee7be7685ef6d76ec (diff) | |
download | subsurface-e365cac54ec5e9bd00e97d6d977684c9cd7474ef.tar.gz |
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 <rickmwalsh@gmail.com>
Diffstat (limited to 'core/profile.c')
-rw-r--r-- | core/profile.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; |