Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/.forward-declarations/include/AdlerJson/aes_handler.h
T
berrux-dev 5381c65fee Merge feature/qt6-migration-basis-modules-services into feature/qt6-migration-basis-modules
Resolves 17 conflicts against legacy Qt5 semantics; validates with BUILD_RTI=ON BUILD_GRANTLEE=ON.
2026-09-24 10:10:25 +02:00

105 lines
4.4 KiB
C++
Executable File

/**
* @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 "Core/core_types.h"
#include "logger.h"
#include "main_dispatcher.h"
#include "telegrams.h"
#include <QtCore/QDateTime>
#include <QtCore/QHash>
#include <QtCore/QObject>
#include <QtCore/QUrl>
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm.hpp>
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<TrainingAreaBase::Interface::Fts> 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<AreaEffectSimulation::Interface::Dtc> getDtc() { return m_dtcAes; };
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> getFtc() { return m_ftcAes; };
private:
AreaEffectSimulation::Area createMinimumRect(int zone, const QVector<QPointF> &points);
signals:
void explosionSingleChanged(const QJsonObject &jsonObj);
private:
QList<qint32> findAllPendingEffectCluster(int partyId);
void handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug = false);
private:
MainDispatcher *m_mainDispatcher;
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes;
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
std::shared_ptr<TrainingAreaBase::DdsHandler> m_ddsHandler;
void onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) override;
LtsUtils::RequestHelper *m_requestHelper;
QHash<int, AreaEffectSimulation::AesEffectState> m_singleExplosions;
WirkfeldplanungData m_wirkfeldPlanungsData;
QHash<int, QString> m_aesIdToFeuerkampfReferenz; // key = aesId, value = feuerkampfReferenz
QHash<QString, int> m_feuerkampReferenzAmmoCounter; // key = feuerkampfReferenz, value = AmmoCounter
QHash<QString, std::vector<ProjectDataManagement::L27_EffectorId>> m_feuerkampfReferenzWirkmittel; // key = feuerkampfReferenz, value = Kenner
QHash<QString, bool> m_feuerkampfReferenzUsedFeuerHalt; // key = feuerkampfReferenz, value = boolean -> if Feuerhalt was activ
int m_participantId;
int m_wirkmittelIndex;
int m_aesId;
QHash<int, int> aesIdWsId; // key = aesId value = wsId
};
} // namespace AdlerJson