Hi Dirk,

On 18 Aug 2015, at 07:23, Dirk Hohndel <[email protected]> wrote:

I think I have most of this applied and pushed now - but I'm not sure.
There were some patches from Rick and some other strays here and there
that I wasn't quite sure what to do with. Also, there were several
conflicts when applying Jan's and Robert's patches.

I'd appreciate if Robert / Jan / Rick and anyone else interested in the
planner and VPM-B implementation could look at the latest master and make
sure that I have all the relevant patches (and resend the ones that I
missed).

From 14bde72fcba58da2e71c9951156e8b8d20f5c2cd Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Tue, 18 Aug 2015 09:07:50 +0200
Subject: [PATCH 1/2] Compare ceiling to next stop rather than try to ascent
 for VPM-B

For VPM-B, to stay within the reference implementation, to decide if we
need to stop we check if the current ceiling is above the next stop depth
rather than trying to ascent and check if we violate a ceiling. This
leads to more conservative profiles.

Signed-off-by: Robert C. Helling <[email protected]>
---
 planner.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/planner.c b/planner.c
index d6efb61..0cb2f4d 100644
--- a/planner.c
+++ b/planner.c
@@ -879,6 +879,12 @@ 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;
-- 
1.9.5 (Apple Git-50.3)

From d15b2858f89c8a039c69ded09ec662a1c9b424cd Mon Sep 17 00:00:00 2001
From: "Robert C. Helling" <[email protected]>
Date: Tue, 18 Aug 2015 09:13:39 +0200
Subject: [PATCH 2/2] Get rid of is_ok_vpmb

Since a8ce8, that made deco_allowed_depth work for VPM-B as well, this
function became obsolete but was reintroduced by one of Jan's latest patches.

Signed-off-by: Robert C. Helling <[email protected]>
---
 deco.c    | 15 ---------------
 dive.h    |  1 -
 planner.c |  4 ----
 3 files changed, 20 deletions(-)

diff --git a/deco.c b/deco.c
index 15c61d2..3c7b9c1 100644
--- a/deco.c
+++ b/deco.c
@@ -280,21 +280,6 @@ double calc_surface_phase(double surface_pressure, double 
he_pressure, double n2
        return 0;
 }
 
-bool is_vpmb_ok(double pressure)
-{
-       int ci;
-       double gradient;
-       double gas_tension;
-
-       for (ci = 0; ci < 16; ++ci) {
-               gas_tension = tissue_n2_sat[ci] + tissue_he_sat[ci] + 
vpmb_config.other_gases_pressure;
-               gradient = gas_tension - pressure;
-               if (gradient > total_gradient[ci])
-                       return false;
-       }
-       return true;
-}
-
 void vpmb_start_gradient()
 {
        int ci;
diff --git a/dive.h b/dive.h
index d5681f1..ee3f637 100644
--- a/dive.h
+++ b/dive.h
@@ -801,7 +801,6 @@ extern double restore_deco_state(char *data);
 extern void nuclear_regeneration(double time);
 extern void vpmb_start_gradient();
 extern void vpmb_next_gradient(double deco_time, double surface_pressure);
-extern bool is_vpmb_ok(double pressure);
 extern void boyles_law(double first_stop_pressure, double next_stop_pressure);
 
 /* this should be converted to use our types */
diff --git a/planner.c b/planner.c
index 0cb2f4d..001f651 100644
--- a/planner.c
+++ b/planner.c
@@ -898,10 +898,6 @@ bool trial_ascent(int trial_depth, int stoplevel, int 
avg_depth, int bottom_time
                        clear_to_ascend = false;
                        break;
                }
-               if (prefs.deco_mode == VPMB && 
(!is_vpmb_ok(depth_to_mbar(trial_depth - deltad, &displayed_dive) / 1000.0))){
-                       clear_to_ascend = false;
-                       break;
-               }
                trial_depth -= deltad;
        }
        restore_deco_state(trial_cache);
-- 
1.9.5 (Apple Git-50.3)


since the opinion here on the list was to make the issue of trial_ascent/look directly at ceiling should not be user configurable, please revert  a6ed36fb7368254d694a4f397d6d033326c37ef2 Pref. to ascent to next stop only when stop is below ceiling and then apply 0001 here, which is the same except it looks at the deco mode rather than a new preference value.

In your conflict resolution, a patch of Jan reintroduced a function that was made obsolete by my earlier unification of deco_allowed_depth and 0002 clears this up.

Best
Robert

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

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

Reply via email to