ConsoleWidget.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef RTABMAP_CONSOLEWIDGET_H_
29 #define RTABMAP_CONSOLEWIDGET_H_
30 
31 #include "rtabmap/gui/rtabmap_gui_export.h" // DLL export/import defines
32 
34 #include <QWidget>
35 #include <QtCore/QMutex>
36 #include <QtCore/QTimer>
37 #include <QtCore/QTime>
38 #include <QtCore/QElapsedTimer>
39 
40 class Ui_consoleWidget;
41 class QMessageBox;
42 class QTextCursor;
43 
44 namespace rtabmap {
45 
46 class RTABMAP_GUI_EXPORT ConsoleWidget : public QWidget, public UEventsHandler
47 {
48  Q_OBJECT;
49 
50 public:
51  ConsoleWidget(QWidget * parent = 0);
52  virtual ~ConsoleWidget();
53 
54 public Q_SLOTS:
55  void appendMsg(const QString & msg, int level = 1);
56 
57 Q_SIGNALS:
58  void msgReceived(const QString &, int);
59 
60 private Q_SLOTS:
61  void flushConsole();
62  void updateTextEditBufferSize();
63 
64 protected:
65  virtual bool handleEvent(UEvent * anEvent);
66 
67 private:
68  Ui_consoleWidget * _ui;
69  QMessageBox * _errorMessage;
71  QMutex _msgListMutex;
72  QTimer _timer;
73  QElapsedTimer _time;
74  QTextCursor * _textCursor;
75  QList<QPair<QString, int> > _msgList;
76 };
77 
78 }
79 
80 #endif /* CONSOLEWIDGET_H_ */
UEventsHandler
Definition: UEventsHandler.h:128
rtabmap::ConsoleWidget::_errorMessage
QMessageBox * _errorMessage
Definition: ConsoleWidget.h:69
rtabmap::ConsoleWidget::_time
QElapsedTimer _time
Definition: ConsoleWidget.h:73
rtabmap::ConsoleWidget::_ui
Ui_consoleWidget * _ui
Definition: ConsoleWidget.h:68
rtabmap::ConsoleWidget::_timer
QTimer _timer
Definition: ConsoleWidget.h:72
rtabmap::ConsoleWidget::_errorMessageMutex
QMutex _errorMessageMutex
Definition: ConsoleWidget.h:70
UEvent
Definition: UEvent.h:57
rtabmap::ConsoleWidget
Definition: ConsoleWidget.h:46
rtabmap::ConsoleWidget::_msgListMutex
QMutex _msgListMutex
Definition: ConsoleWidget.h:71
level
level
rtabmap::ConsoleWidget::_msgList
QList< QPair< QString, int > > _msgList
Definition: ConsoleWidget.h:75
UEventsHandler.h
rtabmap::ConsoleWidget::_textCursor
QTextCursor * _textCursor
Definition: ConsoleWidget.h:74
rtabmap
Definition: CameraARCore.cpp:35
msg
msg


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:08