console_window.h
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 #ifndef SWRI_CONSOLE_CONSOLE_WINDOW_H_
32 #define SWRI_CONSOLE_CONSOLE_WINDOW_H_
33 
34 #include <QtWidgets/QMainWindow>
35 #include <QColor>
36 #include <QPushButton>
37 #include <QSettings>
38 #include "ui_console_window.h"
39 
40 #include "node_click_handler.h"
41 
42 namespace swri_console
43 {
44 class LogDatabase;
45 class LogDatabaseProxyModel;
46 class NodeListModel;
47 class ConsoleWindow : public QMainWindow {
48  Q_OBJECT
49 
50  public:
53 
54  void closeEvent(QCloseEvent *event); // Overloaded function
55 
56  Q_SIGNALS:
57  void createNewWindow();
58  void readBagFile();
59  void readLogFile();
60  void readLogDirectory();
61  void selectFont();
62 
63  public Q_SLOTS:
64  void clearAll();
65  void clearMessages();
66  void saveLogs();
67  void connected(bool);
68  void setSeverityFilter();
69  void nodeSelectionChanged();
70  void messagesAdded();
71  void showLogContextMenu(const QPoint& point);
72  void selectAllLogs();
73  void copyLogs();
74  void copyExtendedLogs();
75  void setFollowNewest(bool);
76  void toggleAlternateRowColors(bool);
77 
78  void userScrolled(int);
79 
80  void includeFilterUpdated(const QString &);
81  void excludeFilterUpdated(const QString &);
82  void searchIndex(); // VM 4/13/2017
83  void updateIncludeLabel();
84  void updateExcludeLabel();
85 
86  void setFont(const QFont &font);
87 
88  void setDebugColor();
89  void setInfoColor();
90  void setWarnColor();
91  void setErrorColor();
92  void setFatalColor();
93  void prevIndex();
94  void nextIndex();
95 
96 private:
97  enum function{NEXT,PREV,SEARCH};
98  function searchFunction_;
99  void updateCurrentIndex(function sF);
100  void chooseButtonColor(QPushButton* widget);
101  QColor getButtonColor(const QPushButton* button) const;
102  void updateButtonColor(QPushButton* widget, const QColor& color);
103 
104  template <typename T>
105  void loadBooleanSetting(const QString& key, T* element){
106  QSettings settings;
107  bool val = settings.value(key, element->isChecked()).toBool();
108  if (val != element->isChecked()) {
109  element->setChecked(val);
110  }
111  };
112  void loadColorButtonSetting(const QString& key, QPushButton* button);
113  void loadSettings();
114 
115 
116  Ui::ConsoleWindow ui;
121 }; // class ConsoleWindow
122 } // namespace swri_console
123 
124 #endif // SWRI_CONSOLE_CONSOLE_WINDOW_H_
swri_console::ConsoleWindow::updateIncludeLabel
void updateIncludeLabel()
Definition: console_window.cpp:490
swri_console::ConsoleWindow::messagesAdded
void messagesAdded()
Definition: console_window.cpp:309
swri_console::ConsoleWindow::setDebugColor
void setDebugColor()
Definition: console_window.cpp:514
node_click_handler.h
swri_console::ConsoleWindow::prevIndex
void prevIndex()
Definition: console_window.cpp:431
swri_console::ConsoleWindow::db_proxy_
LogDatabaseProxyModel * db_proxy_
Definition: console_window.h:118
swri_console::ConsoleWindow::~ConsoleWindow
~ConsoleWindow()
Definition: console_window.cpp:210
swri_console::ConsoleWindow::nodeSelectionChanged
void nodeSelectionChanged()
Definition: console_window.cpp:256
swri_console::ConsoleWindow::ConsoleWindow
ConsoleWindow(LogDatabase *db)
Definition: console_window.cpp:60
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::ConsoleWindow::updateExcludeLabel
void updateExcludeLabel()
Definition: console_window.cpp:499
swri_console::ConsoleWindow::PREV
@ PREV
Definition: console_window.h:97
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::ConsoleWindow::NEXT
@ NEXT
Definition: console_window.h:97
swri_console::ConsoleWindow::clearMessages
void clearMessages()
Definition: console_window.cpp:222
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::NodeListModel
Definition: node_list_model.h:42
swri_console::ConsoleWindow::searchFunction_
function searchFunction_
Definition: console_window.h:98
swri_console::ConsoleWindow::setFont
void setFont(const QFont &font)
Definition: console_window.cpp:508
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
swri_console::ConsoleWindow::setFollowNewest
void setFollowNewest(bool)
Definition: console_window.cpp:383
swri_console::ConsoleWindow::setErrorColor
void setErrorColor()
Definition: console_window.cpp:529
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::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::LogDatabaseProxyModel
Definition: log_database_proxy_model.h:49
swri_console::ConsoleWindow::setInfoColor
void setInfoColor()
Definition: console_window.cpp:519
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::ConsoleWindow::copyExtendedLogs
void copyExtendedLogs()
Definition: console_window.cpp:373
swri_console::ConsoleWindow::setWarnColor
void setWarnColor()
Definition: console_window.cpp:524
swri_console::ConsoleWindow::updateButtonColor
void updateButtonColor(QPushButton *widget, const QColor &color)
Definition: console_window.cpp:559
swri_console::ConsoleWindow::searchIndex
void searchIndex()
Definition: console_window.cpp:426
swri_console::ConsoleWindow::createNewWindow
void createNewWindow()
swri_console::ConsoleWindow::excludeFilterUpdated
void excludeFilterUpdated(const QString &)
Definition: console_window.cpp:407
swri_console::ConsoleWindow
Definition: console_window.h:47
swri_console::ConsoleWindow::SEARCH
@ SEARCH
Definition: console_window.h:97
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::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