summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Jan Darowski <jan.darowski@gmail.com>2015-08-18 13:20:56 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-18 06:34:54 -0700
commit39794d34787a95c06eb4036e233289390c3a751f (patch)
tree77a94e332ad62ae37cd4de9764ddff595575e27f /planner.c
parent075221b4efa1a6b33d82bf277e704f4e2f19cc9f (diff)
downloadsubsurface-39794d34787a95c06eb4036e233289390c3a751f.tar.gz
VPM-B: Fix calculating Boyles compensation on gas change stops.
Previously we were calculating the compensation only on the deco stops, gas change stops appearing before the first deco stop were ommited. Signed-off-by: Jan Darowski <jan.darowski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/planner.c b/planner.c
index a4aacc053..42b096906 100644
--- a/planner.c
+++ b/planner.c
@@ -1168,6 +1168,11 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
previous_point_time = clock;
stopping = true;
+ // Boyles Law compensation
+ if (first_stop_pressure == 0)
+ first_stop_pressure = depth_to_mbar(depth, &displayed_dive);
+ boyles_law(first_stop_pressure / 1000.0, depth_to_mbar(stoplevels[stopidx], &displayed_dive) / 1000.0);
+
/* Check we need to change cylinder.
* We might not if the cylinder was chosen by the user
* or user has selected only to switch only at required stops.