/** * Handler for Mine Laying Artillery * $Id$ * $HeadURL$ * $Author$ * Created by Nino Pinzer, ESZS, 12.03.2026 */ #pragma once #include #include #include #include #include #include #include #include #include #include class QTimer; namespace MineLayingArtillery { class HandlerMineLayingArtillery final : public QObject , protected AreaEffectSimulation::Interface::Ftc::ChargeEffectModifyReplyHandler { Q_OBJECT public: HandlerMineLayingArtillery(const std::shared_ptr &ddsHandler, QObject *parent = nullptr); ~HandlerMineLayingArtillery(); bool init(); double calculateAngle(const AreaEffectSimulation::TrajectoryTimeAware &trajectory); std::vector calculateImpacts(const QJsonObject &mineLayingPattern, const Core::GeoPosition2D &impactPositon, double angle, qint64 time, int patternCounter); private slots: void onChargeEffectChanged(const AreaEffectSimulation::ChargeEffect &data, DataModification modType); void onChargeTypeChanged(const ProjectDataManagement::ChargeType &data, DataModification modType); void onChargeEffectModifyReply(const Core::FunctionReplyObject &replyObject) override final; void onEffectClusterTimerTimeout(); private: // methods int patternCounterByImpactCount(const AreaEffectSimulation::EffectCluster &effectCluster, int patternCount, int impactCounter) const; int effectorIndexByImpactCount(const AreaEffectSimulation::EffectCluster &effectCluster, int impactCounter) const; private: // attributes QTimer *m_effectClusterTimer {nullptr}; QQueue m_effectClusterQue; std::shared_ptr m_ddsHandler; ///< Pointer to VOM DDS handler std::shared_ptr m_dtcPdm; std::shared_ptr m_dtcAes; std::shared_ptr m_ftcAes; CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility QMap m_mineLayingChargeTypes; QMap m_impactCounters; // key = aesItemId value = impactCounter }; } // namespace MineLayingArtillery