log_database_proxy_model.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 <stdio.h>
32 #include <algorithm>
33 #include <iterator>
34 #include <iomanip>
35 #include <chrono>
36 #include <ctime>
37 
38 #include <ros/time.h>
39 #include <rosbag/bag.h>
40 
44 
45 #include <QColor>
46 #include <QFile>
47 #include <QTextStream>
48 #include <QTimer>
49 #include <QSettings>
50 #include <QtGlobal>
51 
52 namespace swri_console
53 {
55  :
56  colorize_logs_(true),
57  display_time_(true),
58  display_absolute_time_(false),
59  human_readable_time_(false),
60  display_logger_(false),
61  display_function_(false),
62  use_regular_expressions_(false),
63  debug_color_(Qt::gray),
64  info_color_(Qt::black),
65  warn_color_(QColor(255,127,0)),
66  error_color_(Qt::red),
67  fatal_color_(Qt::magenta),
68  db_(db),
69  failedSearchText_(""),
70  failedSearchIndex_(0)
71 {
72  QObject::connect(db_, SIGNAL(databaseCleared()),
73  this, SLOT(handleDatabaseCleared()));
74  QObject::connect(db_, SIGNAL(messagesAdded()),
75  this, SLOT(processNewMessages()));
76 
77  QObject::connect(db_, SIGNAL(minTimeUpdated()),
78  this, SLOT(minTimeUpdated()));
79 }
80 
82 {
83 }
84 
85 void LogDatabaseProxyModel::setNodeFilter(const std::set<std::string> &names)
86 {
87  names_ = names;
88  reset();
89 }
90 
91 void LogDatabaseProxyModel::setSeverityFilter(uint8_t severity_mask)
92 {
93  severity_mask_ = severity_mask;
94  reset();
95 }
96 
98 {
99  if (absolute == display_absolute_time_) {
100  return;
101  }
102 
103  display_absolute_time_ = absolute;
104 
105  QSettings settings;
107 
108  if (display_time_ && msg_mapping_.size()) {
109  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
110  }
111 }
112 void LogDatabaseProxyModel::setHumanReadableTime(bool human_readable_time)
113 {
114  if (human_readable_time == human_readable_time_) {
115  return;
116  }
117 
118  human_readable_time_ = human_readable_time;
119 
120  QSettings settings;
122 
123  if (display_time_ && msg_mapping_.size()) {
124  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
125  }
126 }
127 
129 {
130  if (colorize_logs == colorize_logs_) {
131  return;
132  }
133 
134  colorize_logs_ = colorize_logs;
135  QSettings settings;
136  settings.setValue(SettingsKeys::COLORIZE_LOGS, colorize_logs_);
137 
138  if (msg_mapping_.size()) {
139  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
140  }
141 }
142 
144 {
145  if (display == display_time_) {
146  return;
147  }
148 
149  display_time_ = display;
150 
151  QSettings settings;
153 
154  if (msg_mapping_.size()) {
155  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
156  }
157 }
158 
160 {
161  if (logger_name == display_logger_) {
162  return;
163  }
164 
165  display_logger_ = logger_name;
166 
167  QSettings settings;
168  settings.setValue(SettingsKeys::DISPLAY_LOGGER, display_logger_);
169 
170  if (!msg_mapping_.empty()) {
171  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
172  }
173 }
174 
176 {
177  if (function_name == display_function_) {
178  return;
179  }
180 
181  display_function_ = function_name;
182 
183  QSettings settings;
185 
186  if (!msg_mapping_.empty()) {
187  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
188  }
189 }
190 
192 {
193  if (useRegexps == use_regular_expressions_) {
194  return;
195  }
196 
197  use_regular_expressions_ = useRegexps;
198  QSettings settings;
199  settings.setValue(SettingsKeys::USE_REGEXPS, useRegexps);
200  reset();
201 }
202 
204  const QStringList &list)
205 {
206  include_strings_ = list;
207  // The text and regexp filters are always updated at the same time, so this
208  // value will be saved by setIncludeRegexpPattern.
209  reset();
210 }
211 
213  const QStringList &list)
214 {
215  exclude_strings_ = list;
216  // The text and regexp filters are always updated at the same time, so this
217  // value will be saved by setExcludeRegexpPattern.
218  reset();
219 }
220 
221 
223 {
224  include_regexp_.setPattern(pattern);
225  QSettings settings;
226  settings.setValue(SettingsKeys::INCLUDE_FILTER, pattern);
227  reset();
228 }
229 
231 {
232  exclude_regexp_.setPattern(pattern);
233  QSettings settings;
234  settings.setValue(SettingsKeys::EXCLUDE_FILTER, pattern);
235  reset();
236 }
237 
238 void LogDatabaseProxyModel::setDebugColor(const QColor& debug_color)
239 {
240  debug_color_ = debug_color;
241  QSettings settings;
242  settings.setValue(SettingsKeys::DEBUG_COLOR, debug_color);
243  reset();
244 }
245 
246 void LogDatabaseProxyModel::setInfoColor(const QColor& info_color)
247 {
248  info_color_ = info_color;
249  QSettings settings;
250  settings.setValue(SettingsKeys::INFO_COLOR, info_color);
251  reset();
252 }
253 
254 void LogDatabaseProxyModel::setWarnColor(const QColor& warn_color)
255 {
256  warn_color_ = warn_color;
257  QSettings settings;
258  settings.setValue(SettingsKeys::WARN_COLOR, warn_color);
259  reset();
260 }
261 
262 void LogDatabaseProxyModel::setErrorColor(const QColor& error_color)
263 {
264  error_color_ = error_color;
265  QSettings settings;
266  settings.setValue(SettingsKeys::ERROR_COLOR, error_color);
267  reset();
268 }
269 
270 void LogDatabaseProxyModel::setFatalColor(const QColor& fatal_color)
271 {
272  fatal_color_ = fatal_color;
273  QSettings settings;
274  settings.setValue(SettingsKeys::FATAL_COLOR, fatal_color);
275  reset();
276 }
277 
278 int LogDatabaseProxyModel::rowCount(const QModelIndex &parent) const
279 {
280  if (parent.isValid()) {
281  return 0;
282  }
283 
284  return msg_mapping_.size();
285 }
286 
287 
289 {
290  if (use_regular_expressions_ && !include_regexp_.isValid()) {
291  return false;
292  }
293  return true;
294 }
295 
297 {
298  if (use_regular_expressions_ && !exclude_regexp_.isValid()) {
299  return false;
300  }
301  return true;
302 }
303 
304 // Locates the next index based on search criteria, VCM 25 April 2017
305 // searchText_ - string from searchText, all upper case and trimmed spaces
306 // index - currently selected item in messageList
307 // increment - +1 = next||search(i.e. down), -1 = prev (i.e. up)
308 int LogDatabaseProxyModel::getItemIndex(const QString searchText, int index, int increment)
309 {
310  int searchNotFound = -1; // indicates search not found
311  int counter=0; // used to stop loop once full list has been searched
312  bool partialSearch = false; // tells main loop to run a partial search, triggered by prior failed search
313  if(searchText==""||msg_mapping_.size()==0) // skip search for 1)empty string 2)empty set
314  {
315  clearSearchFailure(); // reset failed search variables
316  return searchNotFound;
317  }
318 
319  // round corners for searches
320  if(index<0) // if index < 0, set to size()-1;
321  {
322  index = msg_mapping_.size()-1;
323  }
324  else if(index>=msg_mapping_.size()) // if index >size(), set to 0;
325  {
326  index = 0;
327  }
328 
329  // trigger partial search if:
330  // searchText_ conaints prior failed text
331  // prior failed text is not empty
332  // failed index is not 0
333  // failed search index isn't greater than current index, this could happen through user
334  // interface message selection. Software should clear the variables when UI is adjusted.
335  if(searchText.contains(failedSearchText_) && failedSearchText_ != "" && failedSearchIndex_ !=0 && failedSearchIndex_ <= msg_mapping_.size() )
336  {
337  partialSearch = true;
338  index = failedSearchIndex_-1;
339  counter = failedSearchIndex_;
340  }
341  int i;
342  for(i=0; i<msg_mapping_.size();i++) // loop through all messages until end or match is found
343  {
344  const LineMap line_idx = msg_mapping_[index];
345  const LogEntry &item = db_->log()[line_idx.log_index];
346  QString tempString = item.text.join("|"); // concatenate strings
347  if(tempString.toUpper().contains(searchText)) // search match found
348  {
349  clearSearchFailure(); // reset failed search variables
350  return index; // match found, return location and exit loop
351  }
352  counter++; // used to track total search length
353  if(counter>=msg_mapping_.size()) // exit if all messages have been scanned
354  {
355  if((!partialSearch)||(failedSearchText_ == "")) // store failed text if one isn't already stored
356  {
357  failedSearchText_ = searchText;
358  }
360  return searchNotFound; // match not found, return -1 and exit loop
361  }
362  // increment (next/search) or decrement (prev) index then address corner rounding
363  index = index + increment;
364  if(index<0) // less than 0 set to max
365  {
366  index = msg_mapping_.size()-1;
367  }
368  else if(index>=msg_mapping_.size()) // greater than max, set to 0
369  {
370  index = 0;
371  }
372  }
373 
374  return -1;
375 }
376 
378 {
379  // reset failed search variables, VCM 27 April 2017
380  failedSearchIndex_ = 0;
381  failedSearchText_ = "";
382 }
383 
385  const QModelIndex &index, int role) const
386 {
387  switch (role)
388  {
389  // Currently we're only returning data for these roles, so return immediately
390  // if we're being queried for anything else.
391  case Qt::DisplayRole:
392  case Qt::ToolTipRole:
393  case ExtendedLogRole:
394  break;
395  case Qt::ForegroundRole:
396  if (colorize_logs_) {
397  break;
398  }
399  default:
400  return QVariant();
401  }
402 
403  if (index.parent().isValid() &&
404  static_cast<size_t>(index.row()) >= msg_mapping_.size()) {
405  return QVariant();
406  }
407 
408  const LineMap line_idx = msg_mapping_[index.row()];
409  const LogEntry &item = db_->log()[line_idx.log_index];
410 
411  if (role == Qt::DisplayRole) {
412  char level = '?';
413  if (item.level == rosgraph_msgs::Log::DEBUG) {
414  level = 'D';
415  } else if (item.level == rosgraph_msgs::Log::INFO) {
416  level = 'I';
417  } else if (item.level == rosgraph_msgs::Log::WARN) {
418  level = 'W';
419  } else if (item.level == rosgraph_msgs::Log::ERROR) {
420  level = 'E';
421  } else if (item.level == rosgraph_msgs::Log::FATAL) {
422  level = 'F';
423  }
424 
425  char stamp[128];
427 
429  int milliseconds = item.stamp.nsec / 1000000 ;
430  const time_t time = static_cast<time_t>(item.stamp.sec);
431  std::ostringstream oss;
432  oss << std::put_time(std::localtime(&time), "%Y-%m-%d %H:%M:%S");
433  snprintf(stamp, sizeof(stamp), "%s::%03d",oss.str().c_str(), milliseconds);
434  }else{
435  snprintf(stamp, sizeof(stamp),
436  "%u.%09u",
437  item.stamp.sec,
438  item.stamp.nsec);
439  }
440  } else {
441  ros::Duration t = item.stamp - db_->minTime();
442 
443  int32_t secs = t.sec;
444  int hours = secs / 60 / 60;
445  int minutes = (secs / 60) % 60;
446  int seconds = (secs % 60);
447  int milliseconds = t.nsec / 1000000;
448 
449  snprintf(stamp, sizeof(stamp),
450  "%d:%02d:%02d:%03d",
451  hours, minutes, seconds, milliseconds);
452  }
453 
454  char id[256];
456  snprintf(id, sizeof(id), "%s::%s", item.node.c_str(), item.function.c_str());
457  } else if (display_logger_ && !display_function_) {
458  snprintf(id, sizeof(id), "%s", item.node.c_str());
459  } else if (!display_logger_ && display_function_) {
460  snprintf(id, sizeof(id), "::%s", item.function.c_str());
461  }
462 
463  bool display_id = display_logger_ || display_function_;
464 
465  char header[1024];
466  if (display_time_ && display_id) {
467  snprintf(header, sizeof(header), "%c %s [%s] ", level, stamp, id);
468  } else if (display_time_) {
469  snprintf(header, sizeof(header), "%c %s [] ", level, stamp);
470  } else if (display_id) {
471  snprintf(header, sizeof(header), "%c [%s] ", level, id);
472  } else {
473  snprintf(header, sizeof(header), "%c [] ", level);
474  }
475 
476  // For multiline messages, we only want to display the header for
477  // the first line. For the subsequent lines, we generate a header
478  // and then fill it with blank lines so that the messages are
479  // aligned properly (assuming monospaced font).
480  if (line_idx.line_index != 0) {
481  size_t len = strnlen(header, sizeof(header));
482  for (size_t i = 0; i < len; i++) {
483  header[i] = ' ';
484  }
485  }
486 
487  return QVariant(QString(header) + item.text[line_idx.line_index]);
488  }
489  else if (role == Qt::ForegroundRole && colorize_logs_) {
490  switch (item.level) {
491  case rosgraph_msgs::Log::DEBUG:
492  return QVariant(debug_color_);
493  case rosgraph_msgs::Log::INFO:
494  return QVariant(info_color_);
495  case rosgraph_msgs::Log::WARN:
496  return QVariant(warn_color_);
497  case rosgraph_msgs::Log::ERROR:
498  return QVariant(error_color_);
499  case rosgraph_msgs::Log::FATAL:
500  return QVariant(fatal_color_);
501  default:
502  return QVariant(info_color_);
503  }
504  }
505  else if (role == Qt::ToolTipRole) {
506  char buffer[4096];
507  snprintf(buffer, sizeof(buffer),
508  "<p style='white-space:pre'>"
509  "Timestamp: %d.%09d\n"
510  "Seq: %d\n"
511  "Node: %s\n"
512  "Function: %s\n"
513  "File: %s\n"
514  "Line: %d\n"
515  "\n",
516  item.stamp.sec,
517  item.stamp.nsec,
518  item.seq,
519  item.node.c_str(),
520  item.function.c_str(),
521  item.file.c_str(),
522  item.line);
523 
524  QString text = (QString(buffer) +
525  item.text.join("\n") +
526  QString("</p>"));
527 
528  return QVariant(text);
529  } else if (role == LogDatabaseProxyModel::ExtendedLogRole) {
530  char buffer[4096];
531  snprintf(buffer, sizeof(buffer),
532  "Timestamp: %d.%09d\n"
533  "Node: %s\n"
534  "Function: %s\n"
535  "File: %s\n"
536  "Line: %d\n"
537  "Message: ",
538  item.stamp.sec,
539  item.stamp.nsec,
540  item.node.c_str(),
541  item.function.c_str(),
542  item.file.c_str(),
543  item.line);
544 
545  QString text = (QString(buffer) +
546  item.text.join("\n"));
547 
548  return QVariant(text);
549  }
550 
551  return QVariant();
552 }
553 
555 {
556  beginResetModel();
557  msg_mapping_.clear();
558  early_mapping_.clear();
559  earliest_log_index_ = db_->log().size();
561  endResetModel();
563 }
564 
565 
566 void LogDatabaseProxyModel::saveToFile(const QString& filename) const
567 {
568  if (filename.endsWith(".bag", Qt::CaseInsensitive)) {
569  saveBagFile(filename);
570  }
571  else {
572  saveTextFile(filename);
573  }
574 }
575 
576 void LogDatabaseProxyModel::saveBagFile(const QString& filename) const
577 {
578  rosbag::Bag bag(filename.toStdString().c_str(), rosbag::bagmode::Write);
579 
580  size_t idx = 0;
581  while (idx < msg_mapping_.size()) {
582  const LineMap line_map = msg_mapping_[idx];
583  const LogEntry &item = db_->log()[line_map.log_index];
584 
585  rosgraph_msgs::Log log;
586  log.file = item.file;
587  log.function = item.function;
588  log.header.seq = item.seq;
589  if (item.stamp < ros::TIME_MIN) {
590  // Note: I think TIME_MIN is the minimum representation of
591  // ros::Time, so this branch should be impossible. Nonetheless,
592  // it doesn't hurt.
593  log.header.stamp = ros::Time::now();
594  qWarning("Msg with seq %d had time (%d); it's less than ros::TIME_MIN, which is invalid. "
595  "Writing 'now' instead.",
596  log.header.seq, item.stamp.sec);
597  } else {
598  log.header.stamp = item.stamp;
599  }
600  log.level = item.level;
601  log.line = item.line;
602  log.msg = item.text.join("\n").toStdString();
603  log.name = item.node;
604  bag.write("/rosout", log.header.stamp, log);
605 
606  // Advance to the next line with a different log index.
607  idx++;
608  while (idx < msg_mapping_.size() && msg_mapping_[idx].log_index == line_map.log_index) {
609  idx++;
610  }
611  }
612  bag.close();
613 }
614 
615 void LogDatabaseProxyModel::saveTextFile(const QString& filename) const
616 {
617  QFile outFile(filename);
618  outFile.open(QFile::WriteOnly);
619  QTextStream outstream(&outFile);
620  for(size_t i = 0; i < msg_mapping_.size(); i++)
621  {
622  QString line = data(index(i), Qt::DisplayRole).toString();
623  outstream << line << '\n';
624  }
625  outstream.flush();
626  outFile.close();
627 }
628 
630 {
631  reset();
632  clearSearchFailure(); // reset failed search variables, VCM 26 April 2017
633 }
634 
636 {
637  std::deque<LineMap> new_items;
638 
639  // Process all messages from latest_log_index_ to the end of the
640  // log.
641  for (;
642  latest_log_index_ < db_->log().size();
644  {
645  const LogEntry &item = db_->log()[latest_log_index_];
646  if (!acceptLogEntry(item)) {
647  continue;
648  }
649 
650  for (int i = 0; i < item.text.size(); i++) {
651  new_items.push_back(LineMap(latest_log_index_, i));
652  }
653  }
654 
655  if (!new_items.empty()) {
656  beginInsertRows(QModelIndex(),
657  msg_mapping_.size(),
658  msg_mapping_.size() + new_items.size() - 1);
659  msg_mapping_.insert(msg_mapping_.end(),
660  new_items.begin(),
661  new_items.end());
662  endInsertRows();
663 
664  Q_EMIT messagesAdded();
665  }
666 }
667 
669 {
670  // We process old messages in two steps. First, we process the
671  // remaining messages in chunks and store them in the early_mapping_
672  // buffer if they pass all the filters. When the early mapping
673  // buffer is large enough (or we have processed everything), then we
674  // merge the early_mapping buffer in the main buffer. This approach
675  // allows us to process very large logs without causing major lag
676  // for the user.
677 
678  for (size_t i = 0;
679  earliest_log_index_ != 0 && i < 100;
680  earliest_log_index_--, i++)
681  {
682  const LogEntry &item = db_->log()[earliest_log_index_-1];
683  if (!acceptLogEntry(item)) {
684  continue;
685  }
686 
687  for (int i = 0; i < item.text.size(); i++) {
688  // Note that we have to add the lines backwards to maintain the proper order.
689  early_mapping_.push_front(
690  LineMap(earliest_log_index_-1, item.text.size()-1-i));
691  }
692  }
693 
694  if ((earliest_log_index_ == 0 && early_mapping_.size()) ||
695  (early_mapping_.size() > 200)) {
696  beginInsertRows(QModelIndex(),
697  0,
698  early_mapping_.size() - 1);
699  msg_mapping_.insert(msg_mapping_.begin(),
700  early_mapping_.begin(),
701  early_mapping_.end());
702  early_mapping_.clear();
703  endInsertRows();
704 
705  Q_EMIT messagesAdded();
706  }
707 
709 }
710 
712 {
713  // If we have older logs that still need to be processed, schedule a
714  // callback at the next idle time.
715  if (earliest_log_index_ > 0) {
716  QTimer::singleShot(0, this, SLOT(processOldMessages()));
717  }
718 }
719 
721 {
722  if (!(item.level & severity_mask_)) {
723  return false;
724  }
725 
726  if (names_.count(item.node) == 0) {
727  return false;
728  }
729 
730  if (!testIncludeFilter(item)) {
731  return false;
732  }
733 
735  // For multi-line messages, we join the lines together with a
736  // space to make it easy for users to use filters that spread
737  // across the new lines.
738 
739  // Don't let an empty regexp filter out everything
740  return exclude_regexp_.isEmpty() || exclude_regexp_.indexIn(item.text.join(" ")) < 0;
741  } else {
742  for (int i = 0; i < exclude_strings_.size(); i++) {
743  if (item.text.join(" ").contains(exclude_strings_[i], Qt::CaseInsensitive)) {
744  return false;
745  }
746  }
747  }
748 
749  return true;
750 }
751 
752 // Return true if the item message contains at least one of the
753 // strings in include_filter_. Always returns true if there are no
754 // include strings.
756 {
758  return include_regexp_.indexIn(item.text.join(" ")) >= 0;
759  } else {
760  if (include_strings_.empty()) {
761  return true;
762  }
763 
764  for (int i = 0; i < include_strings_.size(); i++) {
765  if (item.text.join(" ").contains(include_strings_[i], Qt::CaseInsensitive)) {
766  return true;
767  }
768  }
769  }
770 
771  return false;
772 }
773 
775 {
776  if (display_time_ &&
778  && msg_mapping_.size()) {
779  Q_EMIT dataChanged(index(0), index(msg_mapping_.size()));
780  }
781 }
782 } // namespace swri_console
swri_console::SettingsKeys::DISPLAY_TIMESTAMPS
static const QString DISPLAY_TIMESTAMPS
Definition: settings_keys.h:47
swri_console::LogDatabaseProxyModel::setExcludeFilters
void setExcludeFilters(const QStringList &list)
Definition: log_database_proxy_model.cpp:212
swri_console::LogDatabaseProxyModel::include_regexp_
QRegExp include_regexp_
Definition: log_database_proxy_model.h:136
swri_console::SettingsKeys::INFO_COLOR
static const QString INFO_COLOR
Definition: settings_keys.h:63
swri_console::SettingsKeys::DISPLAY_FUNCTION
static const QString DISPLAY_FUNCTION
Definition: settings_keys.h:51
swri_console::LogDatabaseProxyModel::saveToFile
void saveToFile(const QString &filename) const
Definition: log_database_proxy_model.cpp:566
swri_console::LogDatabaseProxyModel::reset
void reset()
Definition: log_database_proxy_model.cpp:554
swri_console::LogDatabaseProxyModel::failedSearchIndex_
int failedSearchIndex_
Definition: log_database_proxy_model.h:149
rosbag::Bag
swri_console::SettingsKeys::FATAL_COLOR
static const QString FATAL_COLOR
Definition: settings_keys.h:66
swri_console::LogDatabaseProxyModel::use_regular_expressions_
bool use_regular_expressions_
Definition: log_database_proxy_model.h:116
swri_console::LogDatabaseProxyModel::rowCount
virtual int rowCount(const QModelIndex &parent) const
Definition: log_database_proxy_model.cpp:278
swri_console::LogDatabaseProxyModel::human_readable_time_
bool human_readable_time_
Definition: log_database_proxy_model.h:113
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::include_strings_
QStringList include_strings_
Definition: log_database_proxy_model.h:138
swri_console::LogDatabaseProxyModel::setIncludeFilters
void setIncludeFilters(const QStringList &list)
Definition: log_database_proxy_model.cpp:203
swri_console::LogDatabaseProxyModel::fatal_color_
QColor fatal_color_
Definition: log_database_proxy_model.h:145
swri_console::SettingsKeys::WARN_COLOR
static const QString WARN_COLOR
Definition: settings_keys.h:64
swri_console::LogDatabaseProxyModel::LineMap::log_index
size_t log_index
Definition: log_database_proxy_model.h:123
swri_console::LogDatabaseProxyModel::display_logger_
bool display_logger_
Definition: log_database_proxy_model.h:114
swri_console::LogDatabaseProxyModel::saveTextFile
void saveTextFile(const QString &filename) const
Definition: log_database_proxy_model.cpp:615
swri_console::LogEntry::seq
uint32_t seq
Definition: log_database.h:52
time.h
swri_console::LogDatabaseProxyModel::setExcludeRegexpPattern
void setExcludeRegexpPattern(const QString &pattern)
Definition: log_database_proxy_model.cpp:230
swri_console::LogDatabaseProxyModel::isIncludeValid
bool isIncludeValid() const
Definition: log_database_proxy_model.cpp:288
DurationBase< Duration >::nsec
int32_t nsec
swri_console::LogEntry::node
std::string node
Definition: log_database.h:47
swri_console::LogDatabaseProxyModel::setFatalColor
void setFatalColor(const QColor &fatal_color)
Definition: log_database_proxy_model.cpp:270
rosbag::Bag::close
void close()
bag.h
swri_console::LogDatabaseProxyModel::setDebugColor
void setDebugColor(const QColor &debug_color)
Definition: log_database_proxy_model.cpp:238
swri_console::LogDatabaseProxyModel::display_absolute_time_
bool display_absolute_time_
Definition: log_database_proxy_model.h:112
swri_console::LogDatabaseProxyModel::LogDatabaseProxyModel
LogDatabaseProxyModel(LogDatabase *db)
Definition: log_database_proxy_model.cpp:54
swri_console::LogDatabaseProxyModel::messagesAdded
void messagesAdded()
swri_console::LogDatabaseProxyModel::setWarnColor
void setWarnColor(const QColor &warn_color)
Definition: log_database_proxy_model.cpp:254
swri_console::LogDatabaseProxyModel::exclude_strings_
QStringList exclude_strings_
Definition: log_database_proxy_model.h:139
swri_console::LogDatabaseProxyModel::testIncludeFilter
bool testIncludeFilter(const LogEntry &item)
Definition: log_database_proxy_model.cpp:755
swri_console::LogDatabaseProxyModel::saveBagFile
void saveBagFile(const QString &filename) const
Definition: log_database_proxy_model.cpp:576
swri_console::LogEntry::file
std::string file
Definition: log_database.h:48
swri_console::LogEntry
Definition: log_database.h:43
swri_console::LogDatabaseProxyModel::ExtendedLogRole
@ ExtendedLogRole
Definition: log_database_proxy_model.h:55
swri_console::LogDatabaseProxyModel::warn_color_
QColor warn_color_
Definition: log_database_proxy_model.h:143
swri_console::LogDatabaseProxyModel::names_
std::set< std::string > names_
Definition: log_database_proxy_model.h:108
swri_console::LogDatabaseProxyModel::display_time_
bool display_time_
Definition: log_database_proxy_model.h:111
swri_console::LogDatabaseProxyModel::setAbsoluteTime
void setAbsoluteTime(bool absolute)
Definition: log_database_proxy_model.cpp:97
swri_console::LogDatabaseProxyModel::handleDatabaseCleared
void handleDatabaseCleared()
Definition: log_database_proxy_model.cpp:629
swri_console::LogDatabaseProxyModel::severity_mask_
uint8_t severity_mask_
Definition: log_database_proxy_model.h:109
swri_console::LogDatabaseProxyModel::~LogDatabaseProxyModel
~LogDatabaseProxyModel()
Definition: log_database_proxy_model.cpp:81
swri_console::LogDatabaseProxyModel::setColorizeLogs
void setColorizeLogs(bool colorize_logs)
Definition: log_database_proxy_model.cpp:128
swri_console::LogDatabaseProxyModel::setIncludeRegexpPattern
void setIncludeRegexpPattern(const QString &pattern)
Definition: log_database_proxy_model.cpp:222
swri_console::SettingsKeys::DISPLAY_LOGGER
static const QString DISPLAY_LOGGER
Definition: settings_keys.h:50
swri_console::LogDatabaseProxyModel::minTimeUpdated
void minTimeUpdated()
Definition: log_database_proxy_model.cpp:774
swri_console::LogDatabaseProxyModel::error_color_
QColor error_color_
Definition: log_database_proxy_model.h:144
swri_console::LogDatabaseProxyModel::clearSearchFailure
void clearSearchFailure()
Definition: log_database_proxy_model.cpp:377
ros::TIME_MIN
const Time TIME_MIN(0, 1)
swri_console::LogDatabaseProxyModel::display_function_
bool display_function_
Definition: log_database_proxy_model.h:115
swri_console::LogDatabaseProxyModel::setDisplayFunction
void setDisplayFunction(bool function_name)
Definition: log_database_proxy_model.cpp:175
swri_console::SettingsKeys::DEBUG_COLOR
static const QString DEBUG_COLOR
Definition: settings_keys.h:62
swri_console::LogDatabaseProxyModel::setUseRegularExpressions
void setUseRegularExpressions(bool useRegexps)
Definition: log_database_proxy_model.cpp:191
swri_console::LogDatabase
Definition: log_database.h:55
swri_console::LogEntry::line
uint32_t line
Definition: log_database.h:50
log_database.h
swri_console::SettingsKeys::EXCLUDE_FILTER
static const QString EXCLUDE_FILTER
Definition: settings_keys.h:54
rosbag::bagmode::Write
Write
swri_console::LogDatabaseProxyModel::failedSearchText_
QString failedSearchText_
Definition: log_database_proxy_model.h:148
swri_console::LogDatabaseProxyModel::setSeverityFilter
void setSeverityFilter(uint8_t severity_mask)
Definition: log_database_proxy_model.cpp:91
swri_console::LogDatabaseProxyModel::isExcludeValid
bool isExcludeValid() const
Definition: log_database_proxy_model.cpp:296
swri_console::LogDatabaseProxyModel::acceptLogEntry
bool acceptLogEntry(const LogEntry &item)
Definition: log_database_proxy_model.cpp:720
swri_console::LogDatabaseProxyModel::earliest_log_index_
size_t earliest_log_index_
Definition: log_database_proxy_model.h:133
swri_console::SettingsKeys::COLORIZE_LOGS
static const QString COLORIZE_LOGS
Definition: settings_keys.h:67
TimeBase< Time, Duration >::sec
uint32_t sec
TimeBase< Time, Duration >::nsec
uint32_t nsec
swri_console::SettingsKeys::ABSOLUTE_TIMESTAMPS
static const QString ABSOLUTE_TIMESTAMPS
Definition: settings_keys.h:48
swri_console::LogEntry::stamp
ros::Time stamp
Definition: log_database.h:45
swri_console::LogDatabaseProxyModel::colorize_logs_
bool colorize_logs_
Definition: log_database_proxy_model.h:110
rosbag::Bag::write
void write(std::string const &topic, ros::MessageEvent< T > const &event)
swri_console
Definition: bag_reader.h:40
swri_console::LogDatabaseProxyModel::setDisplayTime
void setDisplayTime(bool display)
Definition: log_database_proxy_model.cpp:143
swri_console::LogDatabaseProxyModel::early_mapping_
std::deque< LineMap > early_mapping_
Definition: log_database_proxy_model.h:134
swri_console::SettingsKeys::HUMAN_READABLE_TIME
static const QString HUMAN_READABLE_TIME
Definition: settings_keys.h:49
log_database_proxy_model.h
swri_console::LogDatabaseProxyModel::processOldMessages
void processOldMessages()
Definition: log_database_proxy_model.cpp:668
swri_console::LogEntry::function
std::string function
Definition: log_database.h:49
swri_console::LogDatabaseProxyModel::LineMap::line_index
int line_index
Definition: log_database_proxy_model.h:124
swri_console::LogEntry::text
QStringList text
Definition: log_database.h:51
swri_console::LogDatabaseProxyModel::setErrorColor
void setErrorColor(const QColor &error_color)
Definition: log_database_proxy_model.cpp:262
swri_console::LogDatabaseProxyModel::processNewMessages
void processNewMessages()
Definition: log_database_proxy_model.cpp:635
swri_console::LogDatabaseProxyModel::latest_log_index_
size_t latest_log_index_
Definition: log_database_proxy_model.h:130
swri_console::SettingsKeys::ERROR_COLOR
static const QString ERROR_COLOR
Definition: settings_keys.h:65
settings_keys.h
swri_console::LogDatabaseProxyModel::setDisplayLogger
void setDisplayLogger(bool logger_name)
Definition: log_database_proxy_model.cpp:159
swri_console::LogDatabaseProxyModel::scheduleIdleProcessing
void scheduleIdleProcessing()
Definition: log_database_proxy_model.cpp:711
swri_console::LogDatabaseProxyModel::info_color_
QColor info_color_
Definition: log_database_proxy_model.h:142
swri_console::LogDatabase::minTime
const ros::Time & minTime() const
Definition: log_database.h:65
swri_console::SettingsKeys::INCLUDE_FILTER
static const QString INCLUDE_FILTER
Definition: settings_keys.h:53
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::LogDatabaseProxyModel::db_
LogDatabase * db_
Definition: log_database_proxy_model.h:146
header
const std::string header
swri_console::LogDatabaseProxyModel::msg_mapping_
std::deque< LineMap > msg_mapping_
Definition: log_database_proxy_model.h:131
swri_console::LogDatabaseProxyModel::exclude_regexp_
QRegExp exclude_regexp_
Definition: log_database_proxy_model.h:137
swri_console::LogDatabaseProxyModel::debug_color_
QColor debug_color_
Definition: log_database_proxy_model.h:141
swri_console::LogDatabaseProxyModel::setHumanReadableTime
void setHumanReadableTime(bool human_readable_time)
Definition: log_database_proxy_model.cpp:112
ros::Duration
DurationBase< Duration >::sec
int32_t sec
swri_console::LogDatabase::log
const std::deque< LogEntry > & log()
Definition: log_database.h:64
swri_console::LogDatabaseProxyModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Definition: log_database_proxy_model.cpp:384
ros::Time::now
static Time now()
swri_console::LogEntry::level
uint8_t level
Definition: log_database.h:46
swri_console::LogDatabaseProxyModel::LineMap
Definition: log_database_proxy_model.h:122


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