Files
qt-migration-legatus/qt5-before/dlbo/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.h
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

118 lines
5.4 KiB
C++

/**
* Send AES data to NGS
* $Id$
* $HeadURL$
* $Author$
* Created by Hannes Baeuerle, SLSE, 2017-05-08
*/
#pragma once
#include <QObject>
#include <QHash>
#include <QSet>
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <AreaEffectSimulation/Utils/aes_helper.h>
#include <LtsUtilsGuiDds/request_helper.h>
#include <Common/logger.h>
#include <Common/typestruct.h>
#define SUPPORT_AES_EFFECTS // GUEZE-2570 / EXPLOSION_CLUSTER
#define SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT // GUEZE-2570 / EXPLOSION_CLUSTER
//------------------------------------------------------------------------------
// namespace HighLevelArchitecture
//------------------------------------------------------------------------------
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 // SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
{
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 // SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
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 // SUPPORT_AES_EFFECTS
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 // SUPPORT_EXPLOSION_CLUSTER_SINGLE_EFFECT
private:
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:
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; // Indices for ExplosionAreas that are already fired.
#ifdef SUPPORT_AES_EFFECTS
AreaEffectSimulation::HandledImpactsStorage m_handledImpactsStorage; // for ExplosionCluster
#endif // SUPPORT_AES_EFFECTS
QMap<int, void*> m_pendingRequests;
LtsUtils::RequestHelper *m_requestHelper;
NGL::INGLLogger &m_logger;
};
} // namespace HighLevelArchitecture