From 0d20344c901c697d109d2ac071293bcb47db039a Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 3 Oct 2016 16:25:48 +0200 Subject: Add preference to change deco model Signed-off-by: Robert C. Helling Signed-off-by: Dirk Hohndel --- desktop-widgets/preferences/preferences_graph.cpp | 17 +++ desktop-widgets/preferences/preferences_graph.h | 3 +- desktop-widgets/preferences/preferences_graph.ui | 123 ++++++++++++---------- 3 files changed, 89 insertions(+), 54 deletions(-) (limited to 'desktop-widgets/preferences') 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 @@ 0 0 505 - 555 + 575 @@ -133,15 +133,15 @@ Misc - + GFLow - - + + 1 @@ -150,15 +150,22 @@ - - + + - GFHigh + CCR: show setpoints when viewing pO₂ + + + + + + + GFLow at max depth - + 1 @@ -168,33 +175,61 @@ + + + GFHigh + + + + + + + + + + 1: + + + + + + + pSCR ratio + + + + VPM-B Conservatism - - - - + + + + + CCR: show individual O₂ sensor values when viewing pO₂ - - 0 + + + + + + ℓ/min - - 4 + + 3 - + Default CCR set-point for dive planning - + bar @@ -210,58 +245,40 @@ - + pSCR O₂ metabolism rate - - - - ℓ/min - - - 3 - - - - - - - pSCR ratio + + + + + - - - - - - + + 0 - - 1: + + 4 - - + + - GFLow at max depth + Bühlmann - - - - - - CCR: show setpoints when viewing pO₂ + + true - - + + - CCR: show individual O₂ sensor values when viewing pO₂ + VPM-B -- cgit v1.2.3-70-g09d2