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
+63
-54
@@ -1,24 +1,29 @@
|
||||
|
||||
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Data Plugin for SituationReplayManagement
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-07-19
|
||||
*/
|
||||
|
||||
#include "srm_data_plugin.h"
|
||||
#include <utility>
|
||||
|
||||
#include <Core/core_dtc.h>
|
||||
#include <DDS/Core/core_dtc.h>
|
||||
#include <SituationReplayManagement/srm_ftc.h>
|
||||
#include <LtsSession/lts_session_data_dds.h>
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <DDS/QosProfile/DDS_DefaultQos.h>
|
||||
#include <Core/core_dts_types.h>
|
||||
#include <DDS/Core/core_dts_types.h>
|
||||
#include <DDS/DTS/generic_dts_impl.h>
|
||||
#include <SituationReplayManagement/logger.h>
|
||||
#include <LtsUtils/LtsUtilsCore/await.h>
|
||||
#include <LtsUtilsCore/await.h>
|
||||
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QTimer>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QPointer>
|
||||
#include <QProcess>
|
||||
#include <QTimer>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
namespace SituationReplayManagement
|
||||
@@ -44,14 +49,14 @@ public:
|
||||
|
||||
void addSession(ForeignInterfaceImpl *fi, int partitionId)
|
||||
{
|
||||
|
||||
// next 4 lines: comment please
|
||||
m_references += fi;
|
||||
for (const auto &info : std::as_const(m_replayPartitions))
|
||||
for (const auto &info : qAsConst(m_replayPartitions))
|
||||
{
|
||||
fi->write(info);
|
||||
}
|
||||
|
||||
|
||||
// take ownership of 'own' replays
|
||||
for (auto it = m_replayPartitions.begin(); it != m_replayPartitions.end(); ++it)
|
||||
{
|
||||
ReplayPartitionEx &rp = it.value();
|
||||
@@ -67,7 +72,7 @@ public:
|
||||
void removeSession(ForeignInterfaceImpl *fi, bool wait = true) noexcept(false)
|
||||
{
|
||||
m_references -= fi;
|
||||
for (const auto &info : std::as_const(m_replayPartitions))
|
||||
for (const auto &info : qAsConst(m_replayPartitions))
|
||||
fi->remove(info);
|
||||
|
||||
replayPartitionRemoveRequest(fi, 0, 0, 0, wait);
|
||||
@@ -78,11 +83,11 @@ public:
|
||||
int exerciseId, int workstationId, int operatorId, Core::ReplayType replayType, bool wait = true) noexcept(false)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
// clarification need for: domainId, partitionId, replayId, idToUse... : same or different?
|
||||
// 'idToUse will become replayPartitionId'
|
||||
// assume: replayId == partitionId == replayPartitionId == idToUse
|
||||
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " START"
|
||||
<< ", domainId = " << domainId
|
||||
<< ", domainIdReplay = " << domainIdReplay
|
||||
<< ", tcpConnectionUrl = " << tcpConnectionUrl.toDisplayString()
|
||||
@@ -92,13 +97,13 @@ public:
|
||||
<< ", replayType = " << replayType
|
||||
<< ", wait = " << wait;
|
||||
|
||||
|
||||
// find free replay id
|
||||
QSet<int> keys;
|
||||
for (auto it = m_replayPartitions.constBegin(); it != m_replayPartitions.constEnd(); ++it)
|
||||
keys += it.key();
|
||||
|
||||
int idToUse = -1;
|
||||
for (int i = 1; i < 20; ++i)
|
||||
for (int i = 1; i < 20; ++i) // why 20??
|
||||
{
|
||||
if (keys.contains(i))
|
||||
continue;
|
||||
@@ -107,10 +112,10 @@ public:
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " idToUse = " << idToUse;
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " idToUse = " << idToUse;
|
||||
|
||||
|
||||
|
||||
// found a valid one
|
||||
if (idToUse > 0)
|
||||
{
|
||||
ReplayPartitionEx repl;
|
||||
@@ -158,14 +163,14 @@ public:
|
||||
|
||||
m_replayPartitions.insert(idToUse, repl);
|
||||
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " repl.proc->start()...";
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " repl.proc->start()...";
|
||||
repl.proc->start();
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " repl.proc->start()...DONE";
|
||||
DEBUG_LOG(m_logger) << LOGFUNCTION << " repl.proc->start()...DONE";
|
||||
|
||||
if (wait)
|
||||
{
|
||||
|
||||
|
||||
//#define APPROACH_AWAIT_BY_MIKE
|
||||
#ifdef APPROACH_AWAIT_BY_MIKE
|
||||
try
|
||||
{
|
||||
@@ -183,12 +188,12 @@ public:
|
||||
&QProcess::started,
|
||||
repl.proc,
|
||||
QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
|
||||
60 * 1000);
|
||||
60 * 1000); // 1 min
|
||||
NOTICE_LOG(m_logger) << " LtsUtils::awaitWithCancelationSignal ... DONE";
|
||||
|
||||
processStarted(proc, idToUse);
|
||||
DEBUG_LOG(m_logger) << "Replay started: " << idToUse;
|
||||
return idToUse;
|
||||
return idToUse; // <-- return
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
@@ -198,30 +203,30 @@ public:
|
||||
catch (...)
|
||||
{
|
||||
fprintf(stderr, "awaitWithCancelationSignal has thrown an error ...\n");
|
||||
}
|
||||
} // catch
|
||||
|
||||
#else
|
||||
|
||||
#else // APPROACH_AWAIT_BY_MIKE
|
||||
// rebuild by former version... hopefully it works:
|
||||
|
||||
const bool bIsStartedSuccessfully = repl.proc->waitForStarted(7500);
|
||||
const bool bIsStartedSuccessfully = repl.proc->waitForStarted(7500); // Qt docu: Returns true if the process was started successfully;
|
||||
if (bIsStartedSuccessfully)
|
||||
{
|
||||
processStarted(proc, idToUse);
|
||||
DEBUG_LOG(m_logger) << "Replay started: " << idToUse;
|
||||
return idToUse;
|
||||
return idToUse; // <-- return
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// cleanup:
|
||||
idToUse = -1;
|
||||
wait = false;
|
||||
if (repl.proc)
|
||||
repl.proc->deleteLater();
|
||||
|
||||
|
||||
m_replayPartitions[idToUse].proc = nullptr;
|
||||
repl.proc->deleteLater(); // repl.proc is a QPointer
|
||||
// repl.proc = nullptr; // repl.proc is a QPointer
|
||||
// useless with idToUse == -1 !!??!!
|
||||
m_replayPartitions[idToUse].proc = nullptr; // TODO: don't use operator[] !
|
||||
}
|
||||
#endif
|
||||
#endif // APPROACH_AWAIT_BY_MIKE
|
||||
|
||||
|
||||
}
|
||||
@@ -230,9 +235,9 @@ public:
|
||||
connect(repl.proc, &QProcess::started,
|
||||
this, [this, proc, idToUse]() { processStarted(proc, idToUse); } );
|
||||
}
|
||||
}
|
||||
} // if (idToUse > 0)
|
||||
|
||||
|
||||
// didn't find a valid one!
|
||||
|
||||
if (wait)
|
||||
{
|
||||
@@ -257,7 +262,7 @@ public:
|
||||
}
|
||||
|
||||
const auto &rp = it.value();
|
||||
for (auto ptr : std::as_const(m_references))
|
||||
for (auto ptr : qAsConst(m_references))
|
||||
ptr->remove(rp);
|
||||
|
||||
proc->deleteLater();
|
||||
@@ -276,7 +281,7 @@ public:
|
||||
}
|
||||
|
||||
const ReplayPartitionEx &rp = it.value();
|
||||
for (ForeignInterfaceImpl* ptr : std::as_const(m_references))
|
||||
for (ForeignInterfaceImpl* ptr : qAsConst(m_references))
|
||||
ptr->write(rp);
|
||||
}
|
||||
|
||||
@@ -341,21 +346,21 @@ public:
|
||||
cb();
|
||||
}
|
||||
}
|
||||
else
|
||||
else // dont wait
|
||||
{
|
||||
QTimer::singleShot(10000, rp.proc, cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (auto *ptr : std::as_const(m_references))
|
||||
for (auto *ptr : qAsConst(m_references))
|
||||
ptr->remove(rp);
|
||||
|
||||
it = m_replayPartitions.erase(it);
|
||||
bFoundOne = true;
|
||||
}
|
||||
|
||||
|
||||
// workstationId / operatorId are wildcard operations which may find nothing which is ok
|
||||
if (partitionId == 0)
|
||||
bFoundOne = true;
|
||||
|
||||
@@ -377,7 +382,7 @@ public:
|
||||
return sessionConnector;
|
||||
}
|
||||
|
||||
int domainId = 1;
|
||||
int domainId = 1; // ok since we are using ShmUdpLocalhost
|
||||
m_ddsConnector.reset(new DDSConnector::DdsConnector(domainId,
|
||||
IDL::PartitionType::Exercise,
|
||||
sessionConnector->getPartitionId(),
|
||||
@@ -410,15 +415,17 @@ public:
|
||||
private:
|
||||
struct ReplayPartitionEx : public Core::ReplayPartition
|
||||
{
|
||||
QPointer<QProcess> proc;
|
||||
QPointer<QProcess> proc; // = nullptr;
|
||||
ForeignInterfaceImpl *fi = nullptr;
|
||||
};
|
||||
|
||||
QMap<int, ReplayPartitionEx> m_replayPartitions;
|
||||
QMap<int, ReplayPartitionEx> m_replayPartitions; // idToUse - ReplayPartitionEx
|
||||
QSet<ForeignInterfaceImpl*> m_references;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<DTS::ReplayPartition> m_replayPartion;
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
|
||||
@@ -448,6 +455,7 @@ ForeignInterfaceImpl::ForeignInterfaceImpl(const std::shared_ptr<ReplayHandler>
|
||||
LtsSession::LtsSessionDataDds *session)
|
||||
: m_replayHandler(replayHandler)
|
||||
, m_session(session)
|
||||
, m_logger(getLogger("ForeignInterfaceImpl"))
|
||||
{
|
||||
if (m_session->partitionType() == IDL::PartitionType::Exercise ||
|
||||
m_session->partitionType() == IDL::PartitionType::Replay)
|
||||
@@ -456,7 +464,7 @@ ForeignInterfaceImpl::ForeignInterfaceImpl(const std::shared_ptr<ReplayHandler>
|
||||
|
||||
ForeignInterfaceImpl::~ForeignInterfaceImpl()
|
||||
{
|
||||
m_replayHandler->removeSession(this, false );
|
||||
m_replayHandler->removeSession(this, false /* dont' wait for replay service to quit */);
|
||||
}
|
||||
|
||||
void ForeignInterfaceImpl::removeReplayPartitionsWorkstation(const int workstationId) noexcept(false)
|
||||
@@ -496,14 +504,15 @@ int ForeignInterfaceImpl::replayPartitionCreateRequest(int exerciseId, int works
|
||||
int domainId = m_session->domainId();
|
||||
if (m_session->isReplayPartition())
|
||||
{
|
||||
|
||||
|
||||
/* starting a replay partition from a replay partition would normally inc the
|
||||
* domainId to the already inc'd domainId - dec the already inc'd domain id
|
||||
* to keep the same domainId for every replay partition */
|
||||
if (domainId == 1)
|
||||
domainId= 199;
|
||||
else
|
||||
domainId--;
|
||||
}
|
||||
int domainIdReplay = (domainId % 200) + 1;
|
||||
int domainIdReplay = (domainId % 200) + 1; // mod aka "if (domainId > 200) domainId = 0;" - domainIds can never be > 199
|
||||
|
||||
|
||||
return m_replayHandler->replayPartitionCreateRequest(domainId, domainIdReplay,
|
||||
@@ -525,6 +534,6 @@ void ForeignInterfaceImpl::remove(const Core::ReplayPartition &repl)
|
||||
m_replayHandler->dtsReplay(m_session->ddsConnector())->remove(repl);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace SituationReplayManagement
|
||||
|
||||
#include "srm_data_plugin.moc"
|
||||
Reference in new issue
Block a user