mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add preference to change deco model
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b5de08b709
commit
0d20344c90
5 changed files with 130 additions and 70 deletions
|
@ -299,6 +299,11 @@ bool TechnicalDetailsSettings::calcndltts() const
|
||||||
return prefs.calcndltts;
|
return prefs.calcndltts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TechnicalDetailsSettings::buehlmann() const
|
||||||
|
{
|
||||||
|
return (prefs.deco_mode == BUEHLMANN);
|
||||||
|
}
|
||||||
|
|
||||||
int TechnicalDetailsSettings::gflow() const
|
int TechnicalDetailsSettings::gflow() const
|
||||||
{
|
{
|
||||||
return prefs.gflow;
|
return prefs.gflow;
|
||||||
|
@ -499,6 +504,17 @@ void TechnicalDetailsSettings::setCalcndltts(bool value)
|
||||||
emit calcndlttsChanged(value);
|
emit calcndlttsChanged(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TechnicalDetailsSettings::setBuehlmann(bool value)
|
||||||
|
{
|
||||||
|
if (value == (prefs.deco_mode == BUEHLMANN))
|
||||||
|
return;
|
||||||
|
QSettings s;
|
||||||
|
s.beginGroup(group);
|
||||||
|
s.setValue("buehlmann", value);
|
||||||
|
prefs.deco_mode = value ? BUEHLMANN : VPMB;
|
||||||
|
emit buehlmannChanged(value);
|
||||||
|
}
|
||||||
|
|
||||||
void TechnicalDetailsSettings::setGflow(int value)
|
void TechnicalDetailsSettings::setGflow(int value)
|
||||||
{
|
{
|
||||||
if (value == prefs.gflow)
|
if (value == prefs.gflow)
|
||||||
|
@ -2105,6 +2121,11 @@ void SettingsObjectWrapper::load()
|
||||||
GET_BOOL("tankbar", tankbar);
|
GET_BOOL("tankbar", tankbar);
|
||||||
GET_BOOL("RulerBar", rulergraph);
|
GET_BOOL("RulerBar", rulergraph);
|
||||||
GET_BOOL("percentagegraph", percentagegraph);
|
GET_BOOL("percentagegraph", percentagegraph);
|
||||||
|
v = s.value("buehlmann");
|
||||||
|
if (v.isValid())
|
||||||
|
prefs.deco_mode = v.toBool() ? BUEHLMANN : VPMB;
|
||||||
|
else
|
||||||
|
prefs.deco_mode = BUEHLMANN;
|
||||||
GET_INT("gflow", gflow);
|
GET_INT("gflow", gflow);
|
||||||
GET_INT("gfhigh", gfhigh);
|
GET_INT("gfhigh", gfhigh);
|
||||||
GET_INT("vpmb_conservatism", vpmb_conservatism);
|
GET_INT("vpmb_conservatism", vpmb_conservatism);
|
||||||
|
|
|
@ -116,6 +116,7 @@ class TechnicalDetailsSettings : public QObject {
|
||||||
Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged)
|
Q_PROPERTY(bool calcceiling3m READ calcceiling3m WRITE setCalcceiling3m NOTIFY calcceiling3mChanged)
|
||||||
Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged)
|
Q_PROPERTY(bool calcalltissues READ calcalltissues WRITE setCalcalltissues NOTIFY calcalltissuesChanged)
|
||||||
Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged)
|
Q_PROPERTY(bool calcndltts READ calcndltts WRITE setCalcndltts NOTIFY calcndlttsChanged)
|
||||||
|
Q_PROPERTY(bool buehlmann READ buehlmann WRITE setBuehlmann NOTIFY buehlmannChanged)
|
||||||
Q_PROPERTY(int gflow READ gflow WRITE setGflow NOTIFY gflowChanged)
|
Q_PROPERTY(int gflow READ gflow WRITE setGflow NOTIFY gflowChanged)
|
||||||
Q_PROPERTY(int gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged)
|
Q_PROPERTY(int gfhigh READ gfhigh WRITE setGfhigh NOTIFY gfhighChanged)
|
||||||
Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged)
|
Q_PROPERTY(short vpmb_conservatism READ vpmbConservatism WRITE setVpmbConservatism NOTIFY vpmbConservatismChanged)
|
||||||
|
@ -143,6 +144,7 @@ public:
|
||||||
bool calcceiling3m() const;
|
bool calcceiling3m() const;
|
||||||
bool calcalltissues() const;
|
bool calcalltissues() const;
|
||||||
bool calcndltts() const;
|
bool calcndltts() const;
|
||||||
|
bool buehlmann() const;
|
||||||
int gflow() const;
|
int gflow() const;
|
||||||
int gfhigh() const;
|
int gfhigh() const;
|
||||||
short vpmbConservatism() const;
|
short vpmbConservatism() const;
|
||||||
|
@ -169,6 +171,7 @@ public slots:
|
||||||
void setCalcceiling3m(bool value);
|
void setCalcceiling3m(bool value);
|
||||||
void setCalcalltissues(bool value);
|
void setCalcalltissues(bool value);
|
||||||
void setCalcndltts(bool value);
|
void setCalcndltts(bool value);
|
||||||
|
void setBuehlmann(bool value);
|
||||||
void setGflow(int value);
|
void setGflow(int value);
|
||||||
void setGfhigh(int value);
|
void setGfhigh(int value);
|
||||||
void setVpmbConservatism(short);
|
void setVpmbConservatism(short);
|
||||||
|
@ -195,6 +198,7 @@ signals:
|
||||||
void calcceiling3mChanged(bool value);
|
void calcceiling3mChanged(bool value);
|
||||||
void calcalltissuesChanged(bool value);
|
void calcalltissuesChanged(bool value);
|
||||||
void calcndlttsChanged(bool value);
|
void calcndlttsChanged(bool value);
|
||||||
|
void buehlmannChanged(bool value);
|
||||||
void gflowChanged(int value);
|
void gflowChanged(int value);
|
||||||
void gfhighChanged(int value);
|
void gfhighChanged(int value);
|
||||||
void vpmbConservatismChanged(short value);
|
void vpmbConservatismChanged(short value);
|
||||||
|
|
|
@ -25,6 +25,13 @@ void PreferencesGraph::refreshSettings()
|
||||||
ui->maxpo2->setValue(prefs.modpO2);
|
ui->maxpo2->setValue(prefs.modpO2);
|
||||||
ui->red_ceiling->setChecked(prefs.redceiling);
|
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->gflow->setValue(prefs.gflow);
|
||||||
ui->gfhigh->setValue(prefs.gfhigh);
|
ui->gfhigh->setValue(prefs.gfhigh);
|
||||||
ui->vpmb_conservatism->setValue(prefs.vpmb_conservatism);
|
ui->vpmb_conservatism->setValue(prefs.vpmb_conservatism);
|
||||||
|
@ -54,6 +61,7 @@ void PreferencesGraph::syncSettings()
|
||||||
auto tech = SettingsObjectWrapper::instance()->techDetails;
|
auto tech = SettingsObjectWrapper::instance()->techDetails;
|
||||||
tech->setModp02(ui->maxpo2->value());
|
tech->setModp02(ui->maxpo2->value());
|
||||||
tech->setRedceiling(ui->red_ceiling->isChecked());
|
tech->setRedceiling(ui->red_ceiling->isChecked());
|
||||||
|
tech->setBuehlmann(ui->buehlmann->isChecked());
|
||||||
tech->setGflow(ui->gflow->value());
|
tech->setGflow(ui->gflow->value());
|
||||||
tech->setGfhigh(ui->gfhigh->value());
|
tech->setGfhigh(ui->gfhigh->value());
|
||||||
tech->setVpmbConservatism(ui->vpmb_conservatism->value());
|
tech->setVpmbConservatism(ui->vpmb_conservatism->value());
|
||||||
|
@ -73,4 +81,13 @@ void PreferencesGraph::on_gfhigh_valueChanged(int gf)
|
||||||
{
|
{
|
||||||
ui->gfhigh->setStyleSheet(DANGER_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
|
#undef DANGER_GF
|
||||||
|
|
|
@ -18,6 +18,7 @@ public:
|
||||||
private slots:
|
private slots:
|
||||||
void on_gflow_valueChanged(int gf);
|
void on_gflow_valueChanged(int gf);
|
||||||
void on_gfhigh_valueChanged(int gf);
|
void on_gfhigh_valueChanged(int gf);
|
||||||
|
void on_buehlmann_toggled(bool buelmann);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::PreferencesGraph *ui;
|
Ui::PreferencesGraph *ui;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>505</width>
|
<width>505</width>
|
||||||
<height>555</height>
|
<height>575</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -133,31 +133,14 @@
|
||||||
<string>Misc</string>
|
<string>Misc</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="label_19">
|
<widget class="QLabel" name="label_19">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>GFLow</string>
|
<string>GFLow</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="gflow">
|
|
||||||
<property name="minimum">
|
|
||||||
<number>1</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>150</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_20">
|
|
||||||
<property name="text">
|
|
||||||
<string>GFHigh</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QSpinBox" name="gfhigh">
|
<widget class="QSpinBox" name="gfhigh">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
@ -167,34 +150,86 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="8" 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">
|
||||||
|
<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="gflow">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>150</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="2" column="0">
|
<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">
|
<widget class="QLabel" name="label_21">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>VPM-B Conservatism</string>
|
<string>VPM-B Conservatism</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="9" column="0" colspan="2">
|
||||||
<widget class="QSpinBox" name="vpmb_conservatism">
|
<widget class="QCheckBox" name="show_ccr_sensors">
|
||||||
<property name="prefix">
|
<property name="text">
|
||||||
<string>+</string>
|
<string>CCR: show individual O₂ sensor values when viewing pO₂</string>
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>4</number>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="5" 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="4" column="0">
|
||||||
<widget class="QLabel" name="label_26">
|
<widget class="QLabel" name="label_26">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Default CCR set-point for dive planning</string>
|
<string>Default CCR set-point for dive planning</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="defaultSetpoint">
|
<widget class="QDoubleSpinBox" name="defaultSetpoint">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>bar</string>
|
<string>bar</string>
|
||||||
|
@ -210,58 +245,40 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="pSCR">
|
<widget class="QLabel" name="pSCR">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>pSCR O₂ metabolism rate</string>
|
<string>pSCR O₂ metabolism rate</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QDoubleSpinBox" name="psro2rate">
|
<widget class="QSpinBox" name="vpmb_conservatism">
|
||||||
<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>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QSpinBox" name="pscrfactor">
|
|
||||||
<property name="suffix">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="prefix">
|
<property name="prefix">
|
||||||
<string>1:</string>
|
<string>+</string>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0" colspan="2">
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="gf_low_at_maxdepth">
|
<widget class="QRadioButton" name="buehlmann">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>GFLow at max depth</string>
|
<string>Bühlmann</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0" colspan="2">
|
<item row="0" column="1">
|
||||||
<widget class="QCheckBox" name="show_ccr_setpoint">
|
<widget class="QRadioButton" name="vpmb">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>CCR: show setpoints when viewing pO₂</string>
|
<string>VPM-B</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<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>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue