/** * Handle Participants which are available in the system (map between Wls id and ParticipantId) * $Id$ * $HeadURL$ * $Author$ * Created by Christian Ehrlicher, SLSE, 2017-01-10 */ #pragma once #include "logger.h" #include "wls_participant.h" #include #include #include #include #include namespace WirelessLocationSystem { class WebSocketHandler; class WlsHandler; class WlsParticipantHandler : public QObject { Q_OBJECT public: explicit WlsParticipantHandler(QObject *parent = nullptr); ~WlsParticipantHandler(); void init(WebSocketHandler *wsHandler, WlsHandler *wlsHandler); // ownership stays here WlsParticipant *createNewParticipant(const QByteArray &tagId); void setEquipmentNumber(WlsParticipant *participant, int equipmentNumber); WlsParticipant *participantByTagId(const QByteArray &tagId) const; const QHash &participants() const { return m_participantsByTagId; } void exerciseEquipmentAssignmentChanged(const std::unordered_map> &eea); void handleWlsBinarySfmData(const TrainingAreaBase::TetraIcd::WlsBinarySfmData &data); private Q_SLOTS: void onGpsOnOffTimeoutTimer(); private: WebSocketHandler *m_wsHandler = nullptr; WlsHandler *m_wlsHandler = nullptr; QHash m_participantsByTagId; QHash m_participantsByEqId; QHash m_equipNo2ExerciseId; QTimer *m_gpsOnOffTimeoutTimer; NGL::INGLLogger &m_logger; }; } // namespace WirelessLocationSystem