UI: Added option to change map resolution on UI side, save/restore thresholds in figures, fixed basic panel's slam/rgbd mode checkboxes not changing the state of corresponding parameters.

This commit is contained in:
matlabbe
2024-04-12 17:12:23 -07:00
parent fbbab1c077
commit a3267c9da6
8 changed files with 213 additions and 45 deletions
+22 -1
View File
@@ -584,10 +584,11 @@ void StatsToolBox::contextMenuEvent(QContextMenuEvent * event)
}
}
void StatsToolBox::getFiguresSetup(QList<int> & curvesPerFigure, QStringList & curveNames)
void StatsToolBox::getFiguresSetup(QList<int> & curvesPerFigure, QStringList & curveNames, QStringList & curveThresholds)
{
curvesPerFigure.clear();
curveNames.clear();
curveThresholds.clear();
for(QMap<QString, QWidget*>::iterator i=_figures.begin(); i!=_figures.end(); ++i)
{
QList<UPlot *> plots = i.value()->findChildren<UPlot *>();
@@ -596,6 +597,10 @@ void StatsToolBox::getFiguresSetup(QList<int> & curvesPerFigure, QStringList & c
QStringList names = plots[0]->curveNames();
curvesPerFigure.append(names.size());
curveNames.append(names);
for(int j=0; j<names.size(); ++j)
{
curveThresholds.append(plots[0]->isThreshold(names[j])?QString::number(plots[0]->getThresholdValue(names[j])):"NA");
}
}
else
{
@@ -628,6 +633,22 @@ void StatsToolBox::addCurve(const QString & name, bool newFigure, bool cacheOn)
ULOGGER_ERROR("Not supposed to be here...");
}
}
void StatsToolBox::addThreshold(const QString & name, qreal value)
{
QString plotName = _plotMenu->actions().last()->text();
QWidget * fig = _figures.value(plotName, (QWidget*)0);
if(fig)
{
UPlot * plot = fig->findChild<UPlot *>(plotName);
if(plot)
plot->addThreshold(name, value);
}
else
{
UERROR("There are no figures, cannot add threshold \"%s\"", name.toStdString().c_str());
}
}
void StatsToolBox::setWorkingDirectory(const QString & workingDirectory)
{