mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 06:15:26 +00:00
Disable o2 break option if last stop is not at 6m/20ft
Disable the possibility to plan o2 breaks of option "last stop at 6m/20ft" is not set. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
3ae0b5cbdd
commit
ac25b238dd
3 changed files with 19 additions and 1 deletions
|
@ -1000,7 +1000,7 @@ bool plan(struct diveplan *diveplan, struct dive *dive, int timestep, struct dec
|
|||
|
||||
o2breaking = false;
|
||||
stop_cylinder = current_cylinder;
|
||||
if (prefs.doo2breaks) {
|
||||
if (prefs.doo2breaks && prefs.last_stop) {
|
||||
/* The backgas breaks option limits time on oxygen to 12 minutes, followed by 6 minutes on
|
||||
* backgas. This could be customized if there were demand.
|
||||
*/
|
||||
|
|
|
@ -318,6 +318,21 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
|||
}
|
||||
}
|
||||
|
||||
void PlannerSettingsWidget::disableBackgasBreaks(bool enabled)
|
||||
{
|
||||
if (enabled) {
|
||||
ui.backgasBreaks->setDisabled(false);
|
||||
ui.backgasBreaks->blockSignals(true);
|
||||
ui.backgasBreaks->setChecked(prefs.doo2breaks);
|
||||
ui.backgasBreaks->blockSignals(false);
|
||||
} else {
|
||||
ui.backgasBreaks->setDisabled(true);
|
||||
ui.backgasBreaks->blockSignals(true);
|
||||
ui.backgasBreaks->setChecked(false);
|
||||
ui.backgasBreaks->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
void DivePlannerWidget::printDecoPlan()
|
||||
{
|
||||
MainWindow::instance()->printPlan();
|
||||
|
@ -351,6 +366,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
ui.buehlmann_deco->setChecked(prefs.planner_deco_mode == BUEHLMANN);
|
||||
ui.vpmb_deco->setChecked(prefs.planner_deco_mode == VPMB);
|
||||
disableDecoElements((int) prefs.planner_deco_mode);
|
||||
disableBackgasBreaks(prefs.last_stop);
|
||||
|
||||
// should be the same order as in dive_comp_type!
|
||||
rebreather_modes << tr("Open circuit") << tr("CCR") << tr("pSCR");
|
||||
|
@ -367,6 +383,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
connect(ui.vpmb_deco, SIGNAL(clicked()), modeMapper, SLOT(map()));
|
||||
|
||||
connect(ui.lastStop, SIGNAL(toggled(bool)), plannerModel, SLOT(setLastStop6m(bool)));
|
||||
connect(ui.lastStop, SIGNAL(toggled(bool)), this, SLOT(disableBackgasBreaks(bool)));
|
||||
connect(ui.verbatim_plan, SIGNAL(toggled(bool)), plannerModel, SLOT(setVerbatim(bool)));
|
||||
connect(ui.display_duration, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayDuration(bool)));
|
||||
connect(ui.display_runtime, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayRuntime(bool)));
|
||||
|
|
|
@ -86,6 +86,7 @@ slots:
|
|||
void setBestmixEND(int depth);
|
||||
void setBackgasBreaks(bool dobreaks);
|
||||
void disableDecoElements(int mode);
|
||||
void disableBackgasBreaks(bool enabled);
|
||||
void setDiveMode(int mode);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Reference in a new issue