mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
GUI: Fixed loaded parameters not actually modified from opened database
This commit is contained in:
@@ -129,7 +129,7 @@ public:
|
||||
QString loadCustomConfig(const QString & section, const QString & key);
|
||||
|
||||
rtabmap::ParametersMap getAllParameters() const;
|
||||
void setParameter(const std::string & key, const std::string & value);
|
||||
void updateParameters(const ParametersMap & parameters);
|
||||
|
||||
//General panel
|
||||
int getGeneralLoggerLevel() const;
|
||||
@@ -317,6 +317,8 @@ protected:
|
||||
virtual void writeCameraSettings(const QString & filePath = QString()) const;
|
||||
virtual void writeCoreSettings(const QString & filePath = QString()) const;
|
||||
|
||||
void setParameter(const std::string & key, const std::string & value);
|
||||
|
||||
private:
|
||||
void readSettings(const QString & filePath = QString());
|
||||
void writeSettings(const QString & filePath = QString());
|
||||
|
||||
@@ -3797,10 +3797,7 @@ void MainWindow::openDatabase(const QString & path)
|
||||
QMessageBox::Yes);
|
||||
if(r == QMessageBox::Yes)
|
||||
{
|
||||
for(rtabmap::ParametersMap::const_iterator iter = differentParameters.begin(); iter!=differentParameters.end(); ++iter)
|
||||
{
|
||||
_preferencesDialog->setParameter(iter->first.c_str(), iter->second.c_str());
|
||||
}
|
||||
_preferencesDialog->updateParameters(differentParameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2649,6 +2649,21 @@ rtabmap::ParametersMap PreferencesDialog::getAllParameters() const
|
||||
return parameters;
|
||||
}
|
||||
|
||||
void PreferencesDialog::updateParameters(const ParametersMap & parameters)
|
||||
{
|
||||
if(parameters.size())
|
||||
{
|
||||
for(rtabmap::ParametersMap::const_iterator iter = parameters.begin(); iter!=parameters.end(); ++iter)
|
||||
{
|
||||
this->setParameter(iter->first, iter->second);
|
||||
}
|
||||
if(!this->isVisible())
|
||||
{
|
||||
this->writeSettings(getTmpIniFilePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PreferencesDialog::selectSourceDriver(Src src)
|
||||
{
|
||||
if(src >= kSrcRGBD && src<kSrcStereo)
|
||||
@@ -3151,7 +3166,7 @@ void PreferencesDialog::addParameter(const QObject * object, double value)
|
||||
{
|
||||
if(object)
|
||||
{
|
||||
UDEBUG("modify param %s=%s", object->objectName().toStdString().c_str(), uBool2Str(value).c_str());
|
||||
UDEBUG("modify param %s=%f", object->objectName().toStdString().c_str(), value);
|
||||
uInsert(_modifiedParameters, rtabmap::ParametersPair(object->objectName().toStdString(), QString::number(value).toStdString()));
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user