mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/RRJServer.git
synced 2026-03-28 19:55:48 +03:00
62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#ifndef TCPCLIENT_H
|
|
#define TCPCLIENT_H
|
|
|
|
#include <QObject>
|
|
#include <QTcpSocket>
|
|
#include <QHostAddress>
|
|
#include <QDataStream>
|
|
#include <QTcpServer>
|
|
#include <QFile>
|
|
#include <QCoreApplication>
|
|
#include "Core\recognizesystem.h"
|
|
#include "Core\tools.h"
|
|
#include "sendsystem.h"
|
|
#include "Datas.h"
|
|
|
|
|
|
class RecognizeSystem;
|
|
class SendSystem;
|
|
|
|
class TCPClient : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
explicit TCPClient(QObject *parent = 0);
|
|
void initialize(RecognizeSystem *recognize,SendSystem *sendSystem);
|
|
void setConnect(ServerSettings *serverSettings);
|
|
void setDisconnect();
|
|
|
|
void waitRead(int time);
|
|
QTcpSocket* getSocket();
|
|
~TCPClient();
|
|
|
|
bool getIsConnected() const;
|
|
|
|
signals:
|
|
void sigSendDebugLog(QString message);
|
|
void sigRecognize(QTcpSocket *socket);
|
|
void sigServerDisconnect();
|
|
void sigConnectionState(bool flag);
|
|
void sigSetSocket(QTcpSocket *socket);
|
|
|
|
void signal_ConnectedToServer(bool state);
|
|
|
|
public slots:
|
|
void slotSendCommand(QString message);
|
|
void slotConnectNotify();
|
|
|
|
private slots:
|
|
void slotReadyRead();
|
|
|
|
|
|
private:
|
|
SendSystem *sendSystem;
|
|
QTcpSocket *socket;
|
|
RecognizeSystem *recognizeSystem;
|
|
bool isConnected;
|
|
};
|
|
|
|
#endif // TCPCLIENT_H
|