| 354 |
Kevin |
1 |
#ifndef SERIALWIDGET_H
|
|
|
2 |
#define SERIALWIDGET_H
|
|
|
3 |
|
|
|
4 |
#include "GlobalDefines.h"
|
|
|
5 |
#include "SerialHelper.h"
|
|
|
6 |
|
|
|
7 |
class SerialWidget : public QWidget
|
|
|
8 |
{
|
|
|
9 |
Q_OBJECT
|
|
|
10 |
public:
|
|
|
11 |
SerialWidget(QWidget *parent = 0);
|
|
|
12 |
~SerialWidget();
|
|
|
13 |
|
|
|
14 |
public slots:
|
|
|
15 |
// Inbound from SerialHelper
|
|
|
16 |
void Serial_UpdateParameters(QStringList ports, QStringList speeds, QStringList dataBits,
|
|
|
17 |
QStringList stopBits, QStringList parity, QStringList flowControl);
|
|
|
18 |
|
|
|
19 |
// Local GUI processing
|
|
|
20 |
void Serial_ConnectToggleBtn(void);
|
|
|
21 |
void Serial_LocalConnected(void);
|
|
|
22 |
void Serial_LocalDisconnected(void);
|
|
|
23 |
|
|
|
24 |
signals:
|
|
|
25 |
// Outbound to SerialHelper
|
|
|
26 |
void Serial_QueryParameters(void);
|
|
|
27 |
void Serial_Connect(QString port, QString speed, QString dataBits,
|
|
|
28 |
QString stopBits, QString parity, QString flowControl);
|
|
|
29 |
void Serial_Disconnect(void);
|
|
|
30 |
void Serial_TransmitByteArray(QByteArray data);
|
|
|
31 |
|
|
|
32 |
// Outbound to MainWindow
|
|
|
33 |
void Serial_ReceivedByte(char byte);
|
|
|
34 |
void Serial_Connected(void);
|
|
|
35 |
void Serial_Disconnected(void);
|
|
|
36 |
void UpdateStatus(QString string);
|
|
|
37 |
|
|
|
38 |
private:
|
|
|
39 |
SerialHelper *serialHelper;
|
|
|
40 |
QThread *serialThread;
|
|
|
41 |
|
|
|
42 |
QPushButton *btnSerialConnect;
|
|
|
43 |
QPushButton *btnSerialRefresh;
|
|
|
44 |
QLabel *labelSerialPort;
|
|
|
45 |
QLabel *labelSerialSpeed;
|
|
|
46 |
QLabel *labelSerialDataBits;
|
|
|
47 |
QLabel *labelSerialStopBits;
|
|
|
48 |
QLabel *labelSerialParity;
|
|
|
49 |
QLabel *labelSerialFlowControl;
|
|
|
50 |
QComboBox *cboxSerialPort;
|
|
|
51 |
QComboBox *cboxSerialSpeed;
|
|
|
52 |
QComboBox *cboxSerialDataBits;
|
|
|
53 |
QComboBox *cboxSerialStopBits;
|
|
|
54 |
QComboBox *cboxSerialParity;
|
|
|
55 |
QComboBox *cboxSerialFlowControl;
|
|
|
56 |
};
|
|
|
57 |
|
|
|
58 |
#endif // SERIALWIDGET_H
|