Adds q2 repos to migrate
This commit is contained in:
1 parent
ad1f62c4ee
commit
17f1c61c9e
991 files changed
+178451
No files matched your search
@@ -0,0 +1,190 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "PrtCnvThread.hpp"
|
||||
|
||||
#include <QtNetwork/QAbstractSocket>
|
||||
#include <memory>
|
||||
|
||||
class QTimer;
|
||||
class QTcpSocket;
|
||||
|
||||
namespace N_CoPrtCnv
|
||||
{
|
||||
class CoPrtCnvRadioTelegram;
|
||||
}
|
||||
|
||||
namespace PrtCnv
|
||||
{
|
||||
class PrtCnvThreadStarter;
|
||||
class PrtCnvDbThread;
|
||||
class PrtCnvTelegramLogThread;
|
||||
class PrtCnvInjectionThread;
|
||||
|
||||
|
||||
class PrtCnvSocketThread : public PrtCnvThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
|
||||
|
||||
enum E_State
|
||||
{
|
||||
e_INITIAL,
|
||||
e_CONNECTING,
|
||||
e_REGISTERING,
|
||||
e_WORKING,
|
||||
e_DISCONNECTING,
|
||||
e_REINIT
|
||||
};
|
||||
|
||||
|
||||
PrtCnvSocketThread(PrtCnvThreadStarter* a_parent, const char *loggerName);
|
||||
~PrtCnvSocketThread();
|
||||
|
||||
|
||||
int32_t create(NGL::Settings *settings) override;
|
||||
|
||||
|
||||
|
||||
void createNewSocket();
|
||||
|
||||
|
||||
|
||||
int32_t init() override;
|
||||
|
||||
|
||||
int32_t destroy() override;
|
||||
void cleanup();
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
QTimer *m_ConnectionTimer;
|
||||
|
||||
|
||||
|
||||
|
||||
QTcpSocket *m_Socket;
|
||||
|
||||
|
||||
|
||||
void readHostAdresses();
|
||||
|
||||
protected slots:
|
||||
|
||||
|
||||
virtual void connected();
|
||||
|
||||
|
||||
virtual void readyRead();
|
||||
|
||||
|
||||
virtual void timeoutAliveAndConnection();
|
||||
|
||||
|
||||
virtual void timeoutTick() {}
|
||||
|
||||
|
||||
virtual void error(QAbstractSocket::SocketError a_socketError);
|
||||
|
||||
|
||||
virtual void hostFound();
|
||||
|
||||
|
||||
virtual void stateChanged(QAbstractSocket::SocketState a_socketState);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
QTimer *m_TickTimer;
|
||||
|
||||
|
||||
uint32_t m_ReceiveCounter;
|
||||
|
||||
|
||||
uint32_t m_ReceiveAckCounter;
|
||||
|
||||
|
||||
PrtCnvSocketThread::E_State m_State;
|
||||
|
||||
|
||||
PrtCnvDbThread *m_DbThread;
|
||||
|
||||
|
||||
|
||||
int32_t m_ConnectTimeout;
|
||||
|
||||
|
||||
int32_t m_DisconnectTimeout;
|
||||
|
||||
|
||||
int32_t m_AliveTimeout;
|
||||
|
||||
|
||||
int32_t m_TickTimeout;
|
||||
|
||||
|
||||
QAtomicInt m_DoCleanup;
|
||||
|
||||
|
||||
PrtCnvTelegramLogThread *m_LogThread;
|
||||
|
||||
PrtCnvInjectionThread *m_InjectionThread;
|
||||
|
||||
|
||||
|
||||
QVector<QPair<QString, uint16_t> > m_hostAdresses;
|
||||
|
||||
|
||||
|
||||
int m_currentHostAdressIndex;
|
||||
|
||||
|
||||
|
||||
virtual void disconnected();
|
||||
|
||||
|
||||
void startAliveTimer();
|
||||
|
||||
|
||||
void startConnectionTimer();
|
||||
|
||||
|
||||
void startDisconnectionTimer();
|
||||
|
||||
|
||||
|
||||
void connectSocket();
|
||||
|
||||
|
||||
void disconnectSocket();
|
||||
|
||||
|
||||
|
||||
void startTickTimer();
|
||||
|
||||
|
||||
|
||||
bool checkAndUpdateReceiveCounter(const uint32_t a_counter, const uint32_t a_maxCounter, const uint32_t a_startCounter);
|
||||
|
||||
|
||||
|
||||
void storeRadioTelegram(const std::shared_ptr<N_CoPrtCnv::CoPrtCnvRadioTelegram> &a_telegram, const uint32_t a_readCounter);
|
||||
};
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user