@@ -1,50 +1,56 | |||||
1 | #ifndef PERIPHERALWIDGET_H |
|
1 | #ifndef PERIPHERALWIDGET_H | |
2 | #define PERIPHERALWIDGET_H |
|
2 | #define PERIPHERALWIDGET_H | |
3 |
|
3 | |||
4 | #include <QWidget> |
|
4 | #include <QWidget> | |
5 | #include <QGroupBox> |
|
5 | #include <QGroupBox> | |
6 | #include <QVBoxLayout> |
|
6 | #include <QVBoxLayout> | |
7 | #include <QList> |
|
7 | #include <QList> | |
8 | #include <QTimer> |
|
8 | #include <QTimer> | |
9 | #include "registerwidget.h" |
|
9 | #include "registerwidget.h" | |
|
10 | #if defined(LPPMON_SDK_BUILD) | |||
|
11 | # define LPPMON_SDK_EXPORT Q_DECL_EXPORT | |||
|
12 | #else | |||
|
13 | # define LPPMON_SDK_EXPORT Q_DECL_IMPORT | |||
|
14 | #endif | |||
|
15 | ||||
10 | /* |
|
16 | /* | |
11 | * TODO ADD an outdated marker |
|
17 | * TODO ADD an outdated marker | |
12 | * Show outdated registers with a different color for example |
|
18 | * Show outdated registers with a different color for example | |
13 | */ |
|
19 | */ | |
14 | class peripheralWidget : public QWidget |
|
20 | class LPPMON_SDK_EXPORT peripheralWidget : public QWidget | |
15 | { |
|
21 | { | |
16 | Q_OBJECT |
|
22 | Q_OBJECT | |
17 | public: |
|
23 | public: | |
18 | explicit peripheralWidget(const QString& name,qint32 baseAddress, QWidget *parent = 0); |
|
24 | explicit peripheralWidget(const QString& name,qint32 baseAddress, QWidget *parent = 0); | |
19 | registerWidget* registerAt(int index) |
|
25 | registerWidget* registerAt(int index) | |
20 | { |
|
26 | { | |
21 | if(index>=0 && index<registersWdgts.count()) |
|
27 | if(index>=0 && index<registersWdgts.count()) | |
22 | return registersWdgts.at(index); |
|
28 | return registersWdgts.at(index); | |
23 | return NULL; |
|
29 | return NULL; | |
24 | } |
|
30 | } | |
25 | signals: |
|
31 | signals: | |
26 | void writeRegSig(qint32 address,qint32 value); |
|
32 | void writeRegSig(qint32 address,qint32 value); | |
27 | qint32 readRegSig(qint32 address); |
|
33 | qint32 readRegSig(qint32 address); | |
28 | public slots: |
|
34 | public slots: | |
29 | void blinkCursor(); |
|
35 | void blinkCursor(); | |
30 | void addRegister(const QString& name,qint32 address); |
|
36 | void addRegister(const QString& name,qint32 address); | |
31 | protected: |
|
37 | protected: | |
32 | void mousePressEvent(QMouseEvent *event); |
|
38 | void mousePressEvent(QMouseEvent *event); | |
33 | void mouseMoveEvent(QMouseEvent *event); |
|
39 | void mouseMoveEvent(QMouseEvent *event); | |
34 | void mouseReleaseEvent(QMouseEvent *event); |
|
40 | void mouseReleaseEvent(QMouseEvent *event); | |
35 | void keyPressEvent(QKeyEvent * event); |
|
41 | void keyPressEvent(QKeyEvent * event); | |
36 | void paintEvent(QPaintEvent* event); |
|
42 | void paintEvent(QPaintEvent* event); | |
37 |
|
43 | |||
38 | private: |
|
44 | private: | |
39 | void up(); |
|
45 | void up(); | |
40 | void down(); |
|
46 | void down(); | |
41 | QString p_name; |
|
47 | QString p_name; | |
42 | QString p_header; |
|
48 | QString p_header; | |
43 | qint32 p_baseAddress; |
|
49 | qint32 p_baseAddress; | |
44 | QList<registerWidget*> registersWdgts; |
|
50 | QList<registerWidget*> registersWdgts; | |
45 | int selectedReg; |
|
51 | int selectedReg; | |
46 | QTimer* p_timer; |
|
52 | QTimer* p_timer; | |
47 |
|
53 | |||
48 | }; |
|
54 | }; | |
49 |
|
55 | |||
50 | #endif // PERIPHERALWIDGET_H |
|
56 | #endif // PERIPHERALWIDGET_H |
@@ -1,30 +1,34 | |||||
1 | #ifndef SOCREGSVIEWER_H |
|
1 | #ifndef SOCREGSVIEWER_H | |
2 | #define SOCREGSVIEWER_H |
|
2 | #define SOCREGSVIEWER_H | |
3 |
|
3 | |||
4 | #include <QWidget> |
|
4 | #include <QWidget> | |
5 | #include <QtWidgets> |
|
5 | #include <QtWidgets> | |
6 | #include "peripheralwidget.h" |
|
6 | #include "peripheralwidget.h" | |
7 |
|
7 | |||
8 |
|
8 | #if defined(LPPMON_SDK_BUILD) | ||
|
9 | # define LPPMON_SDK_EXPORT Q_DECL_EXPORT | |||
|
10 | #else | |||
|
11 | # define LPPMON_SDK_EXPORT Q_DECL_IMPORT | |||
|
12 | #endif | |||
9 |
|
13 | |||
10 | class socRegsViewer : public QScrollArea |
|
14 | class LPPMON_SDK_EXPORT socRegsViewer : public QScrollArea | |
11 | { |
|
15 | { | |
12 | Q_OBJECT |
|
16 | Q_OBJECT | |
13 | public: |
|
17 | public: | |
14 | explicit socRegsViewer(const QString& name,QWidget *parent = 0); |
|
18 | explicit socRegsViewer(const QString& name,QWidget *parent = 0); | |
15 | peripheralWidget* peripheral(int index); |
|
19 | peripheralWidget* peripheral(int index); | |
16 |
|
20 | |||
17 | signals: |
|
21 | signals: | |
18 |
|
22 | |||
19 | public slots: |
|
23 | public slots: | |
20 | void addPeripheral(peripheralWidget* peripheral); |
|
24 | void addPeripheral(peripheralWidget* peripheral); | |
21 |
|
25 | |||
22 | private: |
|
26 | private: | |
23 | QWidget* p_scrollAreaWdgt; |
|
27 | QWidget* p_scrollAreaWdgt; | |
24 | QString p_name; |
|
28 | QString p_name; | |
25 | QGridLayout* p_layout,*p_scrollAreaWdgtLayout; |
|
29 | QGridLayout* p_layout,*p_scrollAreaWdgtLayout; | |
26 | QLabel* p_nameLabel; |
|
30 | QLabel* p_nameLabel; | |
27 | QList<peripheralWidget*> p_peripherals; |
|
31 | QList<peripheralWidget*> p_peripherals; | |
28 | }; |
|
32 | }; | |
29 |
|
33 | |||
30 | #endif // SOCREGSVIEWER_H |
|
34 | #endif // SOCREGSVIEWER_H |
General Comments 0
You need to be logged in to leave comments.
Login now