Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+52
View File
@@ -0,0 +1,52 @@
/*
* @RDE_HEADER@
* Sending of telegrams to websocket
* $Id$
* $HeadURL$
* $Author$
* Created by Hanna E. Rathje, SLTE, 2022-03-29
*/
#pragma once
#include "simulated_player.h"
#include <NGLLogger/INGLLogger.h>
#include <QTcpSocket>
namespace WlsRandomPositions
{
class Worker : public QObject
{
Q_OBJECT
public:
Worker(QObject *parent = nullptr);
~Worker();
void connectToServer(const QString &serverName, int serverPort);
void start(int numberParticipants, int firstEquipNo, qint64 firstMacAddress, int mSecs, int jitter, double maxDistance);
void stop();
void error();
signals:
void telegramsIncremented(int sentTelegrams);
void connectionStateChanged(bool connected, QString status);
private slots:
void onInit(const QString &macAddress, const QByteArray &content);
void onPosition(const QString &macAddress, QPointF pos, double height);
void onTcpConnected();
void onTcpDisconnected();
private:
QVector<SimulatedPlayer*> m_players;
QTcpSocket *m_tcpClient;
QString m_server;
int m_serverPort;
int m_sentTelegrams;
NGL::INGLLogger &m_logger;
};
} // Namespace WlsRandomPositions