-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyserverview.h
75 lines (62 loc) · 1.75 KB
/
myserverview.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
#ifndef MYSERVERVIEW_H
#define MYSERVERVIEW_H
#include <QtNetwork>
#include <QtWidgets>
class QTcpSocket;
class QTcpServer;
namespace Ui {
class MyServerView;
}
class MyServerView : public QWidget
{
Q_OBJECT
public:
MyServerView(QWidget *parent = nullptr);
~MyServerView();
signals:
void setTitle(const QString &title);
public slots:
virtual void onNewConnection();
void onReadClient();
void onSetContainer(const QHash<QString, QString> &container);
private slots:
void onClientDisconnect();
void onSetPortClicked();
void onPortPushButtonClicked();
void onClearWindowButtonClicked();
private:
Ui::MyServerView *ui;
QTcpServer* tcpServer = nullptr;
QDialog *portWindow = nullptr;
QLineEdit *portEdit = nullptr;
QHash<QString, QString> cmdContainer;
quint32 nClients;
quint16 tcpPort;
QSettings settings;
quint32 sendedCnt;
int pressMode;
int pressType;
int Dac1 = 1634;
int Dac2 = 3849;
double voltOut = 0.1;
double pressValue = 0.12;
bool clbRun = false;
QString strReceiveData, strTransmitData;
QString strPressLimit ="+0.0000000E+000";
QString strPressSetpoint = "+0.0000000E+000";
QString strPressValue = "+0.0000000E+000";
QString strChamberResponse = "0000.0 0101010001000000";
enum {
Unknown =0,
Multimeter,
Chamber,
Calibrator
} DeviceType;
void runServer(quint16 port);
void sendToClient(QTcpSocket* pSocket, const QByteArray& arrData);
void runMultimeterParser(const QString &rxdata);
void runChamberParser(const QString &rxdata);
void runCalibratorParser(const QString &rxdata);
void runDefaultParser(const QString &rxdata);
};
#endif // MYSERVERVIEW_H