diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-08-19 23:14:00 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-08-20 07:28:00 -0700 |
commit | 0bb65a17cb77084a345f12581b5b39f4dafcae4a (patch) | |
tree | 51cbce1e73959117fd43f174c97c19413227fa2a /planner.c | |
parent | 2a5073113927f5ab5e6f38a7ac6382bd44e7ad5b (diff) | |
download | subsurface-0bb65a17cb77084a345f12581b5b39f4dafcae4a.tar.gz |
Use boyle_compensation in profile
otherwise VPM-B planned profiles seem to violate the ceiling. This needs
the first_stop_pressure to be available also in the profile, so I made
it global in planner.c
Important lesson: If you want to use deco_allowed_depth on a tissue_tolerance
that comes from a VPM-B planned dive, you have to call boyles_law() before
add_segment()!
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -33,6 +33,8 @@ int decostoplevels_imperial[] = { 0, 3048, 6096, 9144, 12192, 15240, 18288, 2133 double plangflow, plangfhigh; bool plan_verbatim, plan_display_runtime, plan_display_duration, plan_display_transitions; +int first_stop_pressure; + const char *disclaimer; #if DEBUG_PLAN @@ -921,7 +923,6 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool int bottom_depth; int bottom_gi; int bottom_stopidx; - int first_stop_pressure; bool is_final_plan = true; int deco_time; int previous_deco_time; @@ -996,6 +997,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool return(false); } tissue_tolerance = tissue_at_end(&displayed_dive, cached_datap); + displayed_dive.surface_pressure.mbar = diveplan->surface_pressure; #if DEBUG_PLAN & 4 printf("gas %s\n", gasname(&gas)); @@ -1160,7 +1162,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool // 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); + boyles_law(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 @@ -1215,7 +1217,7 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool // 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); + boyles_law(depth_to_mbar(stoplevels[stopidx], &displayed_dive) / 1000.0); } /* Are we waiting to switch gas? |