45 lines
986 B
C++
Executable File
45 lines
986 B
C++
Executable File
/**
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#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; // Zyklus in ms in dem Daten empfangen werden sollten
|
|
QTimer *m_socketTimeout; // Timer zur Ueberwachung des receive-Daten-Zyklus
|
|
QTimer *m_socketReconnect; // Timer zum Reconnect-Versuch nachdem m_socketTimeout zugeschlagen hat
|
|
int m_threadIndex; // Index des Thread [0..1]
|
|
|
|
};
|
|
} // namespace DifferentialGPS
|