Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/include/AdlerJson/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

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 "DDS/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