Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.h
T
torstenandCopilot 7a6be7474e Qt6 migration: Fix BUILD_RTI=OFF build errors in TrainingAreaBase
- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document

C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+

Build status: BUILD_RTI=OFF successful (0 errors, warnings only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-23 20:49:23 +02:00

113 lines
4.8 KiB
C++
Executable File

#pragma once
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtCore/QSet>
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <AreaEffectSimulation/Utils/aes_helper.h>
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <Common/logger.h>
#include <Common/typestruct.h>
#define SUPPORT_AES_EFFECTS
#define SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
namespace HighLevelArchitecture
{
class NgsHandler;
struct ParticipantPosition;
class AesHandler : public QObject
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyReplyHandler
, protected AreaEffectSimulation::Interface::Ftc::MineAreaRemoveReplyHandler
, protected AreaEffectSimulation::Interface::Ftc::MineCorridorModifyReplyHandler
, protected AreaEffectSimulation::Interface::Ftc::MineCorridorRemoveReplyHandler
, protected AreaEffectSimulation::Interface::Ftc::ExplosionSingleModifyReplyHandler
#ifdef SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
, protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterSingleEffectOnlyModifyReplyHandler
#endif
{
Q_OBJECT
public:
explicit AesHandler(NgsHandler *ngsHandler);
void onMineAreaModifyReply(const Core::FunctionReplyObject &replyObject) override final;
void onMineAreaRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onMineCorridorModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onMineCorridorRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
void onExplosionSingleModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
#ifdef SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
void onExplosionClusterSingleEffectOnlyModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
#endif
int64_t externalId(int aesItemId) const;
bool init();
private Q_SLOTS:
void onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType);
void onTriggeredImpactsChanged(const AreaEffectSimulation::TriggeredImpacts &data, DataModification modType);
#ifdef SUPPORT_AES_EFFECTS
void onEffectsChanged(const AreaEffectSimulation::Effects &data, DataModification modType);
#endif
void onAesExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType);
void onAesMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType);
void onAesMineCorridorChanged(const AreaEffectSimulation::MineCorridor &data, DataModification modType);
void onAesNContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType);
void onAesBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType);
void onAesNameChanged(qint64 identifierInt, const std::string &newName);
void onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSinceEpoch);
void onAesForceIdentifierChanged(qint64 identifierInt, int partyId);
void onAesDurationChanged(qint64 identifierInt, quint32 u_time);
void onAesChargeChanged(qint64 identifierInt, int chargeTypeId);
void onAesPointsDataChanged(qint64 identifierInt, const std::vector<Core::GeoPosition2D> &pos);
void onAesRemoveItem(qint64 identifierInt);
bool onNewMinefield(const AreaEffectSimulation::MineAreaModifyRequest &ma);
bool onNewMinefieldBreach(const AreaEffectSimulation::MineCorridorModifyRequest &mc);
void onMunitionDetonation(const AreaEffectSimulation::ExplosionSingleModifyRequest &es);
#ifdef SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
void onMunitionDetonationExplosionClusterSingleEffect(const AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest &es);
#endif
private:
NGL::INGLLogger &m_logger;
template <typename T>
void onSendRequest(const T &item);
template <typename T>
void addRequestToQueue(int aesItemId, T *request);
static bool isModifiable(const AreaEffectSimulation::AesItem &item);
private:
NGL::INGLLogger &m_logger;
NgsHandler *m_ngsHandler;
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes;
QMap<int32_t, AreaEffectSimulation::AesItemView> m_aesItemViews;
QMap<int32_t, QVector<int32_t> > m_takenIndicesForAesItem;
#ifdef SUPPORT_AES_EFFECTS
AreaEffectSimulation::HandledImpactsStorage m_handledImpactsStorage;
#endif
QMap<int, void*> m_pendingRequests;
LtsUtils::RequestHelper *m_requestHelper;
};
}