diff options
author | Robert C. Helling <helling@atdotde.de> | 2019-10-29 17:57:34 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-10-31 00:30:38 -0700 |
commit | 9c8fbe494db231b59c2e072b54af85bc217c00d8 (patch) | |
tree | 2b387fea841a6a154135c8b268f3e40298ddbea5 /desktop-widgets/diveplanner.cpp | |
parent | 43b16f0810f7aa8328fd946e0e014d0625e3b53b (diff) | |
download | subsurface-9c8fbe494db231b59c2e072b54af85bc217c00d8.tar.gz |
Planner: Add option to treat O2 as narcotic
When computing the best mix for a target depth, for helium, one
can either require that the partial pressure of N2 is the same
as at the target depth or the partial pressure of N2 plus O2.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'desktop-widgets/diveplanner.cpp')
-rw-r--r-- | desktop-widgets/diveplanner.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index 33caffd0d..663bb03fb 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -451,6 +451,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) ui.backgasBreaks->setChecked(prefs.doo2breaks); setBailout(false); setBailoutVisibility(false); + ui.o2narcotic->setChecked(prefs.o2narcotic); ui.drop_stone_mode->setChecked(prefs.drop_stone_mode); ui.switch_at_req_stop->setChecked(prefs.switch_at_req_stop); ui.min_switch_duration->setValue(prefs.min_switch_duration / 60); @@ -496,6 +497,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.vpmb_conservatism, SIGNAL(valueChanged(int)), plannerModel, SLOT(setVpmbConservatism(int))); connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool))); connect(ui.bailout, SIGNAL(toggled(bool)), this, SLOT(setBailout(bool))); + connect(ui.o2narcotic, SIGNAL(toggled(bool)), this, SLOT(setO2narcotic(bool))); connect(ui.switch_at_req_stop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSwitchAtReqStop(bool))); connect(ui.min_switch_duration, SIGNAL(valueChanged(int)), plannerModel, SLOT(setMinSwitchDuration(int))); connect(ui.surface_segment, SIGNAL(valueChanged(int)), plannerModel, SLOT(setSurfaceSegment(int))); @@ -504,6 +506,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.bottompo2, SIGNAL(valueChanged(double)), CylindersModel::instance(), SLOT(updateBestMixes())); connect(ui.bestmixEND, SIGNAL(valueChanged(int)), CylindersModel::instance(), SLOT(updateBestMixes())); + connect(ui.o2narcotic, SIGNAL(toggled(bool)), CylindersModel::instance(), SLOT(updateBestMixes())); connect(modeMapper, SIGNAL(mapped(int)), this, SLOT(disableDecoElements(int))); connect(ui.ascRate75, SIGNAL(valueChanged(int)), this, SLOT(setAscrate75(int))); @@ -679,6 +682,12 @@ void PlannerSettingsWidget::setBailout(bool dobailout) plannerModel->emitDataChanged(); } +void PlannerSettingsWidget::setO2narcotic(bool o2narcotic) +{ + qPrefDivePlanner::instance()->set_o2narcotic(o2narcotic); + plannerModel->emitDataChanged(); +} + void PlannerSettingsWidget::setBailoutVisibility(int mode) { ui.bailout->setDisabled(!(mode == CCR || mode == PSCR)); |