In planner for different deco modes enable/disable options correctly

Disable option "safety stop" for all deco modes other than
"recreational".

Disable also labels "reserve gas", "GF ..." and "VPM conservatism"
correctly.

Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
Stefan Fuchs 2017-11-02 20:39:58 +01:00 committed by Robert C. Helling
parent 8b56dc30d7
commit 57032e9fcb
2 changed files with 19 additions and 4 deletions

View file

@ -250,13 +250,18 @@ void PlannerSettingsWidget::decoSacChanged(const double decosac)
void PlannerSettingsWidget::disableDecoElements(int mode)
{
if (mode == RECREATIONAL) {
ui.label_gflow->setDisabled(false);
ui.label_gfhigh->setDisabled(false);
ui.gflow->setDisabled(false);
ui.gfhigh->setDisabled(false);
ui.lastStop->setDisabled(true);
ui.backgasBreaks->setDisabled(true);
ui.bottompo2->setDisabled(false);
ui.decopo2->setDisabled(true);
ui.safetystop->setDisabled(false);
ui.label_reserve_gas->setDisabled(false);
ui.reserve_gas->setDisabled(false);
ui.label_vpmb_conservatism->setDisabled(true);
ui.vpmb_conservatism->setDisabled(true);
ui.switch_at_req_stop->setDisabled(true);
ui.min_switch_duration->setDisabled(true);
@ -270,13 +275,18 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
ui.problemsolvingtime->blockSignals(false);
}
else if (mode == VPMB) {
ui.label_gflow->setDisabled(true);
ui.label_gfhigh->setDisabled(true);
ui.gflow->setDisabled(true);
ui.gfhigh->setDisabled(true);
ui.lastStop->setDisabled(false);
ui.backgasBreaks->setDisabled(false);
ui.bottompo2->setDisabled(false);
ui.decopo2->setDisabled(false);
ui.safetystop->setDisabled(true);
ui.label_reserve_gas->setDisabled(true);
ui.reserve_gas->setDisabled(true);
ui.label_vpmb_conservatism->setDisabled(false);
ui.vpmb_conservatism->setDisabled(false);
ui.switch_at_req_stop->setDisabled(false);
ui.min_switch_duration->setDisabled(false);
@ -286,13 +296,18 @@ void PlannerSettingsWidget::disableDecoElements(int mode)
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
}
else if (mode == BUEHLMANN) {
ui.label_gflow->setDisabled(false);
ui.label_gfhigh->setDisabled(false);
ui.gflow->setDisabled(false);
ui.gfhigh->setDisabled(false);
ui.lastStop->setDisabled(false);
ui.backgasBreaks->setDisabled(false);
ui.bottompo2->setDisabled(false);
ui.decopo2->setDisabled(false);
ui.safetystop->setDisabled(true);
ui.label_reserve_gas->setDisabled(true);
ui.reserve_gas->setDisabled(true);
ui.label_vpmb_conservatism->setDisabled(true);
ui.vpmb_conservatism->setDisabled(true);
ui.switch_at_req_stop->setDisabled(false);
ui.min_switch_duration->setDisabled(false);

View file

@ -273,7 +273,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_3">
<widget class="QLabel" name="label_reserve_gas">
<property name="text">
<string>Reserve gas</string>
</property>
@ -338,7 +338,7 @@
</spacer>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_15">
<widget class="QLabel" name="label_gflow">
<property name="text">
<string>GFLow</string>
</property>
@ -355,7 +355,7 @@
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="label_16">
<widget class="QLabel" name="label_gfhigh">
<property name="text">
<string>GFHigh</string>
</property>
@ -490,7 +490,7 @@
</spacer>
</item>
<item row="12" column="1">
<widget class="QLabel" name="label_5">
<widget class="QLabel" name="label_vpmb_conservatism">
<property name="text">
<string>Conservatism level</string>
</property>