-
Notifications
You must be signed in to change notification settings - Fork 0
/
laserserialport.h
81 lines (72 loc) · 1.73 KB
/
laserserialport.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
#ifndef LASERSERIALPORT_H
#define LASERSERIALPORT_H
#include <QMainWindow>
#include <QWidget>
#include <QIntValidator>
#include <QLineEdit>
#include <QDialog>
#include <QtSerialPort/QSerialPort>
#include <QTimer>
#include <QQueue>
#include <QTextStream>
#include <iostream>
#include "wpid.h"
#include "qcustomplot.h"
namespace Ui {
class LaserSerialPort;
}
class wpid;
class test;
class SortDialog;
class LaserSerialPort : public QMainWindow
{
Q_OBJECT
public:
QByteArray getData(){return data;}
explicit LaserSerialPort(QWidget *parent = 0);
~LaserSerialPort();
private:
Ui::LaserSerialPort *ui;
struct Settings {
QString name;
qint32 baudRate;
QString stringBaudRate;
QSerialPort::DataBits dataBits;
QString stringDataBits;
QSerialPort::Parity parity;
QString stringParity;
QSerialPort::StopBits stopBits;
QString stringStopBits;
QSerialPort::FlowControl flowControl;
QString stringFlowControl;
bool localEchoEnabled;
};
Settings UARTsettings;
QSerialPort *serial;
QByteArray data;
wpid *piddialog;
bool serialPortConnected;
bool boardConnected;
// QTimer *dataTimer;
// QQueue<int> *TData;
void fillPortsParameters();
void fillPortsInfo();
bool openSerialPort();
void closeSerialPort();
void initialPlot();
void processData();
void dataPlot(int value);
private slots:
void showPortInfo(int idx);
void disconnet2com();
void connet2com();
bool writeData();
void readData();
void updateUARTSettings();
void shutDownLaser();
void setPID();
void openhelpurl();
void setDefaultValue();
void setValue();
};
#endif // LASERSERIALPORT_H