VPMB: calculate deco_time assuming final ascent always takes the same time

If we consider the actual time to ascend from the final stop when calculating
deco_time, then slowing the final ascent can lead to the final stop being
extended, which is completely nonsensical.  For consistency with the original
VPMB implementation, we can't ignore the final ascent time completely, but if
we assume it is always the same (take default ascent rate of 9m/min) then
slower the final ascent won't lead to a longer final stop.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
This commit is contained in:
Rick Walsh 2017-11-02 19:34:45 +11:00 committed by Robert C. Helling
parent a06848c237
commit 4a727c64d9
2 changed files with 7 additions and 4 deletions

View file

@ -1084,9 +1084,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)
/* Consistent with planner, deco_time ends after ascending (20-40s @9m/min from 3-6m)
/* 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) + 30 - time_deep_ceiling;
deco_time = ROUND_UP(time_clear_ceiling, 60) + 20 - time_deep_ceiling;
vpmb_next_gradient(deco_time, surface_pressure / 1000.0);
final_tts = 0;
last_ndl_tts_calc_time = 0;