From 39794d34787a95c06eb4036e233289390c3a751f Mon Sep 17 00:00:00 2001 From: Jan Darowski Date: Tue, 18 Aug 2015 13:20:56 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- planner.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'planner.c') 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. -- cgit v1.2.3-70-g09d2