Robert,

As briefly discussed and I think agreed on IRC, I think we ought at least
consider dropping a couple of "special" methods we use just for VPM-B.
They were implemented with the objective of simulating what we believe
other software does, but don't appear to serve any good purpose and have a
marginal effect on the calculated plan.

Either or both patch can be applied.

No doubt you could, and probably have in your testing already, make these
changes.  But to be clear, and hopefully to get more testing and comment
from others, I'm sending to the list too.

Jan, do you have thoughts on this?

Dirk, these patches are for discussion, please don't apply them just yet.

Cheers,

Rick
From c08e4123ee5e4dd600c4b092d9e83e5abb5a2638 Mon Sep 17 00:00:00 2001
From: Rick Walsh <[email protected]>
Date: Mon, 24 Aug 2015 21:16:13 +1000
Subject: [PATCH 1/4] Revert "Compare ceiling to next stop rather than try to
 ascent for VPM-B"

This reverts commit 159c9eb2c1c19dfbf650f2b0cc28e0ef1f45c964.

There doesn't appear to be a problem with doing a trial ascent as we did before
---
 planner.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/planner.c b/planner.c
index 5afc117..fc83466 100644
--- a/planner.c
+++ b/planner.c
@@ -873,12 +873,6 @@ bool trial_ascent(int trial_depth, int stoplevel, int avg_depth, int bottom_time
 	bool clear_to_ascend = true;
 	char *trial_cache = NULL;
 
-	// For VPM-B it is not relevant if we would violate a ceiling during ascent to the next stop but
-	// if the next stop is below the ceiling at the start of the ascent (thus the offgasing during
-	// the ascent is ignored.
-	if (prefs.deco_mode == VPMB)
-		return (deco_allowed_depth(tissue_tolerance, surface_pressure, &displayed_dive, 1) <= stoplevel);
-
 	cache_deco_state(tissue_tolerance, &trial_cache);
 	while (trial_depth > stoplevel) {
 		int deltad = ascent_velocity(trial_depth, avg_depth, bottom_time) * TIMESTEP;
-- 
2.4.3

From 598cfea0eff0751d426f540a943435852b3a11dd Mon Sep 17 00:00:00 2001
From: Rick Walsh <[email protected]>
Date: Mon, 24 Aug 2015 21:18:58 +1000
Subject: [PATCH 2/4] VPM-B: Don't round up first_stop_depth to next stop

The variable first_stop_depth is used as the ceiling at the start of the ascent,
not the actual stop depth.  There doesn't appear to be a need no need to round
it up to the next allowable stop depth.

Signed-off-by: Rick Walsh <[email protected]>
---
 planner.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/planner.c b/planner.c
index fc83466..5ee631a 100644
--- a/planner.c
+++ b/planner.c
@@ -1106,13 +1106,6 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
 	// Find first stop used for VPM-B Boyle's law compensation
 	if (prefs.deco_mode == VPMB) {
 		vpmb_first_stop = deco_allowed_depth(tissue_tolerance, diveplan->surface_pressure / 1000, &displayed_dive, 1);
-		if (vpmb_first_stop > 0) {
-			while (stoplevels[stopidx] > vpmb_first_stop) {
-				stopidx--;
-			}
-			stopidx++;
-			vpmb_first_stop = stoplevels[stopidx];
-		}
 		first_stop_pressure.mbar = depth_to_mbar(vpmb_first_stop, &displayed_dive);
 	} else {
 		first_stop_pressure.mbar = 0;
-- 
2.4.3

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to