/** * @RDE_HEADER@ * AesHandler for AdlerJson Plugin * $Id: aes_handler.h 62304 2024-03-21 08:17:45Z ewert_j $ * $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h $ * $Author: ewert_j $ * Created by Julius Ewert, ESIM, 2024-03-20 */ #pragma once #include "DDS/Core/function_reply_object.h" #include "logger.h" #include "main_dispatcher.h" #include "telegrams.h" #include #include #include #include #include #include #include #include #include #include namespace AdlerJson { class MainDispatcher; class AesHandler : public QObject , protected AreaEffectSimulation::Interface::Ftc::AirSupportImpactModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::OffRouteMineModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::EffectClusterModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::TrajectoryAdlerModifyReplyHandler , protected NotificationManagement::Interface::Ftc::CreateNotificationReplyHandler { Q_OBJECT public: explicit AesHandler(std::shared_ptr ftsTab, QObject *parent = nullptr); bool init(MainDispatcher *mainDispatcher); bool sendAesModifyRequest(const QJsonObject &obj); bool sendExplosionArea(const QJsonObject &data); // DDS Overrides void onAirSupportImpactModifyReply(const Core::FunctionReplyObject &reply) override; void onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject) override; void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override; void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override; // Internal void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType); void onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType); void handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::CreateSingleExplosion &data); void handleEXFire(const Feuerkampfdaten &data, int wsId); void handleEXDontFire(const Feuerkampfdaten &data, int wsId); // Reald Data void sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &data, int participantId, int wirkmittelIndex, int aesId); void handleEffectCluster(const WirkfeldplanungData &data, int wsId); // void removeAllPendingEffectCluster(int partyId); std::shared_ptr getDtc() { return m_dtcAes; }; std::shared_ptr getFtc() { return m_ftcAes; }; private: AreaEffectSimulation::Area createMinimumRect(int zone, const QVector &points); signals: void explosionSingleChanged(const QJsonObject &jsonObj); private: QList findAllPendingEffectCluster(int partyId); void handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug = false); private: MainDispatcher *m_mainDispatcher; std::shared_ptr m_ftcAes; std::shared_ptr m_dtcAes; std::shared_ptr m_dtcPpm; std::shared_ptr m_ddsHandler; void onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) override; LtsUtils::RequestHelper *m_requestHelper; QHash m_singleExplosions; WirkfeldplanungData m_wirkfeldPlanungsData; QHash m_aesIdToFeuerkampfReferenz; // key = aesId, value = feuerkampfReferenz QHash m_feuerkampReferenzAmmoCounter; // key = feuerkampfReferenz, value = AmmoCounter QHash> m_feuerkampfReferenzWirkmittel; // key = feuerkampfReferenz, value = Kenner QHash m_feuerkampfReferenzUsedFeuerHalt; // key = feuerkampfReferenz, value = boolean -> if Feuerhalt was activ int m_participantId; int m_wirkmittelIndex; int m_aesId; QHash aesIdWsId; // key = aesId value = wsId LOGGER_T m_logger; }; } // namespace AdlerJson