mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: Add checkbox to force OC bailout
This adds a checkbox for rebreather modes of the planner that force the ascent to be in OC mode. Before, one had to add a one minute last segment with the mode change but this is not practical when manually searching for the maximal bottom time given gas reserves. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
7f2c7aa7de
commit
2c794348c1
10 changed files with 156 additions and 110 deletions
|
|
@ -123,6 +123,7 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg
|
|||
ui.waterType->setItemData(1, SEAWATER_SALINITY);
|
||||
ui.waterType->setItemData(2, EN13319_SALINITY);
|
||||
waterTypeUpdateTexts();
|
||||
|
||||
QTableView *view = ui.cylinderTableWidget->view();
|
||||
view->setColumnHidden(CylindersModel::START, true);
|
||||
view->setColumnHidden(CylindersModel::END, true);
|
||||
|
|
@ -307,6 +308,10 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
|||
ui.backgasBreaks->blockSignals(true);
|
||||
ui.backgasBreaks->setChecked(false);
|
||||
ui.backgasBreaks->blockSignals(false);
|
||||
ui.bailout->setDisabled(true);
|
||||
ui.bailout->blockSignals(true);
|
||||
ui.bailout->setChecked(false);
|
||||
ui.bailout->blockSignals(false);
|
||||
ui.bottompo2->setDisabled(false);
|
||||
ui.decopo2->setDisabled(true);
|
||||
ui.safetystop->setDisabled(false);
|
||||
|
|
@ -344,6 +349,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
|||
ui.backgasBreaks->setChecked(false);
|
||||
ui.backgasBreaks->blockSignals(false);
|
||||
}
|
||||
ui.bailout->setDisabled(!(displayed_dive.dc.divemode == CCR || displayed_dive.dc.divemode == PSCR));
|
||||
ui.bottompo2->setDisabled(false);
|
||||
ui.decopo2->setDisabled(false);
|
||||
ui.safetystop->setDisabled(true);
|
||||
|
|
@ -377,6 +383,7 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
|
|||
ui.backgasBreaks->setChecked(false);
|
||||
ui.backgasBreaks->blockSignals(false);
|
||||
}
|
||||
ui.bailout->setDisabled(!(displayed_dive.dc.divemode == CCR || displayed_dive.dc.divemode == PSCR));
|
||||
ui.bottompo2->setDisabled(false);
|
||||
ui.decopo2->setDisabled(false);
|
||||
ui.safetystop->setDisabled(true);
|
||||
|
|
@ -438,6 +445,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
ui.bottompo2->setValue(prefs.bottompo2 / 1000.0);
|
||||
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
|
||||
ui.backgasBreaks->setChecked(prefs.doo2breaks);
|
||||
setBailout(false);
|
||||
setBailoutVisibility(false);
|
||||
ui.drop_stone_mode->setChecked(prefs.drop_stone_mode);
|
||||
ui.switch_at_req_stop->setChecked(prefs.switch_at_req_stop);
|
||||
ui.min_switch_duration->setValue(prefs.min_switch_duration / 60);
|
||||
|
|
@ -481,9 +490,11 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
connect(ui.gflow, SIGNAL(valueChanged(int)), plannerModel, SLOT(setGFLow(int)));
|
||||
connect(ui.vpmb_conservatism, SIGNAL(valueChanged(int)), plannerModel, SLOT(setVpmbConservatism(int)));
|
||||
connect(ui.backgasBreaks, SIGNAL(toggled(bool)), this, SLOT(setBackgasBreaks(bool)));
|
||||
connect(ui.bailout, SIGNAL(toggled(bool)), this, SLOT(setBailout(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)));
|
||||
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), plannerModel, SLOT(setRebreatherMode(int)));
|
||||
connect(ui.rebreathermode, SIGNAL(currentIndexChanged(int)), this, SLOT(setBailoutVisibility(int)));
|
||||
|
||||
connect(ui.bottompo2, SIGNAL(valueChanged(double)), CylindersModel::instance(), SLOT(updateBestMixes()));
|
||||
connect(ui.bestmixEND, SIGNAL(valueChanged(int)), CylindersModel::instance(), SLOT(updateBestMixes()));
|
||||
|
|
@ -656,6 +667,17 @@ void PlannerSettingsWidget::setBackgasBreaks(bool dobreaks)
|
|||
plannerModel->emitDataChanged();
|
||||
}
|
||||
|
||||
void PlannerSettingsWidget::setBailout(bool dobailout)
|
||||
{
|
||||
qPrefDivePlanner::instance()->set_dobailout(dobailout);
|
||||
plannerModel->emitDataChanged();
|
||||
}
|
||||
|
||||
void PlannerSettingsWidget::setBailoutVisibility(int mode)
|
||||
{
|
||||
ui.bailout->setDisabled(!(mode == CCR || mode == PSCR));
|
||||
}
|
||||
|
||||
PlannerDetails::PlannerDetails(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
|
|
|
|||
|
|
@ -85,9 +85,11 @@ slots:
|
|||
void setDecoPo2(double po2);
|
||||
void setBestmixEND(int depth);
|
||||
void setBackgasBreaks(bool dobreaks);
|
||||
void setBailout(bool dobailout);
|
||||
void disableDecoElements(int mode);
|
||||
void disableBackgasBreaks(bool enabled);
|
||||
void setDiveMode(int mode);
|
||||
void setBailoutVisibility(int mode);
|
||||
|
||||
private:
|
||||
Ui::plannerSettingsWidget ui;
|
||||
|
|
|
|||
|
|
@ -1005,6 +1005,7 @@ void MainWindow::on_actionDivePlanner_triggered()
|
|||
// plan the dive in the same mode as the currently selected one
|
||||
if (current_dive) {
|
||||
divePlannerSettingsWidget->setDiveMode(current_dive->dc.divemode);
|
||||
divePlannerSettingsWidget->setBailoutVisibility(current_dive->dc.divemode);
|
||||
if (current_dive->salinity)
|
||||
divePlannerWidget->setSalinity(current_dive->salinity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@
|
|||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="2" column="2">
|
||||
<item row="4" column="2">
|
||||
<widget class="QSpinBox" name="reserve_gas">
|
||||
<property name="suffix">
|
||||
<string>bar</string>
|
||||
|
|
@ -274,7 +274,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="6" column="1">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
@ -287,7 +287,7 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="18" column="1" colspan="2">
|
||||
<item row="22" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="switch_at_req_stop">
|
||||
<property name="toolTip">
|
||||
<string>Postpone gas change if a stop is not required</string>
|
||||
|
|
@ -297,74 +297,37 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QLabel" name="label_gfhigh">
|
||||
<item row="18" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="lastStop">
|
||||
<property name="text">
|
||||
<string>GFHigh</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>25</number>
|
||||
<string>Last stop at 6m</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QLabel" name="label_gflow">
|
||||
<property name="text">
|
||||
<string>GFLow</string>
|
||||
<item row="15" column="2">
|
||||
<widget class="QSpinBox" name="vpmb_conservatism">
|
||||
<property name="prefix">
|
||||
<string>+</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>26</number>
|
||||
<property name="maximum">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="2">
|
||||
<widget class="QSpinBox" name="gflow">
|
||||
<item row="12" column="2">
|
||||
<widget class="QSpinBox" name="gfhigh">
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="drop_stone_mode">
|
||||
<property name="text">
|
||||
<string>Drop to first depth</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="1">
|
||||
<widget class="QLabel" name="label_min_switch_duration">
|
||||
<property name="text">
|
||||
<string>Min. switch duration O₂% below 100%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="21" 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="17" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="backgasBreaks">
|
||||
<property name="text">
|
||||
<string>Plan backgas breaks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="19" column="2">
|
||||
<item row="23" column="2">
|
||||
<widget class="QSpinBox" name="min_switch_duration">
|
||||
<property name="suffix">
|
||||
<string>min</string>
|
||||
|
|
@ -383,14 +346,74 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="lastStop">
|
||||
<item row="20" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="backgasBreaks">
|
||||
<property name="text">
|
||||
<string>Last stop at 6m</string>
|
||||
<string>Plan backgas breaks</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="25" 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="23" column="1">
|
||||
<widget class="QLabel" name="label_min_switch_duration">
|
||||
<property name="text">
|
||||
<string>Min. switch duration O₂% below 100%</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="17" column="1" colspan="2">
|
||||
<widget class="QCheckBox" name="drop_stone_mode">
|
||||
<property name="text">
|
||||
<string>Drop to first depth</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="2">
|
||||
<widget class="QSpinBox" name="gflow">
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QLabel" name="label_gflow">
|
||||
<property name="text">
|
||||
<string>GFLow</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>26</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QLabel" name="label_gfhigh">
|
||||
<property name="text">
|
||||
<string>GFHigh</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QRadioButton" name="recreational_deco">
|
||||
<property name="toolTip">
|
||||
<string>Maximize bottom time allowed by gas and no decompression limits</string>
|
||||
|
|
@ -400,47 +423,24 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="2">
|
||||
<widget class="QSpinBox" name="gfhigh">
|
||||
<property name="suffix">
|
||||
<string>%</string>
|
||||
<item row="15" column="1">
|
||||
<widget class="QLabel" name="label_vpmb_conservatism">
|
||||
<property name="text">
|
||||
<string>Conservatism level</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>40</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>150</number>
|
||||
<property name="indent">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<item row="14" column="1">
|
||||
<widget class="QRadioButton" name="vpmb_deco">
|
||||
<property name="text">
|
||||
<string>VPM-B deco</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QRadioButton" name="buehlmann_deco">
|
||||
<property name="text">
|
||||
<string>Bühlmann deco</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_reserve_gas">
|
||||
<property name="text">
|
||||
<string>Reserve gas</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>26</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1" alignment="Qt::AlignHCenter">
|
||||
<item row="5" column="1" alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="safetystop">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
|
|
@ -453,7 +453,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<item row="13" column="1">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
@ -466,7 +466,7 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<item row="16" column="1">
|
||||
<spacer name="verticalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
@ -479,26 +479,6 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QLabel" name="label_vpmb_conservatism">
|
||||
<property name="text">
|
||||
<string>Conservatism level</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="2">
|
||||
<widget class="QSpinBox" name="vpmb_conservatism">
|
||||
<property name="prefix">
|
||||
<string>+</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QComboBox" name="rebreathermode">
|
||||
<property name="currentText">
|
||||
|
|
@ -516,6 +496,33 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QRadioButton" name="buehlmann_deco">
|
||||
<property name="text">
|
||||
<string>Bühlmann deco</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_reserve_gas">
|
||||
<property name="text">
|
||||
<string>Reserve gas</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>26</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="bailout">
|
||||
<property name="text">
|
||||
<string>Bailout: Deco on OC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue