From 7e09a6c7bcb135d65b3e48f2aee44791dd080443 Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Sat, 24 Sep 2016 18:02:08 +1000 Subject: Separate VPM-B conservatism preference for planner and profile Separate the VPM-B conservatism preference into diveplan.vpmb_conservatism for planning dives and prefs.vpmb_conservatism for profile ceiling display of saved dives. Signed-off-by: Rick Walsh Signed-off-by: Dirk Hohndel --- desktop-widgets/diveplanner.cpp | 10 +++---- desktop-widgets/plannerSettings.ui | 2 +- desktop-widgets/preferences/preferences_graph.cpp | 2 ++ desktop-widgets/preferences/preferences_graph.ui | 36 ++++++++++++++++++----- 4 files changed, 36 insertions(+), 14 deletions(-) (limited to 'desktop-widgets') diff --git a/desktop-widgets/diveplanner.cpp b/desktop-widgets/diveplanner.cpp index ed6515e19..cb357482f 100644 --- a/desktop-widgets/diveplanner.cpp +++ b/desktop-widgets/diveplanner.cpp @@ -237,7 +237,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.bottompo2->setDisabled(true); ui.decopo2->setDisabled(true); ui.reserve_gas->setDisabled(false); - ui.conservatism_lvl->setDisabled(true); + ui.vpmb_conservatism->setDisabled(true); ui.switch_at_req_stop->setDisabled(true); ui.min_switch_duration->setDisabled(true); } @@ -249,7 +249,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.bottompo2->setDisabled(false); ui.decopo2->setDisabled(false); ui.reserve_gas->setDisabled(true); - ui.conservatism_lvl->setDisabled(false); + ui.vpmb_conservatism->setDisabled(false); ui.switch_at_req_stop->setDisabled(false); ui.min_switch_duration->setDisabled(false); } @@ -261,7 +261,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode) ui.bottompo2->setDisabled(false); ui.decopo2->setDisabled(false); ui.reserve_gas->setDisabled(true); - ui.conservatism_lvl->setDisabled(true); + ui.vpmb_conservatism->setDisabled(true); ui.switch_at_req_stop->setDisabled(false); ui.min_switch_duration->setDisabled(false); } @@ -296,7 +296,6 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) ui.recreational_deco->setChecked(prefs.deco_mode == RECREATIONAL); ui.buehlmann_deco->setChecked(prefs.deco_mode == BUEHLMANN); ui.vpmb_deco->setChecked(prefs.deco_mode == VPMB); - ui.conservatism_lvl->setValue(prefs.vpmb_conservatism); disableDecoElements((int) prefs.deco_mode); // should be the same order as in dive_comp_type! @@ -330,7 +329,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) connect(ui.gflow, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFLow(int))); connect(ui.gfhigh, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFHigh())); connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow())); - connect(ui.conservatism_lvl, SIGNAL(valueChanged(int)), plannerModel, SLOT(setVpmbConservatism(int))); + connect(ui.vpmb_conservatism, SIGNAL(valueChanged(int)), plannerModel, SLOT(setVpmbConservatism(int))); connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(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))); @@ -354,6 +353,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f) settingsChanged(); ui.gflow->setValue(prefs.gflow); ui.gfhigh->setValue(prefs.gfhigh); + ui.vpmb_conservatism->setValue(prefs.vpmb_conservatism); setMinimumWidth(0); setMinimumHeight(0); diff --git a/desktop-widgets/plannerSettings.ui b/desktop-widgets/plannerSettings.ui index 81783cf80..c6e16e54a 100644 --- a/desktop-widgets/plannerSettings.ui +++ b/desktop-widgets/plannerSettings.ui @@ -500,7 +500,7 @@ - + 4 diff --git a/desktop-widgets/preferences/preferences_graph.cpp b/desktop-widgets/preferences/preferences_graph.cpp index 36951ef22..c13915e37 100644 --- a/desktop-widgets/preferences/preferences_graph.cpp +++ b/desktop-widgets/preferences/preferences_graph.cpp @@ -27,6 +27,7 @@ void PreferencesGraph::refreshSettings() ui->gflow->setValue(prefs.gflow); ui->gfhigh->setValue(prefs.gfhigh); + ui->vpmb_conservatism->setValue(prefs.vpmb_conservatism); ui->gf_low_at_maxdepth->setChecked(prefs.gf_low_at_maxdepth); ui->show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint); ui->show_ccr_sensors->setChecked(prefs.show_ccr_sensors); @@ -55,6 +56,7 @@ void PreferencesGraph::syncSettings() tech->setRedceiling(ui->red_ceiling->isChecked()); tech->setGflow(ui->gflow->value()); tech->setGfhigh(ui->gfhigh->value()); + tech->setVpmbConservatism(ui->vpmb_conservatism->value()); tech->setGfLowAtMaxDepth(ui->gf_low_at_maxdepth->isChecked()); tech->setShowCCRSetpoint(ui->show_ccr_setpoint->isChecked()); tech->setShowCCRSensors(ui->show_ccr_sensors->isChecked()); diff --git a/desktop-widgets/preferences/preferences_graph.ui b/desktop-widgets/preferences/preferences_graph.ui index e0d0cda54..b8d6a4656 100644 --- a/desktop-widgets/preferences/preferences_graph.ui +++ b/desktop-widgets/preferences/preferences_graph.ui @@ -168,13 +168,33 @@ + + + VPM-B Conservatism + + + + + + + + + + + 0 + + + 4 + + + + Default CCR set-point for dive planning - + bar @@ -190,14 +210,14 @@ - + pSCR O₂ metabolism rate - + ℓ/min @@ -207,14 +227,14 @@ - + pSCR ratio - + @@ -224,21 +244,21 @@ - + GFLow at max depth - + CCR: show setpoints when viewing pO₂ - + CCR: show individual O₂ sensor values when viewing pO₂ -- cgit v1.2.3-70-g09d2