Files

46 lines
931 B
C++
Executable File

/*
* @RDE_HEADER@
* Simulate players
* $Id$
* $HeadURL$
* $Author$
* Created by Hanna E. Rathje, SLTE, 2022-03-29
*/
#pragma once
#include <NGLLogger/INGLLogger.h>
#include <QtCore/QObject>
#include <QtCore/QPointF>
namespace WlsRandomPositions
{
class SimulatedPlayer : public QObject
{
Q_OBJECT
public:
SimulatedPlayer(int equipNo, qint64 mac, int msecs, int jitter = 0, double maxDistance = 0.0, QObject *parent = nullptr);
void start();
signals:
void sendInitTelegram(const QString &macAddress, const QByteArray &msg);
void sendPositionTelegram(const QString &macAddress, QPointF pos, double height);
private slots:
void onTimerTimeout();
private:
static QString toMacString(qint64 mac);
int m_equipNo;
QString m_macAddress;
int m_msecs;
int m_jitter;
double m_maxDistance;
QPair<QPointF,double> m_pos;
NGL::INGLLogger &m_logger;
};
} // Namespace WlsRandomPositions