summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2015-01-19 15:28:56 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-01-20 22:38:52 +1200
commit2923329e8e47f64667c34b33eb1de64657cb6774 (patch)
tree2a0bdd654b93d1828380c5255e9b85a9d9496cd4 /qt-ui
parent2bb81d0fe58cea8a7ef08c0ac0b4aec4c41651d6 (diff)
downloadsubsurface-2923329e8e47f64667c34b33eb1de64657cb6774.tar.gz
UI for pSCR preferences
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/preferences.cpp9
-rw-r--r--qt-ui/preferences.ui42
2 files changed, 45 insertions, 6 deletions
diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 334b2a1d2..6c4e65df8 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -125,6 +125,8 @@ void PreferencesDialog::setUiFromPrefs()
ui.gf_low_at_maxdepth->setChecked(prefs.gf_low_at_maxdepth);
ui.show_ccr_setpoint->setChecked(prefs.show_ccr_setpoint);
ui.defaultSetpoint->setValue((double)prefs.defaultsetpoint / 1000.0);
+ ui.psro2rate->setValue(prefs.o2consumption / 1000.0);
+ ui.pscrfactor->setValue(rint(1000.0 / prefs.pscr_ratio));
// units
if (prefs.unit_system == METRIC)
@@ -299,7 +301,9 @@ void PreferencesDialog::syncSettings()
s.setValue("default_filename", ui.defaultfilename->text());
s.setValue("default_cylinder", ui.default_cylinder->currentText());
s.setValue("use_default_file", ui.btnUseDefaultFile->isChecked());
- s.setValue("defaultsetpoint", (int) (ui.defaultSetpoint->value() * 1000.0));
+ s.setValue("defaultsetpoint", rint(ui.defaultSetpoint->value() * 1000.0));
+ s.setValue("o2consumption", rint(ui.psro2rate->value() *1000.0));
+ s.setValue("pscr_ratio", rint(1000.0 / ui.pscrfactor->value()));
s.endGroup();
s.beginGroup("Display");
@@ -397,7 +401,6 @@ void PreferencesDialog::loadSettings()
GET_BOOL("show_sac", show_sac);
GET_BOOL("display_unused_tanks", display_unused_tanks);
GET_BOOL("show_average_depth", show_average_depth);
- GET_INT("default_setpoint", defaultsetpoint);
s.endGroup();
s.beginGroup("GeneralSettings");
@@ -405,6 +408,8 @@ void PreferencesDialog::loadSettings()
GET_TXT("default_cylinder", default_cylinder);
GET_BOOL("use_default_file", use_default_file);
GET_INT("defaultsetpoint", defaultsetpoint);
+ GET_INT("o2consumption", o2consumption);
+ GET_INT("pscr_ratio", pscr_ratio);
s.endGroup();
s.beginGroup("Display");
diff --git a/qt-ui/preferences.ui b/qt-ui/preferences.ui
index 2bcc684d7..77b3a25d1 100644
--- a/qt-ui/preferences.ui
+++ b/qt-ui/preferences.ui
@@ -151,7 +151,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
- <number>5</number>
+ <number>2</number>
</property>
<widget class="QWidget" name="defaults_page">
<layout class="QVBoxLayout" name="verticalLayout_3">
@@ -789,14 +789,14 @@
</property>
</widget>
</item>
- <item row="6" column="0">
+ <item row="7" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Default CCR set-point</string>
</property>
</widget>
</item>
- <item row="6" column="1">
+ <item row="7" column="1">
<widget class="QDoubleSpinBox" name="defaultSetpoint">
<property name="suffix">
<string>bar</string>
@@ -819,6 +819,40 @@
</property>
</widget>
</item>
+ <item row="8" column="0">
+ <widget class="QLabel" name="pSCR">
+ <property name="text">
+ <string>pSCR O₂ metabolism rate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="0">
+ <widget class="QLabel" name="label_28">
+ <property name="text">
+ <string>pSCR ratio</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" 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="9" column="1">
+ <widget class="QSpinBox" name="pscrfactor">
+ <property name="suffix">
+ <string/>
+ </property>
+ <property name="prefix">
+ <string>1:</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -1400,10 +1434,10 @@
</connection>
</connections>
<buttongroups>
- <buttongroup name="buttonGroup"/>
<buttongroup name="verticalSpeed"/>
<buttongroup name="buttonGroup_2"/>
<buttongroup name="buttonGroup_3"/>
+ <buttongroup name="buttonGroup"/>
<buttongroup name="buttonGroup_4"/>
<buttongroup name="buttonGroup_5"/>
<buttongroup name="buttonGroup_6"/>