96 lines
3.5 KiB
C++
Executable File
96 lines
3.5 KiB
C++
Executable File
/**
|
|
* Handler for infrastructure data
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by hjl, SLSE, 2016-09-21
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "main_handler.h"
|
|
#include "logger.h"
|
|
|
|
#include <ParticipantManagement/ppm_dtc.h>
|
|
#include <AreaEffectSimulation/aes_dtc.h>
|
|
#include <Proxies/Buildings/bld_dtc.h>
|
|
#include <Proxies/Buildings/bld.hpp>
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QMap>
|
|
|
|
namespace ExerciseEventManagement
|
|
{
|
|
class WebSocketEventServer;
|
|
|
|
class HandlerDynamicParticipantData : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit HandlerDynamicParticipantData(MainHandler *mainHandler,
|
|
const std::shared_ptr<DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<DbHandler> &db,
|
|
const std::shared_ptr<WebSocketEventServer> &eventServer);
|
|
|
|
~HandlerDynamicParticipantData();
|
|
|
|
/**
|
|
* Initialize the handler to manage information from infrastructure management
|
|
*/
|
|
bool init();
|
|
|
|
|
|
/**
|
|
* Returns the shared pointer to PPM DTC Interface.
|
|
*/
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> 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<DdsHandler> m_ddsHandler; ///< Pointer to DDS handler
|
|
std::shared_ptr<DbHandler> m_dbHandler;
|
|
std::shared_ptr<WebSocketEventServer> m_eventServer;
|
|
|
|
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc; ///< Pointer to DTC ParticipantManagement interface object
|
|
std::shared_ptr<Buildings::Interface::Dtc> m_bldDtc; ///< Pointer to DTC ParticipantManagement interface object
|
|
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_aesDtc;
|
|
|
|
QHash<qint32, ParticipantManagement::Participant> m_partMap;
|
|
QHash<qint32, ParticipantManagement::ParticipantPosition> m_partPosMap;
|
|
QHash<qint32, ParticipantManagement::DynamicParticipantData> m_lastDynData;
|
|
|
|
QHash<int, AreaEffectSimulation::AesType> m_itemViews;
|
|
QHash<int, InfrastructureManagement::MainStructureElement> m_mainStructureElements;
|
|
|
|
MainHandler *m_mainHandler;
|
|
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
|
|
|
|
};
|
|
} // namespace ExerciseEventManagement
|
|
|