Adds initial intermediate qt6 porting state
This commit is contained in:
11247 files changed
+1891537
No files matched your search
+55
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include "logger.h"
|
||||
#include <taboc_dtc.h>
|
||||
#include <QWebSocket>
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace TrainingAreaBaseOC {
|
||||
|
||||
enum class WebSocketState {
|
||||
DISCONNECTED = 0,
|
||||
CONNECTEDTOSERVER,
|
||||
CONNECTTOPPM,
|
||||
CONNECTEDTOPPM,
|
||||
};
|
||||
|
||||
class WebsocketHandler : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WebsocketHandler(QObject *parent, int exerciseId,
|
||||
const std::shared_ptr<Interface::Dts> dtsTabOc, const std::shared_ptr<Interface::Dtc> dtcTabOc);
|
||||
|
||||
private slots:
|
||||
void onTryConnectionTimerTimeout();
|
||||
void onFetchPositionTimerTimeout();
|
||||
void onNewSocketState(QAbstractSocket::SocketState state);
|
||||
void onNewTextMessageFromSocket(const QString &message);
|
||||
|
||||
private:
|
||||
void connectToExPPM(int exPort);
|
||||
void sendPositionRequest();
|
||||
void onSendOwnPosition(const QString &message);
|
||||
|
||||
void connectToServer();
|
||||
void sendServicePortRequest();
|
||||
void parseServices(const QString &message);
|
||||
|
||||
WebSocketState m_state = WebSocketState::DISCONNECTED;
|
||||
int m_exerciseId = 0;
|
||||
int m_ownEquipmentId = 0;
|
||||
std::shared_ptr<Interface::Dts> m_dtsTaboc;
|
||||
std::shared_ptr<Interface::Dtc> m_dtcTaboc;
|
||||
QTimer *m_tryConnectionTimer = nullptr;
|
||||
QTimer *m_fetchPositionTimer = nullptr;
|
||||
QWebSocket *m_socket = nullptr;
|
||||
|
||||
LOGGER_T &m_logger;
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user