/** * Handler for infrastructure data * $Id$ * $HeadURL$ * $Author$ * Created by hjl, SLSE, 2016-09-21 */ #pragma once #include "main_handler.h" #include "logger.h" #include #include #include #include #include #include namespace ExerciseEventManagement { class WebSocketEventServer; class HandlerDynamicParticipantData : public QObject { Q_OBJECT public: explicit HandlerDynamicParticipantData(MainHandler *mainHandler, const std::shared_ptr &ddsHandler, const std::shared_ptr &db, const std::shared_ptr &eventServer); ~HandlerDynamicParticipantData(); /** * Initialize the handler to manage information from infrastructure management */ bool init(); /** * Returns the shared pointer to PPM DTC Interface. */ std::shared_ptr dtc() const { return m_ppmDtc; } private Q_SLOTS: void tryCreateHitEvent(Database::EemEvent eData, const ParticipantManagement::StateInformation &stateInfo); /** * Handle the signals from 'ParticipantManagement' */ void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); void onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent &data, DataModification modType); void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType); void onBiteChanged(const ParticipantManagement::Bite &data, DataModification modType); void onBuildingStateChanged(const Buildings::BuildingState &data, DataModification modType); void onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType); void onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType); /** * Handle MainStructureElement from 'ISM' */ void onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType); private: // methoden void publishData(const Database::EemEvent &data); ExerciseEventManagement::Event toDdsData(const Database::EemEvent &data); private: // attributes std::shared_ptr m_ddsHandler; ///< Pointer to DDS handler std::shared_ptr m_dbHandler; std::shared_ptr m_eventServer; std::shared_ptr m_ppmDtc; ///< Pointer to DTC ParticipantManagement interface object std::shared_ptr m_bldDtc; ///< Pointer to DTC ParticipantManagement interface object std::shared_ptr m_aesDtc; QHash m_partMap; QHash m_partPosMap; QHash m_lastDynData; QHash m_itemViews; QHash m_mainStructureElements; MainHandler *m_mainHandler; NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility }; } // namespace ExerciseEventManagement