Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+50
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Access Data from TRIMBLE and emit contents as QByteArray
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QThread>
|
||||
#include <QtNetwork/QAbstractSocket>
|
||||
namespace NGL {
|
||||
class INGLLogger;
|
||||
}
|
||||
class QTcpSocket;
|
||||
|
||||
/*********************************************************
|
||||
* HOWTO: *
|
||||
* *
|
||||
* - Instantiate this Class without parent(!), *
|
||||
* - call init() to establish the connection, on success: *
|
||||
* - call start() to move it to the thread *
|
||||
*********************************************************/
|
||||
namespace HighLevelArchitecture {
|
||||
|
||||
class SocketReader : public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SocketReader(QObject *parent = nullptr);
|
||||
bool init(const QString &host, quint16 port, int id);
|
||||
void stopThread();
|
||||
~SocketReader();
|
||||
|
||||
signals:
|
||||
void newData(const QByteArray &content, int id);
|
||||
|
||||
protected:
|
||||
QTcpSocket *m_socket;
|
||||
int m_hlaRequestIdentifier;
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
private slots:
|
||||
void onReadyRead();
|
||||
void onSocketError(const QAbstractSocket::SocketError &error);
|
||||
|
||||
};
|
||||
|
||||
|
||||
} // Namespace HLA
|
||||
Reference in new issue
Block a user