You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.5 KiB
C++
70 lines
1.5 KiB
C++
#ifndef STRUCTDEFINEMYSLEF_H
|
|
#define STRUCTDEFINEMYSLEF_H
|
|
|
|
#include <QHostAddress>
|
|
#include <QString>
|
|
|
|
struct MyPairNetwork {
|
|
public:
|
|
MyPairNetwork() {};
|
|
MyPairNetwork(QString a, int b, QString c, int d) {
|
|
localIP = a;
|
|
localPort = b;
|
|
remoteIP = c;
|
|
remotePort = d;
|
|
localAddr.setAddress(localIP);
|
|
remoteAddr.setAddress(remoteIP);
|
|
}
|
|
|
|
private:
|
|
QString localIP;
|
|
quint16 localPort;
|
|
QHostAddress localAddr;
|
|
QString remoteIP;
|
|
quint16 remotePort;
|
|
QHostAddress remoteAddr;
|
|
|
|
public:
|
|
void setLocalIP(QString ip) {
|
|
localIP = ip;
|
|
localAddr.setAddress(localIP);
|
|
}
|
|
void setLocalPort(quint16 port) { localPort = port; }
|
|
void setRemoteIP(QString ip) {
|
|
remoteIP = ip;
|
|
remoteAddr.setAddress(remoteIP);
|
|
}
|
|
void setRemotePort(quint16 port) { remotePort = port; }
|
|
QString getLocalIP() { return localIP; }
|
|
quint16 getLocalPort() { return localPort; }
|
|
QHostAddress getLocalAddr() { return localAddr; }
|
|
QString getRemoteIP() { return remoteIP; }
|
|
quint16 getRemotePort() { return remotePort; }
|
|
QHostAddress getRemoteAddr() { return remoteAddr; }
|
|
};
|
|
// 串口
|
|
struct serialStruct {
|
|
QString serialId;
|
|
int baudrate;
|
|
};
|
|
// 网口
|
|
struct netStruct {
|
|
QString localIp;
|
|
QString remoteIp;
|
|
int localPort;
|
|
int remotePort;
|
|
};
|
|
// 设置结构体
|
|
struct settingStruct {
|
|
public:
|
|
settingStruct() {};
|
|
// settingStruct(QString str1, QString str2, int d) { url = str1; }
|
|
|
|
public:
|
|
QString url; // 网址
|
|
serialStruct serial; // 串口
|
|
netStruct net; // 网口
|
|
};
|
|
|
|
#endif // STRUCTDEFINEMYSLEF_H
|