diff options
author | Robert C. Helling <helling@atdotde.de> | 2016-10-03 16:25:48 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-10-11 21:58:41 -0700 |
commit | 0d20344c901c697d109d2ac071293bcb47db039a (patch) | |
tree | 57c7196135655e73f90c40e7b5c1f51affee2fa6 /desktop-widgets | |
parent | b5de08b709819783e5d79ffffa333cea05f5186f (diff) | |
download | subsurface-0d20344c901c697d109d2ac071293bcb47db039a.tar.gz |
Add preference to change deco model
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/preferences/preferences_graph.cpp | 17 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_graph.h | 3 | ||||
-rw-r--r-- | desktop-widgets/preferences/preferences_graph.ui | 123 |
3 files changed, 89 insertions, 54 deletions
diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index c13915e37..8f3e5e7bf 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -25,6 +25,13 @@ void PreferencesGraph::refreshSettings() ui->maxpo2->setValue(prefs.modpO2); ui->red_ceiling->setChecked(prefs.redceiling); + if (prefs.deco_mode == BUEHLMANN) { + ui->buehlmann->setChecked(true); + ui->vpmb->setChecked(false); + } else { + ui->buehlmann->setChecked(false); + ui->vpmb->setChecked(false); + } ui->gflow->setValue(prefs.gflow); ui->gfhigh->setValue(prefs.gfhigh); ui->vpmb_conservatism->setValue(prefs.vpmb_conservatism); @@ -54,6 +61,7 @@ void PreferencesGraph::syncSettings() auto tech = SettingsObjectWrapper::instance()->techDetails; tech->setModp02(ui->maxpo2->value()); tech->setRedceiling(ui->red_ceiling->isChecked()); + tech->setBuehlmann(ui->buehlmann->isChecked()); tech->setGflow(ui->gflow->value()); tech->setGfhigh(ui->gfhigh->value()); tech->setVpmbConservatism(ui->vpmb_conservatism->value()); @@ -73,4 +81,13 @@ void PreferencesGraph::on_gfhigh_valueChanged(int gf) { ui->gfhigh->setStyleSheet(DANGER_GF); } + +void PreferencesGraph::on_buehlmann_toggled(bool buehlmann) +{ + ui->gfhigh->setEnabled(buehlmann); + ui->gflow->setEnabled(buehlmann); + ui->gf_low_at_maxdepth->setEnabled(buehlmann); + ui->vpmb_conservatism->setEnabled(!buehlmann); +} + #undef DANGER_GF diff --git a/desktop-widgets/preferences/preferences_graph.h b/desktop-widgets/preferences/preferences_graph.h index ca40c0a92..328f348a2 100644 --- a/desktop-widgets/preferences/preferences_graph.h +++ b/desktop-widgets/preferences/preferences_graph.h @@ -18,10 +18,11 @@ public: private slots: void on_gflow_valueChanged(int gf); void on_gfhigh_valueChanged(int gf); + void on_buehlmann_toggled(bool buelmann); private: Ui::PreferencesGraph *ui; }; -#endif
\ No newline at end of file +#endif diff --git a/desktop-widgets/preferences/preferences_graph.ui b/desktop-widgets/preferences/preferences_graph.ui index b8d6a4656..ab5c191c9 100644 --- a/desktop-widgets/preferences/preferences_graph.ui +++ b/desktop-widgets/preferences/preferences_graph.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>505</width> - <height>555</height> + <height>575</height> </rect> </property> <property name="windowTitle"> @@ -133,15 +133,15 @@ <string>Misc</string> </property> <layout class="QGridLayout" name="gridLayout_2"> - <item row="0" column="0"> + <item row="1" column="0"> <widget class="QLabel" name="label_19"> <property name="text"> <string>GFLow</string> </property> </widget> </item> - <item row="0" column="1"> - <widget class="QSpinBox" name="gflow"> + <item row="2" column="1"> + <widget class="QSpinBox" name="gfhigh"> <property name="minimum"> <number>1</number> </property> @@ -150,15 +150,22 @@ </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_20"> + <item row="8" column="0" colspan="2"> + <widget class="QCheckBox" name="show_ccr_setpoint"> <property name="text"> - <string>GFHigh</string> + <string>CCR: show setpoints when viewing pO₂</string> + </property> + </widget> + </item> + <item row="7" column="0" colspan="2"> + <widget class="QCheckBox" name="gf_low_at_maxdepth"> + <property name="text"> + <string>GFLow at max depth</string> </property> </widget> </item> <item row="1" column="1"> - <widget class="QSpinBox" name="gfhigh"> + <widget class="QSpinBox" name="gflow"> <property name="minimum"> <number>1</number> </property> @@ -168,33 +175,61 @@ </widget> </item> <item row="2" column="0"> + <widget class="QLabel" name="label_20"> + <property name="text"> + <string>GFHigh</string> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="QSpinBox" name="pscrfactor"> + <property name="suffix"> + <string/> + </property> + <property name="prefix"> + <string>1:</string> + </property> + </widget> + </item> + <item row="6" column="0"> + <widget class="QLabel" name="label_28"> + <property name="text"> + <string>pSCR ratio</string> + </property> + </widget> + </item> + <item row="3" column="0"> <widget class="QLabel" name="label_21"> <property name="text"> <string>VPM-B Conservatism</string> </property> </widget> </item> - <item row="2" column="1"> - <widget class="QSpinBox" name="vpmb_conservatism"> - <property name="prefix"> - <string>+</string> + <item row="9" column="0" colspan="2"> + <widget class="QCheckBox" name="show_ccr_sensors"> + <property name="text"> + <string>CCR: show individual O₂ sensor values when viewing pO₂</string> </property> - <property name="minimum"> - <number>0</number> + </widget> + </item> + <item row="5" column="1"> + <widget class="QDoubleSpinBox" name="psro2rate"> + <property name="suffix"> + <string>ℓ/min</string> </property> - <property name="maximum"> - <number>4</number> + <property name="decimals"> + <number>3</number> </property> </widget> </item> - <item row="3" column="0"> + <item row="4" column="0"> <widget class="QLabel" name="label_26"> <property name="text"> <string>Default CCR set-point for dive planning</string> </property> </widget> </item> - <item row="3" column="1"> + <item row="4" column="1"> <widget class="QDoubleSpinBox" name="defaultSetpoint"> <property name="suffix"> <string>bar</string> @@ -210,58 +245,40 @@ </property> </widget> </item> - <item row="4" column="0"> + <item row="5" column="0"> <widget class="QLabel" name="pSCR"> <property name="text"> <string>pSCR O₂ metabolism rate</string> </property> </widget> </item> - <item row="4" column="1"> - <widget class="QDoubleSpinBox" name="psro2rate"> - <property name="suffix"> - <string>ℓ/min</string> - </property> - <property name="decimals"> - <number>3</number> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="label_28"> - <property name="text"> - <string>pSCR ratio</string> + <item row="3" column="1"> + <widget class="QSpinBox" name="vpmb_conservatism"> + <property name="prefix"> + <string>+</string> </property> - </widget> - </item> - <item row="5" column="1"> - <widget class="QSpinBox" name="pscrfactor"> - <property name="suffix"> - <string/> + <property name="minimum"> + <number>0</number> </property> - <property name="prefix"> - <string>1:</string> + <property name="maximum"> + <number>4</number> </property> </widget> </item> - <item row="6" column="0" colspan="2"> - <widget class="QCheckBox" name="gf_low_at_maxdepth"> + <item row="0" column="0"> + <widget class="QRadioButton" name="buehlmann"> <property name="text"> - <string>GFLow at max depth</string> + <string>Bühlmann</string> </property> - </widget> - </item> - <item row="7" column="0" colspan="2"> - <widget class="QCheckBox" name="show_ccr_setpoint"> - <property name="text"> - <string>CCR: show setpoints when viewing pO₂</string> + <property name="checked"> + <bool>true</bool> </property> </widget> </item> - <item row="8" column="0" colspan="2"> - <widget class="QCheckBox" name="show_ccr_sensors"> + <item row="0" column="1"> + <widget class="QRadioButton" name="vpmb"> <property name="text"> - <string>CCR: show individual O₂ sensor values when viewing pO₂</string> + <string>VPM-B</string> </property> </widget> </item> |