mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Minimum gas calculation - Calculations and UI parameters
Add minimum gas calculation to planner output. Add the two UI parameters prefs.sacfactor and prefs.problemsolvingtime. Connect UI signals and slots for recalculation of diveplan. Disable minimum gas calculation if there was already a warning before. If minimum gas result is larger then cylinder start pressure give warning message instead of result. Add line break before pO2 warnings but only if warnings exist. Signed-off-by: Joachim Ritter <jritter@bitsenke.de> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
b8e044dee3
commit
7f8c3592ce
10 changed files with 240 additions and 45 deletions
|
|
@ -300,6 +300,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
ui.display_runtime->setChecked(prefs.display_runtime);
|
||||
ui.display_transitions->setChecked(prefs.display_transitions);
|
||||
ui.safetystop->setChecked(prefs.safetystop);
|
||||
ui.sacfactor->setValue(prefs.sacfactor / 100.0);
|
||||
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
|
||||
ui.bottompo2->setValue(prefs.bottompo2 / 1000.0);
|
||||
ui.decopo2->setValue(prefs.decopo2 / 1000.0);
|
||||
ui.backgasBreaks->setChecked(prefs.doo2breaks);
|
||||
|
|
@ -362,6 +364,8 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
connect(ui.descRate, SIGNAL(valueChanged(int)), this, SLOT(setDescRate(int)));
|
||||
connect(ui.ascRateStops, SIGNAL(valueChanged(int)), this, SLOT(setAscRateStops(int)));
|
||||
connect(ui.ascRateLast6m, SIGNAL(valueChanged(int)), this, SLOT(setAscRateLast6m(int)));
|
||||
connect(ui.sacfactor, SIGNAL(valueChanged(double)), this, SLOT(sacFactorChanged(double)));
|
||||
connect(ui.problemsolvingtime, SIGNAL(valueChanged(int)), this, SLOT(problemSolvingTimeChanged(int)));
|
||||
connect(ui.bottompo2, SIGNAL(valueChanged(double)), this, SLOT(setBottomPo2(double)));
|
||||
connect(ui.decopo2, SIGNAL(valueChanged(double)), this, SLOT(setDecoPo2(double)));
|
||||
connect(ui.bestmixEND, SIGNAL(valueChanged(int)), this, SLOT(setBestmixEND(int)));
|
||||
|
|
@ -480,6 +484,16 @@ void PlannerSettingsWidget::setDescRate(int rate)
|
|||
SettingsObjectWrapper::instance()->planner_settings->setDescrate(rate * UNIT_FACTOR);
|
||||
}
|
||||
|
||||
void PlannerSettingsWidget::sacFactorChanged(const double factor)
|
||||
{
|
||||
plannerModel->setSacFactor(factor);
|
||||
}
|
||||
|
||||
void PlannerSettingsWidget::problemSolvingTimeChanged(const int minutes)
|
||||
{
|
||||
plannerModel->setProblemSolvingTime(minutes);
|
||||
}
|
||||
|
||||
void PlannerSettingsWidget::setBottomPo2(double po2)
|
||||
{
|
||||
SettingsObjectWrapper::instance()->planner_settings->setBottompo2((int) (po2 * 1000.0));
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ slots:
|
|||
void setAscRateStops(int rate);
|
||||
void setAscRateLast6m(int rate);
|
||||
void setDescRate(int rate);
|
||||
void sacFactorChanged(const double factor);
|
||||
void problemSolvingTimeChanged(const int min);
|
||||
void setBottomPo2(double po2);
|
||||
void setDecoPo2(double po2);
|
||||
void setBestmixEND(int depth);
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@
|
|||
</item>
|
||||
<item row="19" column="1">
|
||||
<widget class="QComboBox" name="rebreathermode">
|
||||
<property name="currentText" stdset="0">
|
||||
<property name="currentText">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="maxVisibleItems">
|
||||
|
|
@ -530,7 +530,40 @@
|
|||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="5" column="0">
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="decoStopSAC">
|
||||
<property name="suffix">
|
||||
<string>ℓ/min</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="decosac">
|
||||
<property name="text">
|
||||
<string>Deco SAC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
|
@ -543,7 +576,7 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="bottompo2">
|
||||
<property name="suffix">
|
||||
<string>bar</string>
|
||||
|
|
@ -572,7 +605,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="decopo2">
|
||||
<property name="suffix">
|
||||
<string>bar</string>
|
||||
|
|
@ -588,8 +621,11 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="bestmixEND">
|
||||
<property name="toolTip">
|
||||
<string>Used to calculate best mix. Select best mix depth in 'Available gases' table by entering gas depth, followed by "B" (best trimix mix) or "BN" (best nitrox mix)</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>m</string>
|
||||
</property>
|
||||
|
|
@ -602,9 +638,6 @@
|
|||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Used to calculate best mix. Select best mix depth in 'Available gases' table by entering gas depth, followed by "B" (best trimix mix) or "BN" (best nitrox mix)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
|
|
@ -614,21 +647,21 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="bottompO2">
|
||||
<property name="text">
|
||||
<string>Bottom pO₂</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="bestEND">
|
||||
<property name="text">
|
||||
<string>Best mix END</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="8" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="Notes">
|
||||
<property name="title">
|
||||
<string>Notes</string>
|
||||
|
|
@ -692,45 +725,67 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="decoStopSAC">
|
||||
<property name="suffix">
|
||||
<string>ℓ/min</string>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>99.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="decopO2">
|
||||
<property name="text">
|
||||
<string>Deco pO₂</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="decosac">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="sacFactor">
|
||||
<property name="text">
|
||||
<string>Deco SAC</string>
|
||||
<string>SAC factor</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="sacfactor">
|
||||
<property name="toolTip">
|
||||
<string>Used to calculate minimum gas. Consider two divers with possibly increased SAC after OoG event.</string>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</spacer>
|
||||
<property name="minimum">
|
||||
<double>2.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>10.000000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>4.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="problemSolvingTime">
|
||||
<property name="text">
|
||||
<string>Problem solving time</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="problemsolvingtime">
|
||||
<property name="toolTip">
|
||||
<string>Used to calculate minimum gas. Additional time at max. depth after OoG event.</string>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string>min</string>
|
||||
</property>
|
||||
<property name="prefix">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>4</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
@ -755,6 +810,7 @@
|
|||
<tabstop>gflow</tabstop>
|
||||
<tabstop>gfhigh</tabstop>
|
||||
<tabstop>vpmb_deco</tabstop>
|
||||
<tabstop>vpmb_conservatism</tabstop>
|
||||
<tabstop>drop_stone_mode</tabstop>
|
||||
<tabstop>lastStop</tabstop>
|
||||
<tabstop>backgasBreaks</tabstop>
|
||||
|
|
@ -763,6 +819,8 @@
|
|||
<tabstop>rebreathermode</tabstop>
|
||||
<tabstop>bottomSAC</tabstop>
|
||||
<tabstop>decoStopSAC</tabstop>
|
||||
<tabstop>sacfactor</tabstop>
|
||||
<tabstop>problemsolvingtime</tabstop>
|
||||
<tabstop>bottompo2</tabstop>
|
||||
<tabstop>decopo2</tabstop>
|
||||
<tabstop>bestmixEND</tabstop>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue