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,128 @@
|
||||
#include "main_handler.h"
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <QtCore/QThread>
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QDateTime>
|
||||
#include <QtCore/QElapsedTimer>
|
||||
#include "proxy_emulator.h"
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
VulnerabilityStateGenerator::MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_domainId(0)
|
||||
, m_exerciseId(0)
|
||||
, m_proxyEmulator(nullptr)
|
||||
, m_genTimer(new QTimer())
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("MainHandler"))
|
||||
{
|
||||
}
|
||||
|
||||
VulnerabilityStateGenerator::MainHandler::~MainHandler()
|
||||
{
|
||||
}
|
||||
|
||||
bool VulnerabilityStateGenerator::MainHandler::init(int32_t domainId, int32_t exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
|
||||
delete m_proxyEmulator;
|
||||
m_proxyEmulator = nullptr;
|
||||
|
||||
// DdsConnector
|
||||
DEBUG_LOG(m_logger) << "Creating and initializing DdsConnector ...";
|
||||
m_ddsConnector.reset(new DDSConnector::DdsConnector(m_domainId, IDL::PartitionType::Exercise, m_exerciseId));
|
||||
if (!m_ddsConnector->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not init DdsConnector";
|
||||
return false;
|
||||
}
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
DEBUG_LOG(m_logger) << "... done";
|
||||
|
||||
// dtc
|
||||
DEBUG_LOG(m_logger) << "Creating and initializing PPM DTC ...";
|
||||
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
QThread::msleep(100);
|
||||
if (!m_ppmDtc->enableAll())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not init PPM DTC";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "... done";
|
||||
|
||||
fillMapFromEnum();
|
||||
|
||||
DEBUG_LOG(m_logger) << "m_vsMap.size(): " << m_vsMap.size();
|
||||
|
||||
// ProxyEmulator
|
||||
DEBUG_LOG(m_logger) << "Creating and initializing ProxyEmulator ...";
|
||||
m_proxyEmulator = new ProxyEmulator(m_ddsConnector, this);
|
||||
QThread::msleep(100);
|
||||
if (!m_proxyEmulator->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not init ProxyEmulator";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_partMap = m_ppmDtc->participants();
|
||||
|
||||
m_proxyEmulator->giveInitState(m_partMap);
|
||||
|
||||
connect(m_genTimer, &QTimer::timeout, this, &MainHandler::setNewState);
|
||||
m_genTimer->start(1000);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void VulnerabilityStateGenerator::MainHandler::quit()
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Are the following procs running?\n"
|
||||
<< "svcParticipantManagement -d " << m_domainId << " -e 0\n"
|
||||
<< "svcParticipantManagement -d " << m_domainId << " -e " << m_exerciseId << "\n"
|
||||
<< "... shutting down";
|
||||
QCoreApplication::exit(-1);
|
||||
}
|
||||
|
||||
|
||||
ProjectDataManagement::VulnerabilityState VulnerabilityStateGenerator::MainHandler::randomVulnerabilityState()
|
||||
{
|
||||
ProjectDataManagement::VulnerabilityState result;
|
||||
|
||||
qsrand(QDateTime::currentMSecsSinceEpoch());
|
||||
unsigned int index = 0;
|
||||
if (m_vsMap.size() > 0)
|
||||
index = qrand() % m_vsMap.size();
|
||||
|
||||
|
||||
return m_vsMap.value(index);
|
||||
|
||||
}
|
||||
|
||||
void VulnerabilityStateGenerator::MainHandler::setNewState()
|
||||
{
|
||||
for (auto it = m_partMap.begin(); it != m_partMap.end(); ++it)
|
||||
{
|
||||
if (it.value().equipmentNumber().is_set() && it.value().equipmentNumber().get() > 0)
|
||||
m_proxyEmulator->publishNewState(randomVulnerabilityState(), it.value());
|
||||
}
|
||||
}
|
||||
|
||||
void VulnerabilityStateGenerator::MainHandler::fillMapFromEnum()
|
||||
{
|
||||
m_vsMap.insert(0, ProjectDataManagement::VulnerabilityState_def::CombatReady);
|
||||
m_vsMap.insert(1, ProjectDataManagement::VulnerabilityState_def::LightDamage);
|
||||
m_vsMap.insert(2, ProjectDataManagement::VulnerabilityState_def::MediumDamage);
|
||||
m_vsMap.insert(3, ProjectDataManagement::VulnerabilityState_def::HeavyDamage);
|
||||
m_vsMap.insert(4, ProjectDataManagement::VulnerabilityState_def::MobilityKill);
|
||||
m_vsMap.insert(5, ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill);
|
||||
m_vsMap.insert(6, ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage);
|
||||
m_vsMap.insert(7, ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage);
|
||||
m_vsMap.insert(8, ProjectDataManagement::VulnerabilityState_def::CatastrophicKill);
|
||||
m_vsMap.insert(9, ProjectDataManagement::VulnerabilityState_def::TemporarySeverance);
|
||||
m_vsMap.insert(10, ProjectDataManagement::VulnerabilityState_def::NearMiss);
|
||||
m_vsMap.insert(11, ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect);
|
||||
}
|
||||
Reference in new issue
Block a user