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>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -0,0 +1,152 @@
|
||||
/**
|
||||
* DdsInterface for Aes
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include "aes_dts.h"
|
||||
#include "aes_fts.h"
|
||||
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <DDS/Core/core_dtc.h>
|
||||
#include <TrainingAreaBase/tab_dtc.h>
|
||||
#include <QCoreApplication>
|
||||
#include <QThread>
|
||||
|
||||
namespace AreaEffectSimulation
|
||||
{
|
||||
|
||||
DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_currentTimeMSec(-1)
|
||||
, m_logger(getLogger("DdsInterface"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
DdsHandler::~DdsHandler()
|
||||
{
|
||||
m_pdmDtc = nullptr;
|
||||
m_ppmDtc = nullptr;
|
||||
m_tabDtc = nullptr;
|
||||
m_tabFtc = nullptr;
|
||||
m_ddsFts = nullptr;
|
||||
m_ddsDts = nullptr;
|
||||
m_ismDtc = nullptr;
|
||||
m_topicLockMaster = nullptr;
|
||||
m_pacemaker = nullptr;
|
||||
m_dtcCore = nullptr;
|
||||
m_ddsConnector = nullptr;
|
||||
}
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
m_ddsConnector->enableBatchedWriter(false);
|
||||
|
||||
// Pacemaker
|
||||
m_pacemaker = std::make_shared<Core::Pacemaker>(m_ddsConnector);
|
||||
m_topicLockMaster = std::make_shared<Core::TopicLockMaster>(m_ddsConnector);
|
||||
|
||||
m_dtcCore = Core::Interface::Dtc::create(m_ddsConnector);
|
||||
connect(m_dtcCore.get(), &Core::Interface::Dtc::partitionTimeChanged,
|
||||
this, &DdsHandler::onPartitionTimeChanged);
|
||||
m_dtcCore->enablePartitionTime();
|
||||
// TODO: waitForHistoricalData does not work on non-keyed data as it seems ...
|
||||
for (int i = 0; i < 1000; ++i)
|
||||
{
|
||||
if (m_currentTimeMSec > 0)
|
||||
break;
|
||||
QCoreApplication::processEvents();
|
||||
QThread::msleep(10);
|
||||
}
|
||||
|
||||
// TrainingAreaBase
|
||||
m_tabDtc = TrainingAreaBase::Interface::Dtc::create(m_ddsConnector);
|
||||
m_tabFtc = TrainingAreaBase::Interface::Ftc::create(m_ddsConnector);
|
||||
bool bRet = m_tabFtc->enableSendResetAllDusMines();
|
||||
bRet &= m_tabFtc->enableAdlerCalculateTrajectory();
|
||||
bRet &= m_tabFtc->enableAdlerFqFb();
|
||||
bRet &= m_tabFtc->enableSendExConfirmationReport();
|
||||
bRet &= m_tabFtc->enableSendExFiredReport();
|
||||
bRet &= m_tabFtc->enableSendExFireReadiness();
|
||||
|
||||
|
||||
m_ddsDts = AreaEffectSimulation::Interface::Dts::create(m_ddsConnector);
|
||||
m_ddsFts = AreaEffectSimulation::Interface::Fts::create(m_ddsConnector);
|
||||
bRet &= m_ddsDts->enableAll();
|
||||
DEBUG_LOG(m_logger) << "initialized Dts: " << bRet;
|
||||
|
||||
bRet &= m_ddsFts->enableAll();
|
||||
bRet &= m_ddsFts->enableTargetPositionsModify();
|
||||
bRet &= m_ddsFts->enableTrajectoryAdlerModify();
|
||||
bRet &= m_ddsFts->enableEffectClusterFireHalt();
|
||||
|
||||
|
||||
bRet &= m_ddsFts->enableAcknowledgeExternalAesItem();
|
||||
bRet &= m_ddsFts->enableSetAesItemEffectorState();
|
||||
|
||||
DEBUG_LOG(m_logger) << "initialized Fts: " << bRet;
|
||||
|
||||
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_pdmDtc->enableChargeType();
|
||||
m_pdmDtc->waitForHistoricalDataChargeType(20000);
|
||||
|
||||
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_ppmDtc->enableParticipantPosition();
|
||||
m_ppmDtc->waitForHistoricalDataParticipantPosition(20000);
|
||||
m_ppmDtc->enableParticipant();
|
||||
m_ppmDtc->waitForHistoricalDataParticipant(20000);
|
||||
|
||||
m_cesFtc = CentralEffectSimulation::Interface::Ftc::create(m_ddsConnector);
|
||||
bRet &= m_cesFtc->enableDetonationLocation();
|
||||
|
||||
// for mine corridors (as buildings)
|
||||
m_ismDtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_ismDtc->enableMainFootprint();
|
||||
m_ismDtc->waitForHistoricalDataMainFootprint(20000);
|
||||
|
||||
// for Elevation :
|
||||
m_asmDtc = AssetManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_asmDtc->waitForHistoricalDataTrainingArea(1000);
|
||||
m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
m_exmDtc->waitForHistoricalDataExercise(1000);
|
||||
// : for Elevation
|
||||
|
||||
return bRet;
|
||||
}
|
||||
|
||||
QDateTime DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return QDateTime::fromMSecsSinceEpoch(currentPartitionTimeMSec());
|
||||
}
|
||||
|
||||
qint64 DdsHandler::currentPartitionTimeMSec() const
|
||||
{
|
||||
if (!m_elapsedTimer.isValid())
|
||||
return m_currentTimeMSec;
|
||||
return m_currentTimeMSec + m_elapsedTimer.elapsed();
|
||||
}
|
||||
|
||||
void DdsHandler::onPartitionTimeChanged(const Core::PartitionTime ¤tTime)
|
||||
{
|
||||
m_elapsedTimer.restart();
|
||||
m_currentTimeMSec = currentTime.timeStamp();
|
||||
}
|
||||
|
||||
ProjectDataManagement::ChargeType DdsHandler::getChargeType(int chargeTypeId)
|
||||
{
|
||||
return m_pdmDtc->chargeType(chargeTypeId);
|
||||
}
|
||||
|
||||
} // Namespace AES
|
||||
Reference in new issue
Block a user