42 lines
715 B
C++
Executable File
42 lines
715 B
C++
Executable File
|
|
|
|
#pragma once
|
|
#include "mainthread.h"
|
|
#include "tcpsocket.h"
|
|
|
|
class QTcpSocket;
|
|
class QTimer;
|
|
class MainThread;
|
|
|
|
namespace DifferentialGPS
|
|
{
|
|
class TrimbleIF final : public TcpSocket
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
TrimbleIF();
|
|
~TrimbleIF();
|
|
|
|
void startThread(int threadIndex, MainThread *main);
|
|
|
|
void run() override;
|
|
|
|
protected:
|
|
void dumpDataText(const QByteArray &ba);
|
|
void dumpDataBinary(const QByteArray &ba);
|
|
protected Q_SLOTS:
|
|
void onError(QAbstractSocket::SocketError) override;
|
|
void onReadyRead() override;
|
|
void onTimeout();
|
|
|
|
protected:
|
|
MainThread *m_main;
|
|
QByteArray m_buf;
|
|
int m_rxCycle_ms;
|
|
QTimer *m_socketTimeout;
|
|
QTimer *m_socketReconnect;
|
|
int m_threadIndex;
|
|
|
|
};
|
|
}
|