mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Rebreather type selector UI
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ac2c15e8cf
commit
d01c6c824b
4 changed files with 65 additions and 38 deletions
|
@ -251,7 +251,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, bool track_gas)
|
||||||
int oldpo2 = 0;
|
int oldpo2 = 0;
|
||||||
int lasttime = 0;
|
int lasttime = 0;
|
||||||
int lastdepth = 0;
|
int lastdepth = 0;
|
||||||
enum dive_comp_type type = OC;
|
enum dive_comp_type type = displayed_dive.dc.dctype;
|
||||||
|
|
||||||
if (!diveplan || !diveplan->dp)
|
if (!diveplan || !diveplan->dp)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -394,6 +394,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
QSettings s;
|
QSettings s;
|
||||||
|
QStringList rebreater_modes;
|
||||||
s.beginGroup("Planner");
|
s.beginGroup("Planner");
|
||||||
prefs.ascrate75 = s.value("ascrate75", prefs.ascrate75).toInt();
|
prefs.ascrate75 = s.value("ascrate75", prefs.ascrate75).toInt();
|
||||||
prefs.ascrate50 = s.value("ascrate50", prefs.ascrate50).toInt();
|
prefs.ascrate50 = s.value("ascrate50", prefs.ascrate50).toInt();
|
||||||
|
@ -415,6 +416,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
||||||
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
|
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
|
||||||
ui.backgasBreaks->setChecked(prefs.doo2breaks);
|
ui.backgasBreaks->setChecked(prefs.doo2breaks);
|
||||||
ui.drop_stone_mode->setChecked(prefs.drop_stone_mode);
|
ui.drop_stone_mode->setChecked(prefs.drop_stone_mode);
|
||||||
|
rebreater_modes << "Open circuit" << "pSCR" << "CCR";
|
||||||
|
ui.rebreathermode->insertItems(0, rebreater_modes);
|
||||||
|
|
||||||
connect(ui.lastStop, SIGNAL(toggled(bool)), plannerModel, SLOT(setLastStop6m(bool)));
|
connect(ui.lastStop, SIGNAL(toggled(bool)), plannerModel, SLOT(setLastStop6m(bool)));
|
||||||
connect(ui.verbatim_plan, SIGNAL(toggled(bool)), plannerModel, SLOT(setVerbatim(bool)));
|
connect(ui.verbatim_plan, SIGNAL(toggled(bool)), plannerModel, SLOT(setVerbatim(bool)));
|
||||||
|
@ -441,6 +444,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
||||||
connect(ui.gfhigh, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFHigh()));
|
connect(ui.gfhigh, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFHigh()));
|
||||||
connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow()));
|
connect(ui.gflow, SIGNAL(editingFinished()), plannerModel, SLOT(triggerGFLow()));
|
||||||
connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool)));
|
connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool)));
|
||||||
|
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(QString)), plannerModel, SLOT(setRebreatherMode(QString)));
|
||||||
settingsChanged();
|
settingsChanged();
|
||||||
ui.gflow->setValue(prefs.gflow);
|
ui.gflow->setValue(prefs.gflow);
|
||||||
ui.gfhigh->setValue(prefs.gfhigh);
|
ui.gfhigh->setValue(prefs.gfhigh);
|
||||||
|
@ -779,6 +783,18 @@ void DivePlannerPointsModel::setGFLow(const int ghflow)
|
||||||
triggerGFLow();
|
triggerGFLow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DivePlannerPointsModel::setRebreatherMode(QString mode)
|
||||||
|
{
|
||||||
|
qDebug() << mode << "selected, was" << displayed_dive.dc.dctype;
|
||||||
|
if (mode == "OC")
|
||||||
|
displayed_dive.dc.dctype = OC;
|
||||||
|
else if (mode == "pSCR")
|
||||||
|
displayed_dive.dc.dctype = PSCR;
|
||||||
|
else if (mode == "CCR")
|
||||||
|
displayed_dive.dc.dctype = CCR;
|
||||||
|
plannerModel->emitDataChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void DivePlannerPointsModel::triggerGFLow()
|
void DivePlannerPointsModel::triggerGFLow()
|
||||||
{
|
{
|
||||||
if (diveplan.gflow != tempGFLow) {
|
if (diveplan.gflow != tempGFLow) {
|
||||||
|
|
|
@ -90,6 +90,7 @@ slots:
|
||||||
void deleteTemporaryPlan();
|
void deleteTemporaryPlan();
|
||||||
void loadFromDive(dive *d);
|
void loadFromDive(dive *d);
|
||||||
void emitDataChanged();
|
void emitDataChanged();
|
||||||
|
void setRebreatherMode(QString mode);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void planCreated();
|
void planCreated();
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1084</width>
|
<width>1078</width>
|
||||||
<height>424</height>
|
<height>418</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
@ -262,14 +262,7 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="2">
|
||||||
<widget class="QLabel" name="label_15">
|
|
||||||
<property name="text">
|
|
||||||
<string>GF low</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="gflow">
|
<widget class="QSpinBox" name="gflow">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>%</string>
|
<string>%</string>
|
||||||
|
@ -282,14 +275,48 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="0" column="1">
|
||||||
|
<widget class="QLabel" name="label_15">
|
||||||
|
<property name="text">
|
||||||
|
<string>GF low</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
<widget class="QLabel" name="label_16">
|
<widget class="QLabel" name="label_16">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>GF high</string>
|
<string>GF high</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="4" column="1" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="backgasBreaks">
|
||||||
|
<property name="text">
|
||||||
|
<string>Plan backgas breaks</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="lastStop">
|
||||||
|
<property name="text">
|
||||||
|
<string>Last stop at 6m</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
<widget class="QSpinBox" name="gfhigh">
|
<widget class="QSpinBox" name="gfhigh">
|
||||||
<property name="suffix">
|
<property name="suffix">
|
||||||
<string>%</string>
|
<string>%</string>
|
||||||
|
@ -302,40 +329,23 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="2" column="1" colspan="2">
|
||||||
<widget class="QCheckBox" name="drop_stone_mode">
|
<widget class="QCheckBox" name="drop_stone_mode">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Drop to first depth</string>
|
<string>Drop to first depth</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="5" column="1">
|
||||||
<widget class="QCheckBox" name="lastStop">
|
<widget class="QComboBox" name="rebreathermode">
|
||||||
<property name="text">
|
<property name="currentText">
|
||||||
<string>Last stop at 6m</string>
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="maxVisibleItems">
|
||||||
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="QCheckBox" name="backgasBreaks">
|
|
||||||
<property name="text">
|
|
||||||
<string>Plan backgas breaks</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<spacer name="verticalSpacer_2">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue