Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+52
@@ -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
|
||||
Reference in new issue
Block a user