summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/diveplanner.cpp9
-rw-r--r--desktop-widgets/diveplanner.h1
-rw-r--r--desktop-widgets/plannerSettings.ui168
3 files changed, 99 insertions, 79 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));
diff --git a/desktop-widgets/diveplanner.h b/desktop-widgets/diveplanner.h
index 6d17c956b..e9e7808b9 100644
--- a/desktop-widgets/diveplanner.h
+++ b/desktop-widgets/diveplanner.h
@@ -86,6 +86,7 @@ slots:
void setBestmixEND(int depth);
void setBackgasBreaks(bool dobreaks);
void setBailout(bool dobailout);
+ void setO2narcotic(bool o2narcotic);
void disableDecoElements(int mode);
void disableBackgasBreaks(bool enabled);
void setDiveMode(int mode);
diff --git a/desktop-widgets/plannerSettings.ui b/desktop-widgets/plannerSettings.ui
index f22d0db45..33e3d2456 100644
--- a/desktop-widgets/plannerSettings.ui
+++ b/desktop-widgets/plannerSettings.ui
@@ -561,6 +561,83 @@
<property name="spacing">
<number>2</number>
</property>
+ <item row="9" column="0" colspan="2">
+ <widget class="QGroupBox" name="Notes">
+ <property name="title">
+ <string>Notes</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_6">
+ <property name="leftMargin">
+ <number>2</number>
+ </property>
+ <property name="topMargin">
+ <number>2</number>
+ </property>
+ <property name="rightMargin">
+ <number>2</number>
+ </property>
+ <property name="bottomMargin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="verbatim_plan">
+ <property name="text">
+ <string>Verbatim dive plan</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="display_transitions">
+ <property name="toolTip">
+ <string>In diveplan, list transitions or treat them as implicit</string>
+ </property>
+ <property name="text">
+ <string>Display transitions in deco</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QCheckBox" name="display_runtime">
+ <property name="toolTip">
+ <string>In dive plan, show runtime (absolute time) of stops</string>
+ </property>
+ <property name="text">
+ <string>Display runtime</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QCheckBox" name="display_duration">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip">
+ <string>In dive plan, show duration (relative time) of stops</string>
+ </property>
+ <property name="text">
+ <string>Display segment duration</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QCheckBox" name="display_variations">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip">
+ <string>Compute variations of plan (performance cost)</string>
+ </property>
+ <property name="text">
+ <string>Display plan variations</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="decoStopSAC">
<property name="suffix">
@@ -581,7 +658,7 @@
</property>
</widget>
</item>
- <item row="8" column="0">
+ <item row="9" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -594,7 +671,7 @@
</property>
</spacer>
</item>
- <item row="7" column="0">
+ <item row="8" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
@@ -692,83 +769,6 @@
</property>
</widget>
</item>
- <item row="8" column="0" colspan="2">
- <widget class="QGroupBox" name="Notes">
- <property name="title">
- <string>Notes</string>
- </property>
- <layout class="QGridLayout" name="gridLayout_6">
- <property name="leftMargin">
- <number>2</number>
- </property>
- <property name="topMargin">
- <number>2</number>
- </property>
- <property name="rightMargin">
- <number>2</number>
- </property>
- <property name="bottomMargin">
- <number>2</number>
- </property>
- <property name="spacing">
- <number>2</number>
- </property>
- <item row="3" column="0">
- <widget class="QCheckBox" name="verbatim_plan">
- <property name="text">
- <string>Verbatim dive plan</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0">
- <widget class="QCheckBox" name="display_transitions">
- <property name="toolTip">
- <string>In diveplan, list transitions or treat them as implicit</string>
- </property>
- <property name="text">
- <string>Display transitions in deco</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QCheckBox" name="display_runtime">
- <property name="toolTip">
- <string>In dive plan, show runtime (absolute time) of stops</string>
- </property>
- <property name="text">
- <string>Display runtime</string>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QCheckBox" name="display_duration">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="toolTip">
- <string>In dive plan, show duration (relative time) of stops</string>
- </property>
- <property name="text">
- <string>Display segment duration</string>
- </property>
- </widget>
- </item>
- <item row="4" column="0">
- <widget class="QCheckBox" name="display_variations">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="toolTip">
- <string>Compute variations of plan (performance cost)</string>
- </property>
- <property name="text">
- <string>Display plan variations</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
<item row="5" column="0">
<widget class="QLabel" name="decopO2">
<property name="text">
@@ -831,6 +831,16 @@
</property>
</widget>
</item>
+ <item row="7" column="0">
+ <widget class="QCheckBox" name="o2narcotic">
+ <property name="toolTip">
+ <string>Treat oxygen as narcotic when computing best mix</string>
+ </property>
+ <property name="text">
+ <string>O₂ narcotic</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>