diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-08-23 16:04:59 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-23 07:30:23 -0700 |
commit | 41349c29ddc45e7c19fc287f10fa8f6712bcf111 (patch) | |
tree | 4a49e3afcc7ce9086edd3d3b0518155ea82c3f21 /planner.c | |
parent | cb375623f956c99c211bba0c18ace688e7eb6942 (diff) | |
download | subsurface-41349c29ddc45e7c19fc287f10fa8f6712bcf111.tar.gz |
Prepare global state of VPM-B when starting to plan
Otherwise, the results of the calculations tend to be rather
random and irreproducible...
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -997,6 +997,13 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool create_dive_from_plan(diveplan, is_planner); return(false); } + calc_crushing_pressure(depth_to_mbar(depth, &displayed_dive) / 1000.0); + nuclear_regeneration(clock); + clear_deco(displayed_dive.surface_pressure.mbar / 1000.0); + vpmb_start_gradient(); + previous_deco_time = 100000000; + deco_time = 10000000; + tissue_tolerance = tissue_at_end(&displayed_dive, cached_datap); displayed_dive.surface_pressure.mbar = diveplan->surface_pressure; @@ -1124,7 +1131,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool vpmb_next_gradient(deco_time, diveplan->surface_pressure / 1000.0); previous_deco_time = deco_time; - restore_deco_state(bottom_cache); + tissue_tolerance = restore_deco_state(bottom_cache); depth = bottom_depth; gi = bottom_gi; |