|
@@ -0,0 +1,35 @@
|
|
|
|
+#ifndef INTERFACESERVER_H
|
|
|
|
+#define INTERFACESERVER_H
|
|
|
|
+
|
|
|
|
+#include <QTcpServer>
|
|
|
|
+#include <QList>
|
|
|
|
+
|
|
|
|
+#include "interfacethread.h"
|
|
|
|
+
|
|
|
|
+class InterfaceServer : public QTcpServer//参照smartlightserver编写,可用端口55010,已在服务器上注册预留
|
|
|
|
+{
|
|
|
|
+ Q_OBJECT
|
|
|
|
+public:
|
|
|
|
+ explicit InterfaceServer(QObject *parent = nullptr);
|
|
|
|
+ void start();
|
|
|
|
+ void setEchoString(QString CommId, QString EchoString);
|
|
|
|
+
|
|
|
|
+signals:
|
|
|
|
+ void SetResetRequest(QString deviceID, int commandType, QString parameterType, int pseq);
|
|
|
|
+ void SetRequestRealTimeData(QString deviceID, int commandType, int parameterType, int pn, int queryNumber, int startPoint);
|
|
|
|
+ void SetRequestSetParameters(QString deviceID, int commandType, int parameterType, QString tmp);
|
|
|
|
+ void SetCommData(QString deviceID, int dir, QString data);
|
|
|
|
+
|
|
|
|
+public slots:
|
|
|
|
+ void incomingConnection(qintptr socketDescriptor) override;
|
|
|
|
+ void resetRequest(QString deviceID, int commandType, QString parameterType, int pseq);
|
|
|
|
+ void requestRealTimeData(QString deviceID, int commandType, int parameterType, int pn, int queryNumber, int startPoint);
|
|
|
|
+ void requestSetParameters(QString deviceID, int commandType, int parameterType, QString tmp);
|
|
|
|
+ void CommData(QString deviceID, int dir, QString data);
|
|
|
|
+ void closeThread();
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ QList<InterfaceThread *> threadList;
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+#endif // INTERFACESERVER_H
|