console_window.cpp
Go to the documentation of this file.
1 // *****************************************************************************
2 //
3 // Copyright (c) 2015, Southwest Research Institute® (SwRI®)
4 // All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are met:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of Southwest Research Institute® (SwRI®) nor the
14 // names of its contributors may be used to endorse or promote products
15 // derived from this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL Southwest Research Institute® BE LIABLE
21 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27 // DAMAGE.
28 //
29 // *****************************************************************************
30 
31 #include <stdint.h>
32 #include <stdio.h>
33 #include <set>
34 
35 #include <rosgraph_msgs/Log.h>
36 #include <ros/master.h> // required for getURI, VCM 12 April 2017
37 
38 
44 
45 #include <QColorDialog>
46 #include <QRegExp>
47 #include <QApplication>
48 #include <QClipboard>
49 #include <QDateTime>
50 #include <QFileDialog>
51 #include <QDir>
52 #include <QScrollBar>
53 #include <QMenu>
54 #include <QSettings>
55 
56 using namespace Qt;
57 
58 namespace swri_console {
59 
60 ConsoleWindow::ConsoleWindow(LogDatabase *db)
61  :
62  QMainWindow(),
63  db_(db),
64  db_proxy_(new LogDatabaseProxyModel(db)),
65  node_list_model_(new NodeListModel(db)),
66  node_click_handler_(new NodeClickHandler())
67 {
68  ui.setupUi(this);
69 
70  QObject::connect(ui.action_NewWindow, SIGNAL(triggered(bool)),
71  this, SIGNAL(createNewWindow()));
72 
73  QObject::connect(ui.action_Copy, SIGNAL(triggered()),
74  this, SLOT(copyLogs()));
75 
76  QObject::connect(ui.action_CopyExtended, SIGNAL(triggered()),
77  this, SLOT(copyExtendedLogs()));
78 
79  QObject::connect(ui.action_SelectAll, SIGNAL(triggered()),
80  this, SLOT(selectAllLogs()));
81 
82  QObject::connect(ui.action_ReadBagFile, SIGNAL(triggered(bool)),
83  this, SIGNAL(readBagFile()));
84 
85  QObject::connect(ui.action_ReadLogFile, SIGNAL(triggered(bool)),
86  this, SIGNAL(readLogFile()));
87 
88  QObject::connect(ui.action_ReadLogDirectory, SIGNAL(triggered(bool)),
89  this, SIGNAL(readLogDirectory()));
90 
91  QObject::connect(ui.action_SaveLogs, SIGNAL(triggered(bool)),
92  this, SLOT(saveLogs()));
93 
94  QObject::connect(ui.action_AbsoluteTimestamps, SIGNAL(toggled(bool)),
95  db_proxy_, SLOT(setAbsoluteTime(bool)));
96 
97  QObject::connect(ui.action_Use_human_readable_time, SIGNAL(toggled(bool)),
98  db_proxy_, SLOT(setHumanReadableTime(bool)));
99 
100  QObject::connect(ui.action_ShowTimestamps, SIGNAL(toggled(bool)),
101  db_proxy_, SLOT(setDisplayTime(bool)));
102 
103  QObject::connect(ui.action_ShowLoggerName, SIGNAL(toggled(bool)),
104  db_proxy_, SLOT(setDisplayLogger(bool)));
105 
106  QObject::connect(ui.action_ShowFunctionName, SIGNAL(toggled(bool)),
107  db_proxy_, SLOT(setDisplayFunction(bool)));
108 
109  QObject::connect(ui.action_RegularExpressions, SIGNAL(toggled(bool)),
110  db_proxy_, SLOT(setUseRegularExpressions(bool)));
111 
112  QObject::connect(ui.action_RegularExpressions, SIGNAL(toggled(bool)),
113  this, SLOT(updateIncludeLabel()));
114 
115  QObject::connect(ui.action_RegularExpressions, SIGNAL(toggled(bool)),
116  this, SLOT(updateExcludeLabel()));
117 
118  QObject::connect(ui.action_SelectFont, SIGNAL(triggered(bool)),
119  this, SIGNAL(selectFont()));
120 
121  QObject::connect(ui.action_ColorizeLogs, SIGNAL(toggled(bool)),
122  db_proxy_, SLOT(setColorizeLogs(bool)));
123 
124  QObject::connect(ui.debugColorWidget, SIGNAL(clicked(bool)),
125  this, SLOT(setDebugColor()));
126  QObject::connect(ui.infoColorWidget, SIGNAL(clicked(bool)),
127  this, SLOT(setInfoColor()));
128  QObject::connect(ui.warnColorWidget, SIGNAL(clicked(bool)),
129  this, SLOT(setWarnColor()));
130  QObject::connect(ui.errorColorWidget, SIGNAL(clicked(bool)),
131  this, SLOT(setErrorColor()));
132  QObject::connect(ui.fatalColorWidget, SIGNAL(clicked(bool)),
133  this, SLOT(setFatalColor()));
134 
135  ui.nodeList->setModel(node_list_model_);
136  ui.messageList->setModel(db_proxy_);
137  ui.messageList->setUniformItemSizes(true);
138 
139  QObject::connect(
140  ui.nodeList->selectionModel(),
141  SIGNAL(selectionChanged(const QItemSelection &,
142  const QItemSelection &)),
143  this,
144  SLOT(nodeSelectionChanged()));
145 
146  ui.nodeList->installEventFilter(node_click_handler_);
147 
148  QObject::connect(
149  ui.checkDebug, SIGNAL(toggled(bool)),
150  this, SLOT(setSeverityFilter()));
151  QObject::connect(
152  ui.checkInfo, SIGNAL(toggled(bool)),
153  this, SLOT(setSeverityFilter()));
154  QObject::connect(
155  ui.checkWarn, SIGNAL(toggled(bool)),
156  this, SLOT(setSeverityFilter()));
157  QObject::connect(
158  ui.checkError, SIGNAL(toggled(bool)),
159  this, SLOT(setSeverityFilter()));
160  QObject::connect(
161  ui.checkFatal, SIGNAL(toggled(bool)),
162  this, SLOT(setSeverityFilter()));
163  QObject::connect(
164  db_proxy_, SIGNAL(messagesAdded()),
165  this, SLOT(messagesAdded()));
166  QObject::connect(ui.checkFollowNewest, SIGNAL(toggled(bool)),
167  this, SLOT(setFollowNewest(bool)));
168 
169  // Right-click menu for the message list
170  QObject::connect(ui.messageList, SIGNAL(customContextMenuRequested(const QPoint&)),
171  this, SLOT(showLogContextMenu(const QPoint&)));
172 
173  QObject::connect(ui.clearAllButton, SIGNAL(clicked()),
174  this, SLOT(clearAll()));
175  QObject::connect(ui.clearMessagesButton, SIGNAL(clicked()),
176  this, SLOT(clearMessages()));
177 
178  QObject::connect(
179  ui.messageList->verticalScrollBar(), SIGNAL(valueChanged(int)),
180  this, SLOT(userScrolled(int)));
181 
182  QObject::connect(
183  ui.includeText, SIGNAL(textChanged(const QString &)),
184  this, SLOT(includeFilterUpdated(const QString &)));
185 
186  QObject::connect(
187  ui.excludeText, SIGNAL(textChanged(const QString &)),
188  this, SLOT(excludeFilterUpdated(const QString &)));
189 
190  // Connect 'Search' text modification to searchIndex, VCM 13 April 2017
191  QObject::connect(
192  ui.searchText, SIGNAL(textChanged(const QString &)),
193  this, SLOT(searchIndex()));
194  // Connect pushPrev to prevIndex()
195  QObject::connect(ui.pushPrev, SIGNAL(clicked()),
196  this, SLOT(prevIndex()));
197  // Connect pushNext to nextIndex()
198  QObject::connect(ui.pushNext, SIGNAL(clicked()),
199  this, SLOT(nextIndex()));
200 
201 
202  QList<int> sizes;
203  sizes.append(100);
204  sizes.append(1000);
205  ui.splitter->setSizes(sizes);
206 
207  loadSettings();
208 }
209 
211 {
212  delete db_proxy_;
213 }
214 
216 {
217  db_->clear();
219  db_proxy_->clearSearchFailure(); // resets failed search variables, VCM 27 April 2017
220 }
221 
223 {
224  db_->clear();
225  db_proxy_->clearSearchFailure(); // resets failed search variables, VCM 27 April 2017
226 }
227 
229 {
230  QString defaultname = QDateTime::currentDateTime().toString(Qt::ISODate) + ".bag";
231  QString filename = QFileDialog::getSaveFileName(this,
232  "Save Logs",
233  QDir::homePath() + QDir::separator() + defaultname,
234  tr("Bag Files (*.bag);;Text Files (*.txt)"));
235  if (filename != NULL && !filename.isEmpty()) {
236  db_proxy_->saveToFile(filename);
237  }
238 }
239 
240 void ConsoleWindow::connected(bool connected)
241 {
242  if (connected) {
243  // When connected, display current URL along with status in the status bar, VCM 4/12/2017
244  QString currentUrl = QString::fromStdString(ros::master::getURI());
245  statusBar()->showMessage("Connected to ROS Master. URL: "+currentUrl);
246  } else {
247  statusBar()->showMessage("Disconnected from ROS Master.");
248  }
249 }
250 
251 void ConsoleWindow::closeEvent(QCloseEvent *event)
252 {
253  QMainWindow::closeEvent(event);
254 }
255 
257 {
258  db_proxy_->clearSearchFailure(); // clear search failure criteria, VCM 26 April 2017
259  QModelIndexList selection = ui.nodeList->selectionModel()->selectedIndexes();
260  std::set<std::string> nodes;
261  QStringList node_names;
262 
263  for (int i = 0; i < selection.size(); i++) {
264  std::string name = node_list_model_->nodeName(selection[i]);
265  nodes.insert(name);
266  node_names.append(name.c_str());
267  }
268 
269  db_proxy_->setNodeFilter(nodes);
270 
271  for (int i = 0; i < node_names.size(); i++) {
272  node_names[i] = node_names[i].split("/", QString::SkipEmptyParts).last();
273  }
274 
275  setWindowTitle(QString("SWRI Console (") + node_names.join(", ") + ")");
276 }
277 
279 {
280  uint8_t mask = 0;
281 
282  if (ui.checkDebug->isChecked()) {
283  mask |= rosgraph_msgs::Log::DEBUG;
284  }
285  if (ui.checkInfo->isChecked()) {
286  mask |= rosgraph_msgs::Log::INFO;
287  }
288  if (ui.checkWarn->isChecked()) {
289  mask |= rosgraph_msgs::Log::WARN;
290  }
291  if (ui.checkError->isChecked()) {
292  mask |= rosgraph_msgs::Log::ERROR;
293  }
294  if (ui.checkFatal->isChecked()) {
295  mask |= rosgraph_msgs::Log::FATAL;
296  }
297 
298  QSettings settings;
299  settings.setValue(SettingsKeys::SHOW_DEBUG, ui.checkDebug->isChecked());
300  settings.setValue(SettingsKeys::SHOW_INFO, ui.checkInfo->isChecked());
301  settings.setValue(SettingsKeys::SHOW_WARN, ui.checkWarn->isChecked());
302  settings.setValue(SettingsKeys::SHOW_ERROR, ui.checkError->isChecked());
303  settings.setValue(SettingsKeys::SHOW_FATAL, ui.checkFatal->isChecked());
304 
306  db_proxy_->clearSearchFailure(); // resets search failure variables, VCM 27 April 2017
307 }
308 
310 {
311  if (ui.checkFollowNewest->isChecked()) {
312  ui.messageList->scrollToBottom();
313  }
314 }
315 
316 
317 void ConsoleWindow::showLogContextMenu(const QPoint& point)
318 {
319  QMenu contextMenu(tr("Context menu"), ui.messageList);
320 
321  QAction select_all(tr("Select All"), ui.messageList);
322  connect(&select_all, SIGNAL(triggered()), this, SLOT(selectAllLogs()));
323 
324  QAction copy(tr("Copy"), ui.messageList);
325  connect(&copy, SIGNAL(triggered()), this, SLOT(copyLogs()));
326 
327  QAction copy_extended(tr("Copy Extended"), ui.messageList);
328  connect(&copy_extended, SIGNAL(triggered()), this, SLOT(copyExtendedLogs()));
329 
330  QAction alternate_row_colors(tr("Alternate Row Colors"), ui.messageList);
331  alternate_row_colors.setCheckable(true);
332  alternate_row_colors.setChecked(ui.messageList->alternatingRowColors());
333  connect(&alternate_row_colors, SIGNAL(toggled(bool)),
334  this, SLOT(toggleAlternateRowColors(bool)));
335 
336  contextMenu.addAction(&select_all);
337  contextMenu.addAction(&copy);
338  contextMenu.addAction(&copy_extended);
339  contextMenu.addAction(&alternate_row_colors);
340 
341  contextMenu.exec(ui.messageList->mapToGlobal(point));
342 }
343 
345 {
346  if (value != ui.messageList->verticalScrollBar()->maximum()) {
347  ui.checkFollowNewest->setChecked(false);
348  } else {
349  ui.checkFollowNewest->setChecked(true);
350  }
351 }
352 
353 
355 {
356  if (ui.nodeList->hasFocus()) {
357  ui.nodeList->selectAll();
358  } else {
359  ui.messageList->selectAll();
360  }
361 }
362 
364 {
365  QStringList buffer;
366  foreach(const QModelIndex &index, ui.messageList->selectionModel()->selectedIndexes())
367  {
368  buffer << db_proxy_->data(index, Qt::DisplayRole).toString();
369  }
370  QApplication::clipboard()->setText(buffer.join(tr("\n")));
371 }
372 
374 {
375  QStringList buffer;
376  foreach(const QModelIndex &index, ui.messageList->selectionModel()->selectedIndexes())
377  {
378  buffer << db_proxy_->data(index, LogDatabaseProxyModel::ExtendedLogRole).toString();
379  }
380  QApplication::clipboard()->setText(buffer.join(tr("\n\n")));
381 }
382 
384 {
385  QSettings settings;
386  settings.setValue(SettingsKeys::FOLLOW_NEWEST, follow);
387 }
388 
389 void ConsoleWindow::includeFilterUpdated(const QString &text)
390 {
391  QStringList items = text.split(";", QString::SkipEmptyParts);
392  QStringList filtered;
393 
394  for (int i = 0; i < items.size(); i++) {
395  QString x = items[i].trimmed();
396  if (!x.isEmpty()) {
397  filtered.append(x);
398  }
399  }
400 
401  db_proxy_->setIncludeFilters(filtered);
403  db_proxy_->clearSearchFailure(); // resets failed search variables, VCM 27 April 2017
405 }
406 
407 void ConsoleWindow::excludeFilterUpdated(const QString &text)
408 {
409  QStringList items = text.split(";", QString::SkipEmptyParts);
410  QStringList filtered;
411 
412  for (int i = 0; i < items.size(); i++) {
413  QString x = items[i].trimmed();
414  if (!x.isEmpty()) {
415  filtered.append(x);
416  }
417  }
418 
419  db_proxy_->setExcludeFilters(filtered);
421  db_proxy_->clearSearchFailure(); // resets failed search variables, VCM 27 April 2017
423 }
424 
425 // Slot called when 'Search' text modified, 13 April 2017 VCM
427 {
429 }
430 // Slot called when 'Previous' button pushed, 13 April 2017 VCM
432 {
434 }
435 // Slot called when 'Next' button pushed, 13 April 2017 VCM
437 {
439 }
440 
441 // Search Function sF Definitions:
442 // 1)search - user modified 'Search' text
443 // 2)next - user pressed 'Next' button
444 // 3)prev - user pressed 'Previous' button
445 // Locates and selects the next item based on search criteria, VCM 26 April 2017
447 {
448  int rowSearchStart = ui.messageList->currentIndex().row(); // retrieve current index
449  int increment = 1; // used for search/next/prev; prev(ious) increment will change to -1
450  QString searchText = ui.searchText->text(); // actual text to search for
451  searchText = searchText.toUpper().trimmed(); // remove lowercase and lead/trailing spaces.
452  // next button pushed
453  if(sF == NEXT){
454  rowSearchStart++; // start search row after current.
455  }
456  // Previous button pushed
457  else if(sF== PREV){
458  rowSearchStart--; // start search row before current
459  increment=-1; // -1 to move search up instead of down
460  }
461  // search text modified
462  else if(sF==SEARCH )
463  {
464  if (rowSearchStart==-1){
465  rowSearchStart =0; // for search, no selection (-1) index change to 0
466  }
467  }
468  else
469  {
470  // should not end up here
471  printf("Invalid string passed to ConsoleWindow::nextIndex");
472  return;
473  }
474  // calls getItemIndex in log_database_proxy_m, returns new index
475  int newRowIndex = db_proxy_->getItemIndex(searchText,rowSearchStart, increment);
476  ui.messageList->clearSelection(); // clear current selection
477  if(newRowIndex == -1) // indicates no match.
478  {
479  return;
480  }
481 
482  QModelIndex index = ui.messageList->model()->index(newRowIndex,0); // defines desired index
483  ui.messageList->setCurrentIndex(index); // sets desired index, re-centers screen on new index
484  ui.checkFollowNewest->setChecked(false); // stops scrolling if search found
485 
486 
487 }
488 
489 
491 {
492  if (db_proxy_->isIncludeValid()) {
493  ui.includeLabel->setText("Include");
494  } else {
495  ui.includeLabel->setText("<font color='red'>Include</font>");
496  }
497 }
498 
500 {
501  if (db_proxy_->isExcludeValid()) {
502  ui.excludeLabel->setText("Exclude");
503  } else {
504  ui.excludeLabel->setText("<font color='red'>Exclude</font>");
505  }
506 }
507 
508 void ConsoleWindow::setFont(const QFont &font)
509 {
510  ui.messageList->setFont(font);
511  ui.nodeList->setFont(font);
512 }
513 
515 {
516  chooseButtonColor(ui.debugColorWidget);
517 }
518 
520 {
521  chooseButtonColor(ui.infoColorWidget);
522 }
523 
525 {
526  chooseButtonColor(ui.warnColorWidget);
527 }
528 
530 {
531  chooseButtonColor(ui.errorColorWidget);
532 }
533 
535 {
536  chooseButtonColor(ui.fatalColorWidget);
537 }
538 
539 void ConsoleWindow::chooseButtonColor(QPushButton* widget)
540 {
541  QColor old_color = getButtonColor(widget);
542  QColor color = QColorDialog::getColor(old_color, this);
543  if (color.isValid()) {
544  updateButtonColor(widget, color);
545  }
546 }
547 
548 QColor ConsoleWindow::getButtonColor(const QPushButton* button) const
549 {
550  QString ss = button->styleSheet();
551  QRegExp re("background: (#\\w*);");
552  QColor old_color;
553  if (re.indexIn(ss) >= 0) {
554  old_color = QColor(re.cap(1));
555  }
556  return old_color;
557 }
558 
559 void ConsoleWindow::updateButtonColor(QPushButton* widget, const QColor& color)
560 {
561  QString s("background: #"
562  + QString(color.red() < 16? "0" : "") + QString::number(color.red(),16)
563  + QString(color.green() < 16? "0" : "") + QString::number(color.green(),16)
564  + QString(color.blue() < 16? "0" : "") + QString::number(color.blue(),16) + ";");
565  widget->setStyleSheet(s);
566  widget->update();
567 
568  if (widget == ui.debugColorWidget) {
569  db_proxy_->setDebugColor(color);
570  }
571  else if (widget == ui.infoColorWidget) {
572  db_proxy_->setInfoColor(color);
573  }
574  else if (widget == ui.warnColorWidget) {
575  db_proxy_->setWarnColor(color);
576  }
577  else if (widget == ui.errorColorWidget) {
578  db_proxy_->setErrorColor(color);
579  }
580  else if (widget == ui.fatalColorWidget) {
581  db_proxy_->setFatalColor(color);
582  }
583  else {
584  qWarning("Unexpected widget passed to ConsoleWindow::updateButtonColor.");
585  }
586 }
587 
588 void ConsoleWindow::loadColorButtonSetting(const QString& key, QPushButton* button)
589 {
590  QSettings settings;
591  QColor defaultColor;
592  // The color buttons don't have a default value set in the .ui file, so we need to
593  // supply defaults for them here in case the appropriate setting isn't found.
594  if (button == ui.debugColorWidget) {
595  defaultColor = Qt::gray;
596  }
597  else if (button == ui.infoColorWidget) {
598  defaultColor = Qt::black;
599  }
600  else if (button == ui.warnColorWidget) {
601  defaultColor = QColor(255, 127, 0);
602  }
603  else if (button == ui.errorColorWidget) {
604  defaultColor = Qt::red;
605  }
606  else if (button == ui.fatalColorWidget) {
607  defaultColor = Qt::magenta;
608  }
609  QColor color = settings.value(key, defaultColor).value<QColor>();
610  updateButtonColor(button, color);
611 }
612 
614 {
615  ui.messageList->setAlternatingRowColors(checked);
616 
617  QSettings settings;
618  settings.setValue(SettingsKeys::ALTERNATE_LOG_ROW_COLORS, checked);
619 }
620 
622 {
623  // First, load all the boolean settings...
625  loadBooleanSetting(SettingsKeys::ABSOLUTE_TIMESTAMPS, ui.action_AbsoluteTimestamps);
626  loadBooleanSetting(SettingsKeys::HUMAN_READABLE_TIME, ui.action_Use_human_readable_time);
627  loadBooleanSetting(SettingsKeys::USE_REGEXPS, ui.action_RegularExpressions);
628  loadBooleanSetting(SettingsKeys::COLORIZE_LOGS, ui.action_ColorizeLogs);
630 
631  QSettings settings;
632  // Enable or disable the humanreadable time stamps based on the state of the display timestamp
633  bool displayTimestamp = settings.value(SettingsKeys::DISPLAY_TIMESTAMPS, true).toBool();
634  ui.action_Use_human_readable_time->setEnabled(displayTimestamp);
635  // The severity level has to be handled a little differently, since they're all combined
636  // into a single integer mask under the hood. First they have to be loaded from the settings,
637  // then set in the UI, then the mask has to actually be applied.
638  bool showDebug = settings.value(SettingsKeys::SHOW_DEBUG, true).toBool();
639  bool showInfo = settings.value(SettingsKeys::SHOW_INFO, true).toBool();
640  bool showWarn = settings.value(SettingsKeys::SHOW_WARN, true).toBool();
641  bool showError = settings.value(SettingsKeys::SHOW_ERROR, true).toBool();
642  bool showFatal = settings.value(SettingsKeys::SHOW_FATAL, true).toBool();
643  ui.checkDebug->setChecked(showDebug);
644  ui.checkInfo->setChecked(showInfo);
645  ui.checkWarn->setChecked(showWarn);
646  ui.checkError->setChecked(showError);
647  ui.checkFatal->setChecked(showFatal);
649 
650  // Load button colors.
656 
657  // Finally, load the filter contents.
658  QString includeFilter = settings.value(SettingsKeys::INCLUDE_FILTER, "").toString();
659  ui.includeText->setText(includeFilter);
660  QString excludeFilter = settings.value(SettingsKeys::EXCLUDE_FILTER, "").toString();
661  ui.excludeText->setText(excludeFilter);
662 
663  bool alternate_row_colors = settings.value(SettingsKeys::ALTERNATE_LOG_ROW_COLORS, true).toBool();
664  ui.messageList->setAlternatingRowColors(alternate_row_colors);
665 }
666 } // namespace swri_console
667 
swri_console::ConsoleWindow::updateIncludeLabel
void updateIncludeLabel()
Definition: console_window.cpp:490
swri_console::SettingsKeys::DISPLAY_TIMESTAMPS
static const QString DISPLAY_TIMESTAMPS
Definition: settings_keys.h:47
swri_console::SettingsKeys::SHOW_FATAL
static const QString SHOW_FATAL
Definition: settings_keys.h:59
swri_console::LogDatabaseProxyModel::setExcludeFilters
void setExcludeFilters(const QStringList &list)
Definition: log_database_proxy_model.cpp:212
swri_console::SettingsKeys::INFO_COLOR
static const QString INFO_COLOR
Definition: settings_keys.h:63
swri_console::ConsoleWindow::messagesAdded
void messagesAdded()
Definition: console_window.cpp:309
swri_console::LogDatabaseProxyModel::saveToFile
void saveToFile(const QString &filename) const
Definition: log_database_proxy_model.cpp:566
swri_console::ConsoleWindow::setDebugColor
void setDebugColor()
Definition: console_window.cpp:514
swri_console::SettingsKeys::FATAL_COLOR
static const QString FATAL_COLOR
Definition: settings_keys.h:66
swri_console::LogDatabase::clear
void clear()
Definition: log_database.cpp:45
swri_console::ConsoleWindow::prevIndex
void prevIndex()
Definition: console_window.cpp:431
swri_console::LogDatabaseProxyModel::getItemIndex
int getItemIndex(const QString searchText, int index, int increment)
Definition: log_database_proxy_model.cpp:308
swri_console::SettingsKeys::USE_REGEXPS
static const QString USE_REGEXPS
Definition: settings_keys.h:52
swri_console::LogDatabaseProxyModel::setIncludeFilters
void setIncludeFilters(const QStringList &list)
Definition: log_database_proxy_model.cpp:203
swri_console::ConsoleWindow::db_proxy_
LogDatabaseProxyModel * db_proxy_
Definition: console_window.h:118
s
XmlRpcServer s
swri_console::SettingsKeys::WARN_COLOR
static const QString WARN_COLOR
Definition: settings_keys.h:64
swri_console::ConsoleWindow::~ConsoleWindow
~ConsoleWindow()
Definition: console_window.cpp:210
swri_console::ConsoleWindow::nodeSelectionChanged
void nodeSelectionChanged()
Definition: console_window.cpp:256
swri_console::LogDatabaseProxyModel::setExcludeRegexpPattern
void setExcludeRegexpPattern(const QString &pattern)
Definition: log_database_proxy_model.cpp:230
swri_console::SettingsKeys::SHOW_WARN
static const QString SHOW_WARN
Definition: settings_keys.h:57
swri_console::SettingsKeys::ALTERNATE_LOG_ROW_COLORS
static const QString ALTERNATE_LOG_ROW_COLORS
Definition: settings_keys.h:68
swri_console::NodeListModel::clear
void clear()
Definition: node_list_model.cpp:88
console_window.h
swri_console::LogDatabaseProxyModel::isIncludeValid
bool isIncludeValid() const
Definition: log_database_proxy_model.cpp:288
swri_console::ConsoleWindow::getButtonColor
QColor getButtonColor(const QPushButton *button) const
Definition: console_window.cpp:548
swri_console::ConsoleWindow::selectFont
void selectFont()
swri_console::ConsoleWindow::loadSettings
void loadSettings()
Definition: console_window.cpp:621
swri_console::ConsoleWindow::clearAll
void clearAll()
Definition: console_window.cpp:215
swri_console::LogDatabaseProxyModel::setFatalColor
void setFatalColor(const QColor &fatal_color)
Definition: log_database_proxy_model.cpp:270
swri_console::ConsoleWindow::updateExcludeLabel
void updateExcludeLabel()
Definition: console_window.cpp:499
swri_console::ConsoleWindow::PREV
@ PREV
Definition: console_window.h:97
swri_console::LogDatabaseProxyModel::setDebugColor
void setDebugColor(const QColor &debug_color)
Definition: log_database_proxy_model.cpp:238
swri_console::ConsoleWindow::updateCurrentIndex
void updateCurrentIndex(function sF)
Definition: console_window.cpp:446
swri_console::ConsoleWindow::connected
void connected(bool)
Definition: console_window.cpp:240
swri_console::ConsoleWindow::readLogDirectory
void readLogDirectory()
swri_console::LogDatabaseProxyModel::setWarnColor
void setWarnColor(const QColor &warn_color)
Definition: log_database_proxy_model.cpp:254
swri_console::ConsoleWindow::NEXT
@ NEXT
Definition: console_window.h:97
swri_console::NodeListModel::nodeName
std::string nodeName(const QModelIndex &index) const
Definition: node_list_model.cpp:58
swri_console::ConsoleWindow::clearMessages
void clearMessages()
Definition: console_window.cpp:222
swri_console::LogDatabaseProxyModel::ExtendedLogRole
@ ExtendedLogRole
Definition: log_database_proxy_model.h:55
swri_console::ConsoleWindow::loadColorButtonSetting
void loadColorButtonSetting(const QString &key, QPushButton *button)
Definition: console_window.cpp:588
swri_console::ConsoleWindow::loadBooleanSetting
void loadBooleanSetting(const QString &key, T *element)
Definition: console_window.h:105
swri_console::ConsoleWindow::toggleAlternateRowColors
void toggleAlternateRowColors(bool)
Definition: console_window.cpp:613
swri_console::ConsoleWindow::readBagFile
void readBagFile()
swri_console::LogDatabaseProxyModel::setIncludeRegexpPattern
void setIncludeRegexpPattern(const QString &pattern)
Definition: log_database_proxy_model.cpp:222
swri_console::NodeListModel
Definition: node_list_model.h:42
swri_console::SettingsKeys::FOLLOW_NEWEST
static const QString FOLLOW_NEWEST
Definition: settings_keys.h:60
swri_console::ConsoleWindow::setFont
void setFont(const QFont &font)
Definition: console_window.cpp:508
swri_console::LogDatabaseProxyModel::clearSearchFailure
void clearSearchFailure()
Definition: log_database_proxy_model.cpp:377
swri_console::SettingsKeys::DEBUG_COLOR
static const QString DEBUG_COLOR
Definition: settings_keys.h:62
swri_console::NodeClickHandler
Definition: node_click_handler.h:50
swri_console::ConsoleWindow::selectAllLogs
void selectAllLogs()
Definition: console_window.cpp:354
swri_console::ConsoleWindow::saveLogs
void saveLogs()
Definition: console_window.cpp:228
swri_console::LogDatabase
Definition: log_database.h:55
log_database.h
swri_console::SettingsKeys::EXCLUDE_FILTER
static const QString EXCLUDE_FILTER
Definition: settings_keys.h:54
swri_console::ConsoleWindow::setFollowNewest
void setFollowNewest(bool)
Definition: console_window.cpp:383
swri_console::LogDatabaseProxyModel::setSeverityFilter
void setSeverityFilter(uint8_t severity_mask)
Definition: log_database_proxy_model.cpp:91
swri_console::ConsoleWindow::setErrorColor
void setErrorColor()
Definition: console_window.cpp:529
swri_console::LogDatabaseProxyModel::isExcludeValid
bool isExcludeValid() const
Definition: log_database_proxy_model.cpp:296
swri_console::SettingsKeys::COLORIZE_LOGS
static const QString COLORIZE_LOGS
Definition: settings_keys.h:67
swri_console::ConsoleWindow::setSeverityFilter
void setSeverityFilter()
Definition: console_window.cpp:278
swri_console::ConsoleWindow::showLogContextMenu
void showLogContextMenu(const QPoint &point)
Definition: console_window.cpp:317
swri_console::ConsoleWindow::chooseButtonColor
void chooseButtonColor(QPushButton *widget)
Definition: console_window.cpp:539
swri_console::SettingsKeys::ABSOLUTE_TIMESTAMPS
static const QString ABSOLUTE_TIMESTAMPS
Definition: settings_keys.h:48
swri_console::ConsoleWindow::setFatalColor
void setFatalColor()
Definition: console_window.cpp:534
swri_console::ConsoleWindow::node_click_handler_
NodeClickHandler * node_click_handler_
Definition: console_window.h:120
swri_console
Definition: bag_reader.h:40
swri_console::ConsoleWindow::ui
Ui::ConsoleWindow ui
Definition: console_window.h:116
swri_console::SettingsKeys::HUMAN_READABLE_TIME
static const QString HUMAN_READABLE_TIME
Definition: settings_keys.h:49
swri_console::SettingsKeys::SHOW_INFO
static const QString SHOW_INFO
Definition: settings_keys.h:56
swri_console::LogDatabaseProxyModel
Definition: log_database_proxy_model.h:49
swri_console::ConsoleWindow::setInfoColor
void setInfoColor()
Definition: console_window.cpp:519
log_database_proxy_model.h
swri_console::ConsoleWindow::closeEvent
void closeEvent(QCloseEvent *event)
Definition: console_window.cpp:251
swri_console::ConsoleWindow::nextIndex
void nextIndex()
Definition: console_window.cpp:436
swri_console::LogDatabaseProxyModel::setErrorColor
void setErrorColor(const QColor &error_color)
Definition: log_database_proxy_model.cpp:262
swri_console::SettingsKeys::ERROR_COLOR
static const QString ERROR_COLOR
Definition: settings_keys.h:65
swri_console::SettingsKeys::SHOW_DEBUG
static const QString SHOW_DEBUG
Definition: settings_keys.h:55
settings_keys.h
swri_console::ConsoleWindow::copyExtendedLogs
void copyExtendedLogs()
Definition: console_window.cpp:373
swri_console::ConsoleWindow::setWarnColor
void setWarnColor()
Definition: console_window.cpp:524
node_list_model.h
swri_console::ConsoleWindow::updateButtonColor
void updateButtonColor(QPushButton *widget, const QColor &color)
Definition: console_window.cpp:559
swri_console::SettingsKeys::INCLUDE_FILTER
static const QString INCLUDE_FILTER
Definition: settings_keys.h:53
swri_console::ConsoleWindow::searchIndex
void searchIndex()
Definition: console_window.cpp:426
swri_console::LogDatabaseProxyModel::setNodeFilter
void setNodeFilter(const std::set< std::string > &names)
Definition: log_database_proxy_model.cpp:85
swri_console::LogDatabaseProxyModel::setInfoColor
void setInfoColor(const QColor &info_color)
Definition: log_database_proxy_model.cpp:246
swri_console::ConsoleWindow::createNewWindow
void createNewWindow()
swri_console::SettingsKeys::SHOW_ERROR
static const QString SHOW_ERROR
Definition: settings_keys.h:58
swri_console::ConsoleWindow::excludeFilterUpdated
void excludeFilterUpdated(const QString &)
Definition: console_window.cpp:407
swri_console::ConsoleWindow::SEARCH
@ SEARCH
Definition: console_window.h:97
ros::master::getURI
const ROSCPP_DECL std::string & getURI()
master.h
swri_console::ConsoleWindow::readLogFile
void readLogFile()
swri_console::ConsoleWindow::copyLogs
void copyLogs()
Definition: console_window.cpp:363
swri_console::ConsoleWindow::db_
LogDatabase * db_
Definition: console_window.h:117
swri_console::ConsoleWindow::userScrolled
void userScrolled(int)
Definition: console_window.cpp:344
swri_console::LogDatabaseProxyModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Definition: log_database_proxy_model.cpp:384
swri_console::ConsoleWindow::node_list_model_
NodeListModel * node_list_model_
Definition: console_window.h:119
swri_console::ConsoleWindow::includeFilterUpdated
void includeFilterUpdated(const QString &)
Definition: console_window.cpp:389


swri_console
Author(s): P. J. Reed , Jerry Towler , David Anthony
autogenerated on Sat Sep 23 2023 02:55:36