VPM-B restore deco state before calculating next gradient

The next gradient calculation at the start of the CVA loop should be performed
using the tissue loading before starting the iterations, rather than the loading
at the end of the previous iteration.

Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Rick Walsh 2015-09-17 07:18:16 +10:00 committed by Dirk Hohndel
parent 95720e94ee
commit 3d8e5b638a

View file

@ -1142,11 +1142,11 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
//CVA //CVA
do { do {
is_final_plan = (prefs.deco_mode == BUEHLMANN) || (previous_deco_time - deco_time < 10); // CVA time converges is_final_plan = (prefs.deco_mode == BUEHLMANN) || (previous_deco_time - deco_time < 10); // CVA time converges
restore_deco_state(bottom_cache);
if (deco_time != 10000000) if (deco_time != 10000000)
vpmb_next_gradient(deco_time, diveplan->surface_pressure / 1000.0); vpmb_next_gradient(deco_time, diveplan->surface_pressure / 1000.0);
previous_deco_time = deco_time; previous_deco_time = deco_time;
restore_deco_state(bottom_cache);
depth = bottom_depth; depth = bottom_depth;
gi = bottom_gi; gi = bottom_gi;