/** * DdsHandlerAes for DDS * $Id$ * $HeadURL$ * $Author$ * Created by gr, SLSE, 2015-09-02 */ #pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "logger.h" namespace Core { class Pacemaker; } namespace CentralEffectSimulation { class SVCCESDDSCOMMON_EXPORT DdsHandler final : public QObject { Q_OBJECT public: DdsHandler(int domainId, int exerciseId); bool init(const QStringList &qosFileList = QStringList()); std::shared_ptr pacemaker() const { return m_pacemaker; } std::shared_ptr topicLockMaster() const { return m_topicLockMaster; } std::shared_ptr dds() const { return m_ddsConnector; } std::shared_ptr dtcCore() const { return m_dtcCore;} std::shared_ptr dtcAes() const { return m_dtcAes;} ///< Pointer to DTC AreaEffectSimulation interface object std::shared_ptr ftcAes() const { return m_ftcAes;} ///< Pointer to FTC AreaEffectSimulation interface object std::shared_ptr dtsCes() const { return m_dtsCes;} ///< Pointer to DTS CentralEffectSimulation interface object std::shared_ptr ftsCes() const { return m_ftsCes;} ///< Pointer to FTS CentralEffectSimulation interface object std::shared_ptr dtcIsm() const { return m_dtcIsm;} ///< Pointer to DTC InfrastructureManagement interface object std::shared_ptr dtcPdm() const { return m_dtcPdm;} ///< Pointer to DTC ProjectDataManagement interface object std::shared_ptr ftcBld() const { return m_ftcBld;} std::shared_ptr dtcPpm() const {return m_dtcPpm;} ///< Pointer to DTC ParticipantManagement interface object std::shared_ptr ftcPpm() const {return m_ftcPpm;} std::shared_ptr ftcTab() const { return m_ftcTab;} std::shared_ptr dtsTab() const {return m_dtsTab;} ///< Pointer to DTS TrainingAreaBase interface object std::shared_ptr dtcTab() const {return m_dtcTab;} ///< Pointer to DTC TrainingAreaBase interface object std::shared_ptr dtcMdm() const {return m_dtcMdm;} ///< Pointer to DTC TrainingAreaBase interface object std::shared_ptr dtcBld() const { return m_dtcBld;} std::shared_ptr asmDtc() const { return m_asmDtc; } std::shared_ptr exmDtc() const { return m_exmDtc; } int getParticipantEventId() { return m_participantEventId++;} int getExerciseId() const { return m_exerciseId;} qint64 currentPartitionTime() const; /** * Get equipment number for the given participant * @param participantId participant id to get the equipment number for * @return equipment number or 0 in case of failure */ int participantId2EquipNo(const int participantId) const; int equipNo2ParticipantId(const int equipmentNumber) const; double chargeTypeRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct); double chargeHeight ( const AreaEffectSimulation::ChargeStruct &chargeStruct); ProjectDataManagement::VolatilityType volatilityTypeId(const AreaEffectSimulation::ChargeStruct &chargeStruct); bool isSmartChargeType(const AreaEffectSimulation::ChargeStruct &chargeStruct); bool isSmoke(const AreaEffectSimulation::ChargeStruct &chargeStruct); bool isLaserGuidable(const AreaEffectSimulation::ChargeStruct &chargeStruct); bool isJamming(const AreaEffectSimulation::ChargeStruct &chargeStruct); bool isDus(const AreaEffectSimulation::ChargeStruct &chargeStruct); bool isAtMine(const AreaEffectSimulation::ChargeStruct &chargeStruct); QVector getCasEffects(const AreaEffectSimulation::ChargeStruct &chargeStruct); int32_t getLegacyIdFromChargeTypeId(const AreaEffectSimulation::ChargeStruct &chargeStruct); ProjectDataManagement::IgniterFunctionBase getIgniterFunctionBaseFromChargeTypeId(const int32_t chargeTypeId, int igniterTypeId, int igniterFunctionId); int searchRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct); int remainingTasCode(const AreaEffectSimulation::ChargeStruct &chargeStruct) const; int secondaryRemainingTasCode(const AreaEffectSimulation::ChargeStruct &chargeStruct) const; int getLethalRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const; int getNonLethalRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const; int getHazardDistance(const AreaEffectSimulation::ChargeStruct &chargeStruct) const; private: std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_topicLockMaster; std::shared_ptr m_dtcCore; std::shared_ptr m_dtsCes; ///< Pointer to DTS CentralEffectSimulation interface object std::shared_ptr m_ftsCes; ///< Pointer to FTS CentralEffectSimulation interface object std::shared_ptr m_dtcAes; ///< Pointer to DTC AreaEffectSimulation interface object std::shared_ptr m_ftcAes; ///< Pointer to FTC AreaEffectSimulation interface object std::shared_ptr m_dtcIsm; ///< Pointer to DTC InfrastructureManagement interface object std::shared_ptr m_dtcPdm; ///< Pointer to DTC ProjectDataManagement interface object std::shared_ptr m_ftcBld; std::shared_ptr m_dtcPpm; ///< Pointer to DTC ParticipantManagement interface object std::shared_ptr m_ftcPpm; std::shared_ptr m_ftcTab; std::shared_ptr m_dtsTab; ///< Pointer to DTS TrainingAreaBase interface object std::shared_ptr m_dtcTab; ///< Pointer to DTC TrainingAreaBase interface object std::shared_ptr m_dtcBld; ///< Pointer to DTC Buildings interface object std::shared_ptr m_dtcMdm; ///< Pointer to DTC Buildings interface object std::shared_ptr m_asmDtc; std::shared_ptr m_exmDtc; //QMap m_partId2EquipNoMap; ///< Reference map participant (player) to equipment number ( // AES-Values QMap m_chargeTypes; int m_participantEventId; int m_exerciseId; CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility }; } // namespace CentralEffectSimulation