mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add 3min safety stop
Fixes #839 Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8571dcf967
commit
cd34fea1db
1 changed files with 9 additions and 0 deletions
|
@ -905,6 +905,7 @@ int plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool s
|
||||||
bottom_time = clock = previous_point_time = displayed_dive.dc.sample[displayed_dive.dc.samples - 1].time.seconds;
|
bottom_time = clock = previous_point_time = displayed_dive.dc.sample[displayed_dive.dc.samples - 1].time.seconds;
|
||||||
gi = gaschangenr - 1;
|
gi = gaschangenr - 1;
|
||||||
if(prefs.recreational_mode) {
|
if(prefs.recreational_mode) {
|
||||||
|
bool safety_stop = true;
|
||||||
// How long can we stay at the current depth and still directly ascent to the surface?
|
// How long can we stay at the current depth and still directly ascent to the surface?
|
||||||
while (trial_ascent(depth, 0, avg_depth, bottom_time, tissue_tolerance, &displayed_dive.cylinder[current_cylinder].gasmix,
|
while (trial_ascent(depth, 0, avg_depth, bottom_time, tissue_tolerance, &displayed_dive.cylinder[current_cylinder].gasmix,
|
||||||
po2, diveplan->surface_pressure / 1000.0)) {
|
po2, diveplan->surface_pressure / 1000.0)) {
|
||||||
|
@ -932,6 +933,14 @@ int plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool s
|
||||||
TIMESTEP, po2, &displayed_dive, prefs.decosac);
|
TIMESTEP, po2, &displayed_dive, prefs.decosac);
|
||||||
clock += TIMESTEP;
|
clock += TIMESTEP;
|
||||||
depth -= deltad;
|
depth -= deltad;
|
||||||
|
if (depth <= 5000 && safety_stop) {
|
||||||
|
plan_add_segment(diveplan, clock - previous_point_time, 5000, gas, po2, false);
|
||||||
|
previous_point_time = clock;
|
||||||
|
clock += 180;
|
||||||
|
plan_add_segment(diveplan, clock - previous_point_time, 5000, gas, po2, false);
|
||||||
|
previous_point_time = clock;
|
||||||
|
safety_stop = false;
|
||||||
|
}
|
||||||
} while (depth > 0);
|
} while (depth > 0);
|
||||||
plan_add_segment(diveplan, clock - previous_point_time, 0, gas, po2, false);
|
plan_add_segment(diveplan, clock - previous_point_time, 0, gas, po2, false);
|
||||||
create_dive_from_plan(diveplan, is_planner);
|
create_dive_from_plan(diveplan, is_planner);
|
||||||
|
|
Loading…
Add table
Reference in a new issue