-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtracesrc.h
More file actions
122 lines (97 loc) · 3.09 KB
/
Copy pathtracesrc.h
File metadata and controls
122 lines (97 loc) · 3.09 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
* Copyright (c) 2015 Dmitry Osipenko <digetx@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRACECPU_H
#define TRACECPU_H
#include <QAbstractTableModel>
#include <QObject>
#include <QLineEdit>
#include <QPushButton>
#include <QTextEdit>
#include <QTreeWidget>
#include <QVarLengthArray>
#include "mainwindow.h"
#include "device.h"
#include "tracedev.h"
#include "tracedevview.h"
#include "traceqtablewidget.h"
class TraceSRC;
class TraceUI : public QObject
{
Q_OBJECT
public:
TraceUI(MainWindow *window, QString name, TraceSRC *parent);
void addDevice(TraceDev *dev);
void resetUI(void);
QPushButton *m_rec_button;
private:
MainWindow *m_mainwindow;
QTableView *m_tableViewDevices;
TraceDevView *m_tableViewTrace;
QTableView *m_tableViewBitDetails;
QTreeWidget *m_treeWidgetDevices;
QTextEdit *m_textRegDesc;
QLineEdit *m_regFilter;
TraceDev *m_activeDevice;
TraceSRC *m_tracesrc;
void ActiveDeviceChanged(TraceDev *dev);
signals:
private slots:
void ActiveDeviceChanged(QTreeWidgetItem *item, QTreeWidgetItem *);
void ActiveDeviceChanged(const QModelIndex &, const QModelIndex &);
void ActiveRegChanged(const QModelIndex &);
};
class TraceSRC : public QAbstractTableModel
{
Q_OBJECT
public:
explicit TraceSRC(MainWindow *window, QString name, QObject *parent = 0);
virtual void handle(const TraceIPC::packet_rw &pak_rw);
virtual void handle(const TraceIPC::packet_irq &pak_irq);
virtual void chWrite(const u_int32_t &ch_id, const u_int32_t &time,
const u_int32_t &data, const u_int32_t &is_gather);
virtual void reset(QString log_path);
TraceDev * getDevByAddr(const u_int32_t &, const TraceDev::dev_type &);
TraceDev * getDevAt(int idx) const;
protected:
TraceUI *m_tui;
QString m_name;
QVarLengthArray<TraceDev*> m_devices;
void addDevice(TraceDev *dev);
private:
u_int32_t m_prev_addr;
TraceDev *m_prev_dev;
QMutex m_mutex;
signals:
void ErrUnkDev(const QString, const Device::log_entry);
void ErrCustom(const QString, const QString, const u_int32_t);
public slots:
// QAbstractItemModel interface
public:
int rowCount(const QModelIndex &) const
{
return m_devices.size();
}
int columnCount(const QModelIndex &) const
{
return 0;
}
QVariant data(const QModelIndex &, int) const
{
return QVariant();
}
};
#endif // TRACECPU_H