summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2015-08-29 21:51:35 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-29 20:06:43 -0700
commit2d45e587ba95eacbec41439931f06520fc22df73 (patch)
tree81ac5ce04355059b2b966ed81a9f9f8fe780548c /planner.c
parent7d09f418f85372cdd1e8f8841444a5d8c7eb6f1f (diff)
downloadsubsurface-2d45e587ba95eacbec41439931f06520fc22df73.tar.gz
VPM-B: Calculate crushing pressure on descent
By calculating crushing pressure after the manually entered phase, we were doing it wrong for multi-level dives. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/planner.c b/planner.c
index ae90938c2..0b5bd9b8e 100644
--- a/planner.c
+++ b/planner.c
@@ -110,6 +110,9 @@ double interpolate_transition(struct dive *dive, duration_t t0, duration_t t1, d
int depth = interpolate(d0.mm, d1.mm, j - t0.seconds, t1.seconds - t0.seconds);
tissue_tolerance = add_segment(depth_to_mbar(depth, dive) / 1000.0, gasmix, 1, po2.mbar, dive, prefs.bottomsac);
}
+ if (d1.mm > d0.mm)
+ calc_crushing_pressure(depth_to_mbar(d1.mm, &displayed_dive) / 1000.0);
+
return tissue_tolerance;
}
@@ -997,7 +1000,6 @@ 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();