19 #include <QColorDialog> 20 #include <QFileDialog> 27 #include <ui_PlotTableConfigWidget.h> 40 menuImportExport_(new QMenu(this)),
45 ui_->labelBackgroundColor->setAutoFillBackground(
true);
46 ui_->labelForegroundColor->setAutoFillBackground(
true);
48 ui_->widgetProgress->setEnabled(
false);
50 ui_->pushButtonRun->setIcon(
52 append(
"/resource/16x16/run.png"))));
53 ui_->pushButtonPause->setIcon(
55 append(
"/resource/16x16/pause.png"))));
56 ui_->pushButtonClear->setIcon(
58 append(
"/resource/16x16/clear.png"))));
59 ui_->pushButtonImportExport->setIcon(
61 append(
"/resource/16x16/eject.png"))));
63 ui_->pushButtonPause->setEnabled(
false);
73 connect(
ui_->spinBoxRows, SIGNAL(valueChanged(
int)),
this,
75 connect(
ui_->spinBoxColumns, SIGNAL(valueChanged(
int)),
this,
78 connect(
ui_->checkBoxLinkScale, SIGNAL(stateChanged(
int)),
this,
80 connect(
ui_->checkBoxLinkCursor, SIGNAL(stateChanged(
int)),
this,
82 connect(
ui_->checkBoxTrackPoints, SIGNAL(stateChanged(
int)),
this,
85 connect(
ui_->pushButtonRun, SIGNAL(clicked()),
this,
87 connect(
ui_->pushButtonPause, SIGNAL(clicked()),
this,
89 connect(
ui_->pushButtonClear, SIGNAL(clicked()),
this,
91 connect(
ui_->pushButtonImportExport, SIGNAL(clicked()),
this,
94 ui_->labelBackgroundColor->installEventFilter(
this);
95 ui_->labelForegroundColor->installEventFilter(
this);
109 disconnect(
config_, SIGNAL(backgroundColorChanged(
const QColor&)),
111 disconnect(
config_, SIGNAL(foregroundColorChanged(
const QColor&)),
113 disconnect(
config_, SIGNAL(numPlotsChanged(
size_t,
size_t)),
115 disconnect(
config_, SIGNAL(linkScaleChanged(
bool)),
117 disconnect(
config_, SIGNAL(linkCursorChanged(
bool)),
119 disconnect(
config_, SIGNAL(trackPointsChanged(
bool)),
126 connect(config, SIGNAL(backgroundColorChanged(
const QColor&)),
128 connect(config, SIGNAL(foregroundColorChanged(
const QColor&)),
130 connect(config, SIGNAL(numPlotsChanged(
size_t,
size_t)),
132 connect(config, SIGNAL(linkScaleChanged(
bool)),
134 connect(config, SIGNAL(linkCursorChanged(
bool)),
136 connect(config, SIGNAL(trackPointsChanged(
bool)),
156 disconnect(
plotTable_, SIGNAL(plotPausedChanged()),
158 disconnect(
plotTable_, SIGNAL(jobStarted(
const QString&)),
160 disconnect(
plotTable_, SIGNAL(jobProgressChanged(
double)),
162 disconnect(
plotTable_, SIGNAL(jobFinished(
const QString&)),
164 disconnect(
plotTable_, SIGNAL(jobFailed(
const QString&)),
171 connect(plotTable, SIGNAL(plotPausedChanged()),
173 connect(plotTable, SIGNAL(jobStarted(
const QString&)),
175 connect(plotTable, SIGNAL(jobProgressChanged(
double)),
177 connect(plotTable, SIGNAL(jobFinished(
const QString&)),
179 connect(plotTable, SIGNAL(jobFailed(
const QString&)),
203 if (((
object ==
ui_->labelBackgroundColor) ||
204 (
object ==
ui_->labelForegroundColor)) &&
205 (event->type() == QEvent::MouseButtonPress)) {
206 QColorDialog dialog(
this);
208 dialog.setCurrentColor((
object ==
ui_->labelBackgroundColor) ?
211 if (dialog.exec() == QDialog::Accepted) {
212 if (
object ==
ui_->labelBackgroundColor)
229 QPalette palette =
ui_->labelBackgroundColor->palette();
230 palette.setColor(QPalette::Window, color);
232 ui_->labelBackgroundColor->setPalette(palette);
237 QPalette palette =
ui_->labelForegroundColor->palette();
238 palette.setColor(QPalette::Window, color);
240 ui_->labelForegroundColor->setPalette(palette);
245 ui_->spinBoxRows->setValue(numRows);
246 ui_->spinBoxColumns->setValue(numColumns);
250 ui_->checkBoxLinkScale->setCheckState(link ? Qt::Checked : Qt::Unchecked);
254 ui_->checkBoxLinkCursor->setCheckState(link ? Qt::Checked : Qt::Unchecked);
258 ui_->checkBoxTrackPoints->setCheckState(track ? Qt::Checked :
307 QFileDialog dialog(
this,
"Open Bag", QDir::homePath(),
310 dialog.setAcceptMode(QFileDialog::AcceptOpen);
311 dialog.setFileMode(QFileDialog::ExistingFile);
313 if (dialog.exec() == QDialog::Accepted)
318 QFileDialog dialog(
this,
"Save Image File", QDir::homePath(),
319 "Portable Network Graphics (*.png)");
321 dialog.setAcceptMode(QFileDialog::AcceptSave);
322 dialog.setFileMode(QFileDialog::AnyFile);
323 dialog.selectFile(
"rqt_multiplot.png");
325 if (dialog.exec() == QDialog::Accepted)
330 QFileDialog dialog(
this,
"Save Text File", QDir::homePath(),
331 "Text file (*.txt)");
333 dialog.setAcceptMode(QFileDialog::AcceptSave);
334 dialog.setFileMode(QFileDialog::AnyFile);
335 dialog.selectFile(
"rqt_multiplot.txt");
337 if (dialog.exec() == QDialog::Accepted)
343 bool allPlotsPaused =
true;
344 bool anyPlotPaused =
false;
354 ui_->pushButtonRun->setEnabled(anyPlotPaused);
355 ui_->pushButtonPause->setEnabled(!allPlotsPaused);
360 ui_->widgetProgress->setEnabled(
true);
362 ui_->widgetProgress->start(toolTip);
366 ui_->widgetProgress->setCurrentProgress(progress);
370 ui_->widgetProgress->finish(toolTip);
374 ui_->widgetProgress->fail(toolTip);
void setNumRows(size_t numRows)
bool arePointsTracked() const
const QColor & getForegroundColor() const
void setNumColumns(size_t numColumns)
const QColor & getBackgroundColor() const
void setForegroundColor(const QColor &color)
void setLinkCursor(bool link)
size_t getNumColumns() const
void setLinkScale(bool link)
void setBackgroundColor(const QColor &color)
bool isCursorLinked() const
ROSLIB_DECL std::string getPath(const std::string &package_name)
size_t getNumRows() const
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
bool isScaleLinked() const
void setTrackPoints(bool track)