mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add a checkbox to turn off plan variations
... as those come with a performance penalty Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
5e9bdce195
commit
a6f186279f
10 changed files with 117 additions and 59 deletions
|
@ -322,6 +322,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
ui.display_duration->setChecked(prefs.display_duration);
|
||||
ui.display_runtime->setChecked(prefs.display_runtime);
|
||||
ui.display_transitions->setChecked(prefs.display_transitions);
|
||||
ui.display_variations->setChecked(prefs.display_variations);
|
||||
ui.safetystop->setChecked(prefs.safetystop);
|
||||
ui.sacfactor->setValue(prefs.sacfactor / 100.0);
|
||||
ui.problemsolvingtime->setValue(prefs.problemsolvingtime);
|
||||
|
@ -355,6 +356,7 @@ PlannerSettingsWidget::PlannerSettingsWidget(QWidget *parent, Qt::WindowFlags f)
|
|||
connect(ui.display_duration, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayDuration(bool)));
|
||||
connect(ui.display_runtime, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayRuntime(bool)));
|
||||
connect(ui.display_transitions, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayTransitions(bool)));
|
||||
connect(ui.display_variations, SIGNAL(toggled(bool)), plannerModel, SLOT(setDisplayVariations(bool)));
|
||||
connect(ui.safetystop, SIGNAL(toggled(bool)), plannerModel, SLOT(setSafetyStop(bool)));
|
||||
connect(ui.reserve_gas, SIGNAL(valueChanged(int)), plannerModel, SLOT(setReserveGas(int)));
|
||||
connect(ui.ascRate75, SIGNAL(valueChanged(int)), plannerModel, SLOT(emitDataChanged()));
|
||||
|
|
|
@ -685,6 +685,23 @@
|
|||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="verbatim_plan">
|
||||
<property name="text">
|
||||
<string>Verbatim dive plan</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="display_transitions">
|
||||
<property name="toolTip">
|
||||
<string>In diveplan, list transitions or treat them as implicit</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Display transitions in deco</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="display_runtime">
|
||||
<property name="toolTip">
|
||||
|
@ -708,20 +725,16 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="display_transitions">
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="display_variations">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>In diveplan, list transitions or treat them as implicit</string>
|
||||
<string>Compute variations of plan (performance cost)</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Display transitions in deco</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="verbatim_plan">
|
||||
<property name="text">
|
||||
<string>Verbatim dive plan</string>
|
||||
<string>Display plan variations</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -12,7 +12,7 @@ int getTotalWork(print_options *printOptions)
|
|||
if (printOptions->print_selected) {
|
||||
// return the correct number depending on all/selected dives
|
||||
// but don't return 0 as we might divide by this number
|
||||
return amount_selected ? amount_selected : 1;
|
||||
return amount_selected && !in_planner() ? amount_selected : 1;
|
||||
}
|
||||
return dive_table.nr;
|
||||
}
|
||||
|
@ -98,15 +98,21 @@ QString TemplateLayout::generate()
|
|||
QVariantList diveList;
|
||||
|
||||
struct dive *dive;
|
||||
int i;
|
||||
for_each_dive (i, dive) {
|
||||
//TODO check for exporting selected dives only
|
||||
if (!dive->selected && PrintOptions->print_selected)
|
||||
continue;
|
||||
DiveObjectHelper *d = new DiveObjectHelper(dive);
|
||||
if (in_planner()) {
|
||||
DiveObjectHelper *d = new DiveObjectHelper(&displayed_dive);
|
||||
diveList.append(QVariant::fromValue(d));
|
||||
progress++;
|
||||
emit progressUpdated(lrint(progress * 100.0 / totalWork));
|
||||
emit progressUpdated(100.0);
|
||||
} else {
|
||||
int i;
|
||||
for_each_dive (i, dive) {
|
||||
//TODO check for exporting selected dives only
|
||||
if (!dive->selected && PrintOptions->print_selected)
|
||||
continue;
|
||||
DiveObjectHelper *d = new DiveObjectHelper(dive);
|
||||
diveList.append(QVariant::fromValue(d));
|
||||
progress++;
|
||||
emit progressUpdated(lrint(progress * 100.0 / totalWork));
|
||||
}
|
||||
}
|
||||
Grantlee::Context c;
|
||||
c.insert("dives", diveList);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue