DBViewer: added "Restore default GUI settings" menu action

This commit is contained in:
matlabbe
2017-04-24 16:20:41 -04:00
parent 6e1dbbcf4f
commit 27313bc3d6
3 changed files with 66 additions and 18 deletions

View File

@@ -191,6 +191,7 @@ DatabaseViewer::DatabaseViewer(const QString & ini, QWidget * parent) :
parameters.insert(*Parameters::getDefaultParameters().find(Parameters::kRGBDLoopClosureReextractFeatures()));
ui_->parameters_toolbox->setupUi(parameters);
exportDialog_->setObjectName("ExportCloudsDialog");
restoreDefaultSettings();
this->readSettings();
setupMainLayout(ui_->actionVertical_Layout->isChecked());
@@ -237,6 +238,7 @@ DatabaseViewer::DatabaseViewer(const QString & ini, QWidget * parent) :
connect(ui_->actionRegenerate_local_grid_maps, SIGNAL(triggered()), this, SLOT(regenerateLocalMaps()));
connect(ui_->actionRegenerate_local_grid_maps_selected, SIGNAL(triggered()), this, SLOT(regenerateCurrentLocalMaps()));
connect(ui_->actionReset_all_changes, SIGNAL(triggered()), this, SLOT(resetAllChanges()));
connect(ui_->actionRestore_default_GUI_settings, SIGNAL(triggered()), this, SLOT(restoreDefaultSettings()));
//ICP buttons
connect(ui_->pushButton_refine, SIGNAL(clicked()), this, SLOT(refineConstraint()));
@@ -621,6 +623,45 @@ void DatabaseViewer::writeSettings()
this->setWindowModified(false);
}
void DatabaseViewer::restoreDefaultSettings()
{
// reset GUI parameters
ui_->comboBox_logger_level->setCurrentIndex(1);
ui_->checkBox_alignPosesWithGroundTruth->setChecked(true);
ui_->checkBox_spanAllMaps->setChecked(true);
ui_->checkBox_ignorePoseCorrection->setChecked(false);
ui_->checkBox_ignoreGlobalLoop->setChecked(false);
ui_->checkBox_ignoreLocalLoopSpace->setChecked(false);
ui_->checkBox_ignoreLocalLoopTime->setChecked(false);
ui_->checkBox_ignoreUserLoop->setChecked(false);
ui_->spinBox_optimizationDepth->setValue(0);
ui_->doubleSpinBox_gainCompensationRadius->setValue(0.0);
ui_->doubleSpinBox_gridCellSize->setValue(0.05);
ui_->groupBox_posefiltering->setChecked(false);
ui_->doubleSpinBox_posefilteringRadius->setValue(0.1);
ui_->doubleSpinBox_posefilteringAngle->setValue(30);
ui_->checkBox_gridErode->setChecked(false);
ui_->checkBox_octomap->setChecked(false);
ui_->checkBox_mesh_quad->setChecked(true);
ui_->spinBox_mesh_angleTolerance->setValue(15);
ui_->spinBox_mesh_minClusterSize->setValue(0);
ui_->spinBox_mesh_fillDepthHoles->setValue(false);
ui_->spinBox_mesh_depthError->setValue(10);
ui_->spinBox_mesh_triangleSize->setValue(2);
ui_->spinBox_icp_decimation->setValue(1);
ui_->doubleSpinBox_icp_maxDepth->setValue(0.0);
ui_->doubleSpinBox_icp_minDepth->setValue(0.0);
ui_->checkBox_icp_from_depth->setChecked(false);
ui_->doubleSpinBox_detectMore_radius->setValue(1.0);
ui_->doubleSpinBox_detectMore_angle->setValue(30.0);
ui_->spinBox_detectMore_iterations->setValue(5);
}
void DatabaseViewer::openDatabase()
{
QString path = QFileDialog::getOpenFileName(this, tr("Select file"), pathDatabase_, tr("Databases (*.db)"));

View File

@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1392</width>
<width>1465</width>
<height>965</height>
</rect>
</property>
@@ -52,8 +52,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>337</width>
<height>208</height>
<width>353</width>
<height>196</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1">
@@ -210,8 +210,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>337</width>
<height>208</height>
<width>353</width>
<height>196</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1">
@@ -483,8 +483,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1392</width>
<height>22</height>
<width>1465</width>
<height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@@ -521,6 +521,7 @@
<addaction name="actionEdit_depth_image"/>
<addaction name="separator"/>
<addaction name="actionReset_all_changes"/>
<addaction name="actionRestore_default_GUI_settings"/>
<addaction name="separator"/>
<addaction name="actionView_3D_map"/>
<addaction name="actionView_3D_laser_scans"/>
@@ -999,15 +1000,15 @@
<item>
<widget class="QToolBox" name="toolBox">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="page_3">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>324</width>
<height>188</height>
<width>339</width>
<height>186</height>
</rect>
</property>
<attribute name="label">
@@ -1142,8 +1143,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>280</width>
<height>608</height>
<width>282</width>
<height>569</height>
</rect>
</property>
<attribute name="label">
@@ -1179,7 +1180,7 @@
<number>3</number>
</property>
<property name="minimum">
<double>0.010000000000000</double>
<double>0.001000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
@@ -1473,8 +1474,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>272</width>
<height>126</height>
<width>205</width>
<height>117</height>
</rect>
</property>
<attribute name="label">
@@ -1573,8 +1574,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>272</width>
<height>288</height>
<width>184</width>
<height>487</height>
</rect>
</property>
<attribute name="label">
@@ -2118,7 +2119,7 @@
</action>
<action name="actionReset_all_changes">
<property name="text">
<string>Reset all changes</string>
<string>Reset link and grid map changes</string>
</property>
</action>
<action name="actionGenerate_g2o_graph_g2o">
@@ -2162,6 +2163,11 @@
<string>Vertical Layout</string>
</property>
</action>
<action name="actionRestore_default_GUI_settings">
<property name="text">
<string>Restore default GUI settings</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>