Debian Codegraph @

tests/manual/examples/receiver/dialog.h

raw
1 // Copyright (C) 2012 Denis Shienkov <[email protected]>
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4 #ifndef DIALOG_H
5 #define DIALOG_H
6
7 #include <QDialog>
8 #include <QSerialPort>
9 #include <QTimer>
10
11 QT_BEGIN_NAMESPACE
12
13 class QLabel;
14 class QLineEdit;
15 class QComboBox;
16 class QSpinBox;
17 class QPushButton;
18
19 QT_END_NAMESPACE
20
21 class Dialog : public QDialog
22 {
23 Q_OBJECT
24
25 public:
26 explicit Dialog(QWidget *parent = nullptr);
27
28 private slots:
29 void startReceiver();
30 void readRequest();
31 void processTimeout();
32 void activateRunButton();
33
34 private:
35 void processError(const QString &s);
36
37 private:
38 int m_transactionCount = 0;
39 QLabel *m_serialPortLabel = nullptr;
40 QComboBox *m_serialPortComboBox = nullptr;
41 QLabel *m_waitRequestLabel = nullptr;
42 QSpinBox *m_waitRequestSpinBox = nullptr;
43 QLabel *m_responseLabel = nullptr;
44 QLineEdit *m_responseLineEdit = nullptr;
45 QLabel *m_trafficLabel = nullptr;
46 QLabel *m_statusLabel = nullptr;
47 QPushButton *m_runButton = nullptr;
48
49 QSerialPort m_serial;
50 QByteArray m_request;
51 QTimer m_timer;
52 };
53
54 #endif // DIALOG_H