Files
qt-migration-legatus/qt5-before/dlbo/Lts/Services/CentralEffectSimulation/dds_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

144 lines
8.2 KiB
C++

/**
* DdsHandlerAes for DDS
* $Id$
* $HeadURL$
* $Author$
* Created by gr, SLSE, 2015-09-02
*/
#pragma once
#include <QObject>
#include <DDS/DDSConnector/dds_connector.h>
#include <DDS/Core/core_dtc.h>
#include <DDS/Core/topic_lock_master.h>
#include <CentralEffectSimulation/ces_dts.h>
#include <CentralEffectSimulation/ces_fts.h>
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <AssetManagement/asm_dtc.h>
#include <Buildings/bld_dtc.h>
#include <Buildings/bld_ftc.h>
#include <ExerciseManagement/exm_dtc.h>
#include <InfrastructureManagement/ism_dtc.h>
#include <ProjectDataManagement/pdm_dtc.h>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h>
#include <ParticipantManagement/ppm_ftc_types.h>
#include <TrainingAreaBase/tab_ftc.h>
#include <TrainingAreaBase/tab_dts.h>
#include <TrainingAreaBase/tab_dtc.h>
#include <MeteoDataManagement/mdm_dtc.h>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <CentralEffectSimulation/svccesddscommon_export.h>
#include "logger.h"
namespace Core
{
class Pacemaker;
}
namespace CentralEffectSimulation
{
class SVCCESDDSCOMMON_EXPORT DdsHandler final : public QObject
{
Q_OBJECT
public:
DdsHandler(int domainId, int exerciseId);
bool init(const QStringList &qosFileList = QStringList());
std::shared_ptr<Core::Pacemaker> pacemaker() const { return m_pacemaker; }
std::shared_ptr<Core::TopicLockMaster> topicLockMaster() const { return m_topicLockMaster; }
std::shared_ptr<DDSConnector::DdsConnector> dds() const { return m_ddsConnector; }
std::shared_ptr<Core::Interface::Dtc> dtcCore() const { return m_dtcCore;}
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> dtcAes() const { return m_dtcAes;} ///< Pointer to DTC AreaEffectSimulation interface object
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> ftcAes() const { return m_ftcAes;} ///< Pointer to FTC AreaEffectSimulation interface object
std::shared_ptr<CentralEffectSimulation::Interface::Dts> dtsCes() const { return m_dtsCes;} ///< Pointer to DTS CentralEffectSimulation interface object
std::shared_ptr<CentralEffectSimulation::Interface::Fts> ftsCes() const { return m_ftsCes;} ///< Pointer to FTS CentralEffectSimulation interface object
std::shared_ptr<InfrastructureManagement::Interface::Dtc> dtcIsm() const { return m_dtcIsm;} ///< Pointer to DTC InfrastructureManagement interface object
std::shared_ptr<ProjectDataManagement::Interface::Dtc> dtcPdm() const { return m_dtcPdm;} ///< Pointer to DTC ProjectDataManagement interface object
std::shared_ptr<Buildings::Interface::Ftc> ftcBld() const { return m_ftcBld;}
std::shared_ptr<ParticipantManagement::Interface::Dtc> dtcPpm() const {return m_dtcPpm;} ///< Pointer to DTC ParticipantManagement interface object
std::shared_ptr<ParticipantManagement::Interface::Ftc> ftcPpm() const {return m_ftcPpm;}
std::shared_ptr<TrainingAreaBase::Interface::Ftc> ftcTab() const { return m_ftcTab;}
std::shared_ptr<TrainingAreaBase::Interface::Dts> dtsTab() const {return m_dtsTab;} ///< Pointer to DTS TrainingAreaBase interface object
std::shared_ptr<TrainingAreaBase::Interface::Dtc> dtcTab() const {return m_dtcTab;} ///< Pointer to DTC TrainingAreaBase interface object
std::shared_ptr<MeteoDataManagement::Interface::Dtc> dtcMdm() const {return m_dtcMdm;} ///< Pointer to DTC TrainingAreaBase interface object
std::shared_ptr<Buildings::Interface::Dtc> dtcBld() const { return m_dtcBld;}
std::shared_ptr<AssetManagement::Interface::Dtc> asmDtc() const { return m_asmDtc; }
std::shared_ptr<ExerciseManagement::Interface::Dtc> exmDtc() const { return m_exmDtc; }
int getParticipantEventId() { return m_participantEventId++;}
int getExerciseId() const { return m_exerciseId;}
qint64 currentPartitionTime() const;
/**
* Get equipment number for the given participant
* @param participantId participant id to get the equipment number for
* @return equipment number or 0 in case of failure
*/
int participantId2EquipNo(const int participantId) const;
int equipNo2ParticipantId(const int equipmentNumber) const;
double chargeTypeRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct);
double chargeHeight ( const AreaEffectSimulation::ChargeStruct &chargeStruct);
ProjectDataManagement::VolatilityType volatilityTypeId(const AreaEffectSimulation::ChargeStruct &chargeStruct);
bool isSmartChargeType(const AreaEffectSimulation::ChargeStruct &chargeStruct);
bool isSmoke(const AreaEffectSimulation::ChargeStruct &chargeStruct);
bool isLaserGuidable(const AreaEffectSimulation::ChargeStruct &chargeStruct);
bool isJamming(const AreaEffectSimulation::ChargeStruct &chargeStruct);
bool isDus(const AreaEffectSimulation::ChargeStruct &chargeStruct);
bool isAtMine(const AreaEffectSimulation::ChargeStruct &chargeStruct);
QVector<ProjectDataManagement::CasEffect> getCasEffects(const AreaEffectSimulation::ChargeStruct &chargeStruct);
int32_t getLegacyIdFromChargeTypeId(const AreaEffectSimulation::ChargeStruct &chargeStruct);
ProjectDataManagement::IgniterFunctionBase getIgniterFunctionBaseFromChargeTypeId(const int32_t chargeTypeId, int igniterTypeId, int igniterFunctionId);
int searchRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct);
int remainingTasCode(const AreaEffectSimulation::ChargeStruct &chargeStruct) const;
int secondaryRemainingTasCode(const AreaEffectSimulation::ChargeStruct &chargeStruct) const;
int getLethalRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const;
int getNonLethalRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const;
int getHazardDistance(const AreaEffectSimulation::ChargeStruct &chargeStruct) const;
private:
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Pacemaker> m_pacemaker;
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
std::shared_ptr<CentralEffectSimulation::Interface::Dts> m_dtsCes; ///< Pointer to DTS CentralEffectSimulation interface object
std::shared_ptr<CentralEffectSimulation::Interface::Fts> m_ftsCes; ///< Pointer to FTS CentralEffectSimulation interface object
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes; ///< Pointer to DTC AreaEffectSimulation interface object
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes; ///< Pointer to FTC AreaEffectSimulation interface object
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_dtcIsm; ///< Pointer to DTC InfrastructureManagement interface object
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_dtcPdm; ///< Pointer to DTC ProjectDataManagement interface object
std::shared_ptr<Buildings::Interface::Ftc> m_ftcBld;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm; ///< Pointer to DTC ParticipantManagement interface object
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftcPpm;
std::shared_ptr<TrainingAreaBase::Interface::Ftc> m_ftcTab;
std::shared_ptr<TrainingAreaBase::Interface::Dts> m_dtsTab; ///< Pointer to DTS TrainingAreaBase interface object
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_dtcTab; ///< Pointer to DTC TrainingAreaBase interface object
std::shared_ptr<Buildings::Interface::Dtc> m_dtcBld; ///< Pointer to DTC Buildings interface object
std::shared_ptr<MeteoDataManagement::Interface::Dtc> m_dtcMdm; ///< Pointer to DTC Buildings interface object
std::shared_ptr<AssetManagement::Interface::Dtc> m_asmDtc;
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
//QMap<int, int> m_partId2EquipNoMap; ///< Reference map participant (player) to equipment number (
// AES-Values
QMap<int, ProjectDataManagement::ChargeType> m_chargeTypes;
int m_participantEventId;
int m_exerciseId;
CentralEffectSimulation::LOGGER_T &m_logger; ///< Interface to the Logging-Facility
};
} // namespace CentralEffectSimulation