forked from robotology/yarp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogtab.h
84 lines (74 loc) · 2.87 KB
/
logtab.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
* Copyright (C)2014 iCub Facility - Istituto Italiano di Tecnologia
* Author: Marco Randazzo
* email: [email protected]
* website: www.robotcub.org
* Permission is granted to copy, distribute, and/or modify this program
* under the terms of the GNU General Public License, version 2 or any
* later version published by the Free Software Foundation.
*
* A copy of the license can be found at
* http://www.robotcub.org/icub/license/gpl.txt
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details
*/
#ifndef LOGTAB_H
#define LOGTAB_H
#include <QMutex>
#include <QFrame>
#include <QStandardItemModel>
#include <QTimer>
#include <QSortFilterProxyModel>
#include <QClipboard>
#include <yarp/logger/YarpLogger.h>
#include "messageWidget.h"
#include "logtabSorting.h"
const std::string TRACE_STRING = "TRACE";
const std::string DEBUG_STRING = "DEBUG";
const std::string INFO_STRING = "INFO";
const std::string WARNING_STRING = "WARNING";
const std::string ERROR_STRING = "ERROR";
const std::string FATAL_STRING = "FATAL";
namespace Ui {
class LogTab;
}
class LogTab : public QFrame
{
Q_OBJECT
public:
explicit LogTab(yarp::yarpLogger::LoggerEngine* _theLogger, MessageWidget* _system_message, std::string _portName, QWidget *parent = 0, int refreshRate=100);
~LogTab();
private:
Ui::LogTab *ui;
std::string portName;
yarp::yarpLogger::LoggerEngine* theLogger;
MessageWidget* system_message;
QMutex mutex;
bool displayYarprunTimestamp_enabled;
bool displayLocalTimestamp_enabled;
bool displayErrorLevel_enabled;
bool displayColors_enabled;
bool displayGrid_enabled;
bool toggleLineExpansion;
private slots:
void updateLog(bool from_beginning=false);
void ctxMenu(const QPoint &pos);
void expandLines();
void on_copy_to_clipboard_action();
public:
QTimer *logTimer;
QStandardItemModel *model_logs;
LogSortFilterProxyModel *proxyModelButtons;
LogSortFilterProxyModel *proxyModelSearch;
QClipboard *clipboard;
void displayYarprunTimestamp (bool enabled);
void displayLocalTimestamp (bool enabled);
void displayErrorLevel (bool enabled);
void displayColors (bool enabled);
void displayGrid (bool enabled);
void clear_model_logs();
};
#endif // LOGTAB_H