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:
torstenandCopilot committed 2026-09-15 18:20:26 +00:00
1 parent f23384bb68
commit 7173785915
18662 files changed
+4115092 -5435

No files matched your search

@@ -1,8 +1,13 @@
/**
* @RDE_HEADER@
* JsonDispatcher for Apache Plugin
* $Id: hla_dispatcher.cpp 62304 2024-03-21 08:17:45Z ewert_j $
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/hla_dispatcher.cpp $
* $Author: ewert_j $
* Created by Julius Ewert, ESIM, 2024-03-20
*/
#include "json_dispatcher.h"
#include <utility>
#include "json_handler_rx.h"
#include "json_handler_tx.h"
#include "settings.h"
@@ -10,11 +15,11 @@
#include <AreaEffectSimulation/aes_operator_rights.h>
#include <QHostInfo>
#include <QtCore/QJsonDocument>
#include <QtCore/QSettings>
#include <QtCore/QStringList>
#include <QtCore/QTimer>
#include <QtWebSockets/QWebSocket>
#include <QJsonDocument>
#include <QSettings>
#include <QStringList>
#include <QTimer>
#include <QWebSocket>
#include <nglsettings/nglsettings_settings.h>
#include <vector>
@@ -31,7 +36,7 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_recvFromTabCb(recvFromTabCb)
, m_recvFromWebsocket(std::make_shared<JsonHandlerRx>(recvFromTabCb, sendToTabCb, this, mainDispatcher->aesHandler().get(), mainDispatcher->ppmHandler().get()))
, m_sendToWebsocket(std::make_shared<JsonHandlerTx>(pdp, mainDispatcher))
// , m_ddsHandler(ddsHandler)
, m_mainDispatcher(mainDispatcher)
, m_flmHandler(flmHandler)
, m_ppmHandler(mainDispatcher->ppmHandler())
@@ -43,6 +48,7 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
, m_webSocketInterface(std::make_shared<TrainingAreaBase::WebSocketHandler>())
, m_webSocketReconnectTimer(new QTimer(this))
, m_bWarnedOnce(false)
, m_logger(getLogger("JsonDispatcher"))
{
DEBUG_LOG(m_logger) << "JsonDispatcher::JsonDispatcher";
@@ -269,32 +275,32 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
if (saa.get()->getPartyId() == partyId)
{
DEBUG_LOG(m_logger) << "saa already connected, reconnect!";
// exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Doppelt;
onSAADeregistration(saa.get()->getWsId(), partyId);
// TODO: emit or answer with saa already connected
}
else
{
DEBUG_LOG(m_logger) << "other saa connected to this party";
// exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Mehrfach;
// TODO: emit or answer with other saa connected to this party
}
}
else if (getSAAByParty(partyId))
{
DEBUG_LOG(m_logger) << "party is used by other saa";
// exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Belegt;
// TODO: emit or answer party is used by other saa
}
// else
{
auto newSaa = std::make_shared<SAAInterface>(wsId, partyId, saaName, szenarName, isVerbund);
newSaa->init(m_ppmHandler, m_mainDispatcher->pdmHandler(), m_mainDispatcher->aesHandler(), m_dtsTab);
// cleanUp first
cleanupSaaInterfaces(saaName, wsId, partyId);
m_saaInterfaces.append(newSaa);
// We created a new SAA, start keep alive procedure
int adlerOffset = m_settings->settings()->value(QLatin1String("TrainingAreaBase/AdlerKeepalive"), 30000).toInt();
DEBUG_LOG(m_logger) << "adlerOffset =" << adlerOffset;
if (adlerOffset > 0)
@@ -307,22 +313,22 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
keepaliveTimer->start();
}
saa = newSaa;
// Won't cleanup in Debug as the simulator won't send continous EX_VerbindugsAnfrage
DEBUG_LOG(m_logger) << "emit or answer without error wsId: " << wsId;
}
exRC.sender = getSender();
exRC.receiver = saa->getSAAName();
// Send Answer to SAA
m_sendToWebsocket->onGenericTelegram1(wsId, exRC.toJson());
// if we declined the registration don't update ppm/asm
if (exRC.anBestaetigungsdaten.error != AdlerJson::L45_AnmeldebestaetigungFehlercode::Ok)
return;
// Initialize HQ-Folders if not exist
m_flmHandler->initHQFolders(partyId);
// Modify Party
const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::Connected;
const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected);
const int assetId = getAssetId(saaName);
@@ -380,7 +386,7 @@ void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid)
if (connectionTimer)
{
DEBUG_LOG(m_logger) << "connectionTimer->start()";
connectionTimer->start();
connectionTimer->start(); // Restarts the KeepAlive Timer
}
DEBUG_LOG(m_logger) << "ConnectionTest from " << saa->getSAAName();
EXConnectionTestReply exCTR;
@@ -449,8 +455,8 @@ void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten
QString content = QString::fromUtf8(tr_lts("Notification", "<B>Status: </B>%1<br /><B> Description: </B>%2"));
QStringList args;
// INV = Meldung nicht gültig nach JSON-Schema.
// DAT = Datenkonsistenzfehler.
if (StatusL32Map.key(exceptionStatus.status) == QStringLiteral("INV"))
args << QString::fromUtf8(tr_lts("Notification", "Message is not valid according to JSON schema."));
@@ -471,25 +477,17 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS)
const bool isVerbund = true;
auto saa = getSAAByWs(wsId);
int partyId = saa->getPartyId();
QStringList args;
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQWS.einheit.verein, partyId, isVerbund);
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
args.append(QString::number(part.id()));
args.append(ortsIdMap.key(exSQWS.einheit.oi));
args.append(QString::number(exSQWS.einheit.r));
args.append(exSQWS.einheit.verein);
DEBUG_LOG(m_logger) << "Stellungsmeldung Waffensystem content=" << content;
createNotificationRequest(wsId,
QString::fromUtf8(tr_lts("Notification","Weapon System Position Report")),
NotificationManagement::MessageType_def::Info,
NotificationManagement::NotificationType::AdlerNotification,
content,
args);
m_ppmHandler->parseSQWS(exSQWS, wsId);
if (part.id() > 0)
{
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQWS.einheit);
return;
}
QTimer::singleShot(5000, this, [this, wsId, partyId, isVerbund, exSQWS]() {
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQWS.einheit);
});
}
void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS)
@@ -498,25 +496,17 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS
auto saa = getSAAByWs(wsId);
int partyId = saa->getPartyId();
const bool isVerbund = true;
QStringList args;
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQFS.feuereinheit.verein, partyId, isVerbund);
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
args.append(QString::number(part.id()));
args.append(ortsIdMap.key(exSQFS.feuereinheit.oi));
args.append(QString::number(exSQFS.feuereinheit.r));
args.append(exSQFS.feuereinheit.verein);
DEBUG_LOG(m_logger) << "Stellungsmeldung Feuerstellung content=" << content;
createNotificationRequest(wsId,
QString::fromUtf8(tr_lts("Notification","Position Report: Firing Unit")),
NotificationManagement::MessageType_def::Info,
NotificationManagement::NotificationType::AdlerNotification,
content,
args);
m_ppmHandler->parseSQFS(exSQFS, wsId);
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQFS.feuereinheit.verein, partyId, isVerbund);
if (part.id() > 0)
{
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQFS.feuereinheit);
return;
}
QTimer::singleShot(5000, this, [this, wsId, partyId, isVerbund, exSQFS]() {
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQFS.feuereinheit);
});
}
void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
@@ -525,17 +515,35 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
auto saa = getSAAByWs(wsId);
int partyId = saa->getPartyId();
const bool isVerbund = true;
QStringList args;
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQLP.einheit.verein, partyId, isVerbund);
DEBUG_LOG(m_logger) << "ParticipantId=" << part.id();
m_ppmHandler->parseSQLP(exSQLP, wsId);
if (part.id() > 0)
{
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQLP.einheit);
return;
}
QTimer::singleShot(5000, this, [this, wsId, partyId, exSQLP]() {
sendParticipantInfoNotification(wsId, partyId, isVerbund, exSQLP.einheit);
});
}
void JsonDispatcher::sendParticipantInfoNotification(const int wsId, const int partyId, const bool isVerbund, const Einheit &einheit)
{
DEBUG_LOG(m_logger) << "sendParticipantInfoNotification";
QStringList args;
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(einheit.verein, partyId, isVerbund);
DEBUG_LOG(m_logger) << "sendParticipantInfoNotification ParticipantId=" << part.id();
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
args.append(QString::number(part.id()));
args.append(ortsIdMap.key(exSQLP.einheit.oi));
args.append(QString::number(exSQLP.einheit.r));
args.append(exSQLP.einheit.verein);
args.append(ortsIdMap.key(einheit.oi));
args.append(QString::number(einheit.r));
args.append(einheit.verein);
createNotificationRequest(wsId,
QString::fromUtf8(tr_lts("Notification","Loading Point Position Report")),
@@ -543,9 +551,7 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
NotificationManagement::NotificationType::AdlerNotification,
content,
args);
DEBUG_LOG(m_logger) << "Stellungsmeldung Ladeplatz content=" << content;
m_ppmHandler->parseSQLP(exSQLP, wsId);
DEBUG_LOG(m_logger) << "Stellungsmeldung content=" << content;
}
void JsonDispatcher::onSAATrajectoryData(const int wsId, const Flugbahndaten &exFlugbahndaten, const QString referenceUuid)
@@ -572,7 +578,7 @@ void JsonDispatcher::onSAATrajectoryData(const int wsId, const Flugbahndaten &ex
TrajectoryIdentifier trajectoryIdentifier = m_trajectoryIdentifier.value(referenceUuidAlt);
m_trajectoryIdentifier.remove(referenceUuidAlt);
// Parse in party SAA
const Core::GeoPosition positionLaunch = m_positionsLaunch.value(referenceUuidAlt);
m_positionsLaunch.remove(referenceUuidAlt);
saa->parseFlugbahndaten(exFlugbahndaten, trajectoryIdentifier.aesItemId, trajectoryIdentifier.explosionId, positionLaunch);
@@ -645,7 +651,7 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer
const bool bRet = m_mainDispatcher->aesHandler()->getFtc()->effectClusterFireHaltRequest(req);
if (bRet && kategorie == ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_E && !feuerhaltdaten.entladenSchuss)
if (bRet && kategorie == ProjectDataManagement::L22_FireHaltCategory::E && !feuerhaltdaten.entladenSchuss) //we can send the EXVollzugsmeldung immediatly
{
Feuerkampfdaten fkd;
fkd.feuerkampfReferenz = feuerhaltdaten.feuerkampfReferenz;
@@ -721,12 +727,12 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
{
TRACE_LOG(m_logger) << "Text Message received: " << doc.toJson() << ", wsId: " << wsId;
}
// convert from json to internal representation, send to TAB
int errorcode = 0;
m_recvFromWebsocket->handleTelegram(wsId, telegram, errorcode);
// now that it's handled look at the error code and if it's EX_FLUGDATEN
// then return errorcode
TRACE_LOG(m_logger) << "errorcode = " << errorcode;
const int typeId = telegram[JsonKeys::TYPE_ID()].toInt();
@@ -754,7 +760,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
void JsonDispatcher::onTextMessageReceived(const QByteArray &message)
{
DEBUG_LOG(m_logger) << "Text Message received: " << message;
// convert from json to internal representation, send to TAB
m_recvFromWebsocket->handleTelegram(message);
}
@@ -831,14 +837,14 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
exFlugbahnberechnung.flugbahnberechnungDaten.sprenghoehe = static_cast<int>(request.explosionHeight());
exFlugbahnberechnung.flugbahnberechnungDaten.winkelgruppe = AdlerJson::Winkelgruppe(request.angleGroup().underlying());
//////////////////////////////////////////////////
/// Daten aus dem ESG-Simulator
if (request.properties().empty())
ERROR_LOG(m_logger) << "No properties available";
DEBUG_LOG(m_logger) << ", request.aesItemId() :" << request.aesItemId();
//////////////////////////////////////////////////
DEBUG_LOG(m_logger) << "UUID=" << exFlugbahnberechnung.uuid;
TrajectoryIdentifier trajectoryIdentifier;
@@ -857,14 +863,14 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int partyId)
{
// as the saaInterfaces are a vector, you can append multiple saa by the same name or ws id or party Id and it will always return the first one.
// so we add a cleanup function
DEBUG_LOG(m_logger) << "cleanup saa partyId: " << partyId << " name: " << saaName << " wsId " << wsId;
const auto copy = m_saaInterfaces;
for (const auto &saa : copy)
{
if ((partyId > 0 && saa.get()->getPartyId() == partyId) || (!saaName.isEmpty() && saa.get()->getSAAName() == saaName)
if ((partyId > 0 && saa.get()->getPartyId() == partyId) || (!saaName.isEmpty() && saa.get()->getSAAName() == saaName) // the name should be uniqe!
|| (wsId > 0 && saa.get()->getWsId() == wsId))
{
DEBUG_LOG(m_logger) << "Cleanup SAA " << saa->getSAAName() << " for Party: " << saa->getPartyId();
@@ -873,9 +879,9 @@ void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int
}
}
//-----------------------------------------------------------------------------
// Notifications:
//-----------------------------------------------------------------------------
void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
const QString &title,
@@ -885,7 +891,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
{
const qint64 currentTime = m_mainDispatcher->ddsHandler()->partitionTime();
// 100 seconds
const qint64 expiryTime = currentTime + 100 * 1000;
NotificationManagement::NomNotification notif;
@@ -897,14 +903,14 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
WARNING_LOG(m_logger) << "No valid SAA for wsId";
return;
}
//QString content = QStringLiteral("[Open Notification List ](//nomEditGuiPlugin/)") + QStringLiteral("<br />");
const int partyId = saa->getPartyId();
const ParticipantManagement::Party party = m_ppmHandler->getDtc()->party(partyId);
const QString partyStr = QString::fromStdString(party.name());
std::vector<std::string> args;
args.reserve(contentArgs.size());
for (const auto & str : std::as_const(contentArgs))
for (const auto & str : qAsConst(contentArgs))
args.emplace_back(str.toStdString());
notif.content(content.toStdString());
@@ -924,7 +930,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
std::vector<NotificationManagement::Address> recipientIdsDds;
recipientIdsDds.reserve(recipientIds.size());
for (const auto &recipientId : std::as_const(recipientIds))
for (const auto &recipientId : qAsConst(recipientIds))
{
NotificationManagement::Address addr;
addr.addressId(recipientId);
@@ -943,7 +949,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
notif.sender(addrSender);
data.notification(notif);
}
} // end of getCreateNotificationRequestData()
void JsonDispatcher::createNotificationRequest(const int wsId,
const QString &title,
@@ -977,7 +983,7 @@ void JsonDispatcher::createNotificationRequest(const int wsId,
}
}
//-----------------------------------------------------------------------------
void JsonDispatcher::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
{
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
@@ -992,6 +998,6 @@ void JsonDispatcher::onCreateNotificationReply(const Core::FunctionReplyObject &
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
}
}
} // end of onNotificationCreateReply()
}
} // namespace AdlerJson