summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2016-09-24 18:02:08 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-24 08:30:11 -0700
commit7e09a6c7bcb135d65b3e48f2aee44791dd080443 (patch)
treed1a3620e9084cf335f711fdf0b4ca397914117a3 /desktop-widgets
parent7b891904e77364719471098a7bdf4eacc589807c (diff)
downloadsubsurface-7e09a6c7bcb135d65b3e48f2aee44791dd080443.tar.gz
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 <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/diveplanner.cpp10
-rw-r--r--desktop-widgets/plannerSettings.ui2
-rw-r--r--desktop-widgets/preferences/preferences_graph.cpp2
-rw-r--r--desktop-widgets/preferences/preferences_graph.ui36
4 files changed, 36 insertions, 14 deletions
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 @@
</widget>
</item>
<item row="12" column="2">
- <widget class="QSpinBox" name="conservatism_lvl">
+ <widget class="QSpinBox" name="vpmb_conservatism">
<property name="maximum">
<number>4</number>
</property>
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 @@
</widget>
</item>
<item row="2" 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>
+ </property>
+ <property name="minimum">
+ <number>0</number>
+ </property>
+ <property name="maximum">
+ <number>4</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" 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="2" column="1">
+ <item row="3" column="1">
<widget class="QDoubleSpinBox" name="defaultSetpoint">
<property name="suffix">
<string>bar</string>
@@ -190,14 +210,14 @@
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="pSCR">
<property name="text">
<string>pSCR O₂ metabolism rate</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QDoubleSpinBox" name="psro2rate">
<property name="suffix">
<string>ℓ/min</string>
@@ -207,14 +227,14 @@
</property>
</widget>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>pSCR ratio</string>
</property>
</widget>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QSpinBox" name="pscrfactor">
<property name="suffix">
<string/>
@@ -224,21 +244,21 @@
</property>
</widget>
</item>
- <item row="5" column="0" colspan="2">
+ <item row="6" 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="6" column="0" colspan="2">
+ <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>
</widget>
</item>
- <item row="7" column="0" colspan="2">
+ <item row="8" 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>