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 <rickmwalsh@gmail.com>
This commit is contained in:
Rick Walsh 2017-10-29 17:48:30 +11:00 committed by Robert C. Helling
parent f2535995f0
commit 68c2b10161

View file

@ -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;