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
@@ -1,15 +1,19 @@
|
||||
|
||||
|
||||
/**
|
||||
* MainHandler for TetraRadio
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
|
||||
#include "main_handler.h"
|
||||
#include <utility>
|
||||
#include "settings.h"
|
||||
#include "logger.h"
|
||||
#include "WebSocketInterface/Messages/reply_message.h"
|
||||
#include "WebSocketInterface/json_keys.h"
|
||||
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
#include <Core/pacemaker.h>
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <LtsPluginManager/lts_plugin_loader.h>
|
||||
#include <TrainingAreaBase/tab_record_replay_plugin.h>
|
||||
@@ -18,9 +22,9 @@
|
||||
#include <nglsettings/nglsettings_connections.h>
|
||||
#include <ngldb/nsqlquery.h>
|
||||
|
||||
#include <QtCore/QUuid>
|
||||
#include <QtCore/QJsonDocument>
|
||||
#include <QtSql/QSqlDatabase>
|
||||
#include <QUuid>
|
||||
#include <QJsonDocument>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
namespace TrainingAreaBase
|
||||
{
|
||||
@@ -29,6 +33,7 @@ MainHandler::MainHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(nullptr)
|
||||
, m_handlerWebSocket(nullptr)
|
||||
, m_logger(getLogger("MainHandler"))
|
||||
{}
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
@@ -54,12 +59,12 @@ MainHandler::~MainHandler()
|
||||
|
||||
bool MainHandler::init(int domainId, int exerciseId)
|
||||
{
|
||||
|
||||
// initialize database
|
||||
m_dbHandler = std::make_shared<DbHandler>();
|
||||
|
||||
if (!m_dbHandler->init(exerciseId, Settings::settings()))
|
||||
return false;
|
||||
|
||||
// initialize DDS
|
||||
m_ddsHandler = std::make_shared<DdsHandler>(domainId, exerciseId);
|
||||
if (!m_ddsHandler->init())
|
||||
return false;
|
||||
@@ -86,17 +91,52 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
m_ismHandler = std::make_shared<IsmHandler>(this);
|
||||
if (!m_ismHandler->init())
|
||||
return false;
|
||||
/*
|
||||
* Es gibt den Fall der Initialisierung, wenn der TAB Prozess neu gestartet wird.
|
||||
* Ist ein ABG zu diesem Zeitpunkt angemeldet und wird danach ein anderer Teilnehmer mit dem selben ABG angemeldet,
|
||||
* bleibt das Risiko bestehen, dass zwei Teilnehmer dasselbe ABG zum gleichen Zeitpunkt anzeigen.
|
||||
*
|
||||
*
|
||||
NSqlQuery q(databaseConnection());
|
||||
|
||||
TrainingAreaBase::RecordReplayPluginCustom *tabRecordReplay;
|
||||
tabRecordReplay = new TrainingAreaBase::RecordReplayPluginCustom;
|
||||
tabRecordReplay->initDtc(nullptr, exerciseId);
|
||||
|
||||
TrainingAreaBase::RecordReplayPlugin recordReplay;
|
||||
recordReplay.initDtc(nullptr, exerciseId);
|
||||
|
||||
if (!recordReplay.readParticipantSanitaryMaterialStockReportAt(q, QDateTime::currentMSecsSinceEpoch()))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not read ParticipantSanitaryMaterialStockReport";
|
||||
// return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto &latestStock = tabRecordReplay->getParticipantSanitaryMaterialStockReportMap();
|
||||
|
||||
ERROR_LOG(m_logger) << "Starting to latest ParticipantSanitaryMaterialStock. Size: "
|
||||
<< latestStock.size();
|
||||
|
||||
for (const auto &stock : latestStock)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Stock for equipment number " << stock.equipmentNumber();
|
||||
if (stock.uniqueId() > 0 && !m_uniqueId2EquipmentNumber.contains(stock.uniqueId()))
|
||||
m_uniqueId2EquipmentNumber.insert(stock.uniqueId(), stock.equipmentNumber());
|
||||
}
|
||||
}
|
||||
|
||||
tabRecordReplay->deleteLater();
|
||||
*/
|
||||
}
|
||||
m_posHandler = std::make_shared<PositionHandler>(this);
|
||||
if (!m_posHandler->init())
|
||||
return false;
|
||||
|
||||
|
||||
// to TrainingArea
|
||||
m_txHandler = std::make_shared<TxMixin>();
|
||||
|
||||
|
||||
// from DDS
|
||||
m_ftsHandler = std::make_shared<RecvFromDdsFts>(this,
|
||||
m_ddsHandler->ftsTab(),
|
||||
m_txHandler);
|
||||
@@ -108,10 +148,10 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// to DDS
|
||||
m_rxHandler = std::make_shared<SendToDds>(this);
|
||||
|
||||
|
||||
// to/from TrainingArea
|
||||
auto cb = [&](const LtsPluginManager::PluginInstance &pi) { return loadPlugin(pi); };
|
||||
LtsPluginManager::LtsPluginLoader::getInstance()->loadPlugins(LtsPluginManager::PluginType::SPECIAL,
|
||||
cb,
|
||||
@@ -129,7 +169,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
|
||||
|
||||
|
||||
|
||||
// WebSocketServer
|
||||
m_handlerWebSocket = std::make_shared<WebSocketInterface::WebSocketInterfaceHandler>(this);
|
||||
DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler successful.";
|
||||
|
||||
@@ -138,7 +178,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
|
||||
return false;
|
||||
}
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::CorePortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
|
||||
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
|
||||
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler successful.";
|
||||
|
||||
|
||||
@@ -155,7 +195,7 @@ ProjectDataManagement::RadioGroup MainHandler::exerciseRadioGroup() const
|
||||
{
|
||||
if (exerciseId() == 0)
|
||||
{
|
||||
|
||||
// for exercise 0 we have to look for a base grp
|
||||
const QMap<int, ProjectDataManagement::RadioGroup> radioGrps = m_pdmHandler->radioGroups();
|
||||
|
||||
for (auto it = radioGrps.begin(); it != radioGrps.end(); ++it)
|
||||
@@ -205,7 +245,7 @@ TetraIcd::ExerciseEnvironmentData MainHandler::exerciseEnvironmentData() const
|
||||
TetraIcd::ExerciseEnvironmentData exData;
|
||||
exData.exerciseId = exerciseId();
|
||||
const auto &baseCoord = m_posHandler->baseCoordinate();
|
||||
|
||||
// 32UPD
|
||||
const QString zone = baseCoord.mgrs(0, false);
|
||||
if (zone.isEmpty())
|
||||
return exData;
|
||||
@@ -292,8 +332,8 @@ void MainHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, Da
|
||||
if (modType == DataModification::eModified)
|
||||
m_txHandler->txData(exerciseStateData());
|
||||
|
||||
|
||||
for (const std::shared_ptr<Plugin::Interface> &ifc : std::as_const(m_interfaces))
|
||||
// update Interfaces
|
||||
for (const std::shared_ptr<Plugin::Interface> &ifc : qAsConst(m_interfaces))
|
||||
ifc->exerciseChanged();
|
||||
}
|
||||
|
||||
@@ -308,7 +348,7 @@ void MainHandler::onConnectionState(const QString &name, bool connectionState)
|
||||
if (itC != m_ifcConnectionState.end())
|
||||
{
|
||||
if (itC.value() == connectionState)
|
||||
return;
|
||||
return; // already send to DDS
|
||||
itC.value() = connectionState;
|
||||
}
|
||||
else
|
||||
@@ -347,13 +387,13 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
|
||||
if (biteData.equipNo <= 0)
|
||||
return;
|
||||
|
||||
|
||||
// configuration errors
|
||||
for (int it = 0 ; it < 32; it++)
|
||||
{
|
||||
quint32 bitValue = 1U << it;
|
||||
QString name;
|
||||
QString isOk;
|
||||
for (const ProjectDataManagement::CanComponentString &ccs : std::as_const(m_ccsMap))
|
||||
for (const ProjectDataManagement::CanComponentString &ccs : qAsConst(m_ccsMap))
|
||||
{
|
||||
if (ccs.bitMask() == bitValue)
|
||||
{
|
||||
@@ -382,7 +422,7 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// basic errors
|
||||
if(configError != 0)
|
||||
{
|
||||
WebSocketInterface::Messages::BiteDataMessage::BasicError error;
|
||||
@@ -396,8 +436,8 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
|
||||
biteData.basicErrors.append(error);
|
||||
}
|
||||
|
||||
|
||||
for (const auto &ele : std::as_const(biteError))
|
||||
// componentErrors
|
||||
for (const auto &ele : qAsConst(biteError))
|
||||
{
|
||||
QString text;
|
||||
QJsonObject error = ele.toObject();
|
||||
@@ -488,4 +528,4 @@ void MainHandler::onPositionChanged(int equipNo, const ParticipantManagement::Pa
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace TrainingAreaBase
|
||||
Reference in new issue
Block a user