diff options
-rw-r--r-- | core/planner.c | 7 | ||||
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/core/planner.c b/core/planner.c index aaabeddf7..ded265c36 100644 --- a/core/planner.c +++ b/core/planner.c @@ -825,11 +825,12 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i if ((divemode == CCR || divemode == PSCR) && prefs.dobailout) { divemode = OC; po2 = 0; + int bailoutsegment = MAX(prefs.min_switch_duration, 60 * prefs.problemsolvingtime); add_segment(ds, depth_to_bar(depth, dive), get_cylinder(dive, current_cylinder)->gasmix, - prefs.min_switch_duration, po2, divemode, prefs.bottomsac); - plan_add_segment(diveplan, prefs.min_switch_duration, depth, current_cylinder, po2, false, divemode); - clock += prefs.min_switch_duration; + bailoutsegment, po2, divemode, prefs.bottomsac); + plan_add_segment(diveplan, bailoutsegment, depth, current_cylinder, po2, false, divemode); + clock += bailoutsegment; last_segment_min_switch = true; } previous_deco_time = 100000000; diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index ce31fb32d..cd0ae2c2d 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -606,6 +606,7 @@ void PlannerSettingsWidget::setBackgasBreaks(bool dobreaks) void PlannerSettingsWidget::setBailoutVisibility(int mode) { ui.bailout->setDisabled(!(mode == CCR || mode == PSCR)); + ui.sacFactor->setDisabled(mode == CCR); } PlannerDetails::PlannerDetails(QWidget *parent) : QWidget(parent) |