-
Notifications
You must be signed in to change notification settings - Fork 27
/
mainwindow.h
145 lines (103 loc) · 4 KB
/
mainwindow.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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// Qt for Linux Project. GitLab
/****************************************************************************/
/* */
/* @file : serialport.h */
/* @Copyright : MULTIBEANS ORG rights reserved. */
/* @Revision : Ver 1.0. */
/* @Data : 2017.09.16 Realse. */
/* @Belong : PROJECT. */
/* @Git : https://gitlab.com/coarlqq/serialPort.git */
/* **code : (UTF-8) in Linux(Ubuntu16.04). Qt 5.7.1 for Linux platform. */
/****************************************************************************/
/* @Attention: */
/* --------------------------------------------------------------------- */
/* | Data | Behavior | Offer | Content | */
/* | 2017.09.16 | create |Carlos Lopez(M) | ceate the document. | */
/* --------------------------------------------------------------------- */
/* Email: [email protected] MULTIBEANS. */
/****************************************************************************/
#ifndef SERIALPORT_H
#define SERIALPORT_H
#include <QMainWindow>
#include <QSerialPort>
#include <QTimer>
#include "global.h"
#include <QDebug>
#include <QFile>
#include <QSerialPortInfo>
#include <QMessageBox>
#include <QString>
#include <QByteArray>
#include <QTimer>
#include <QFont>
#include <QProcess>
#include <QDateTime>
#include <QScrollBar>
#include <QFileDialog>
#include <QRegExp>
#include <QValidator>
#include "aboutdialog.h"
namespace Ui {
class SerialPort;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
void StringToHex(QString str, QByteArray &senddata);
char ConvertHexChar(char ch);
void initQssStyleSheet();
long xcount;
long xrange;
private slots:
void on_pushButton_open_clicked();
void on_pushButton_scan_clicked();
void serialRcvData();
void on_pushButton_close_clicked();
void on_comboBox_baudrate_currentIndexChanged(int index);
void on_comboBox_stopbits_currentIndexChanged(int index);
void on_comboBox_checkdigit_currentIndexChanged(int index);
void on_comboBox_flowctrl_currentIndexChanged(int index);
void on_radioButton_send_ascii_clicked();
void on_radioButton_send_hex_clicked();
void on_radioButton_rec_ascii_clicked();
void on_radioButton_rec_hex_clicked();
void on_pushButton_clear_clicked();
void on_pushButton_send_clicked();
void on_spinBox_repeat_valueChanged(int arg1);
void on_checkBox_repeat_clicked(bool checked);
void on_comboBox_databits_currentIndexChanged(int index);
void on_checkBox_enableDraw_clicked(bool checked);
void on_pushButton_pause_clicked();
void on_actionAbout_TinySerialPort_triggered();
void SoftAutoWriteUart( void );
void on_checkBox_dispsend_clicked(bool checked);
void on_checkBox_disptime_clicked(bool checked);
void on_actionSave_Log_File_triggered();
void on_comboBox_serialPort_currentIndexChanged(const QString &arg1);
void on_comboBox_baudrate_editTextChanged(const QString &arg1);
private:
Ui::SerialPort *ui;
AboutDialog *aboutDialog;
QTimer *repeatSendTimer;
QProcess *terminal;
QSerialPort *serial;
QString currentConnectCom;
QByteArray globalRecvData;
QValidator *validator_combox_baudrate;
bool isRoot;
bool isShowSend;
bool isShowTime;
bool recAsciiFormat;
bool sendAsciiFormat;
bool repeatSend;
bool enableDrawFunction;
bool pauseComOutput;
void RefreshTheUSBList( void );
QByteArray statusBarComInfo;
quint64 recCount;
quint64 sendCount;
};
#endif // SERIALPORT_H