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>
104 lines
3.0 KiB
C++
104 lines
3.0 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* DataTopic Unit test for DDS
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hanna E. Rathje, SLSE, 2015-07-24
|
|
*/
|
|
#include "initialisation.h"
|
|
|
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
|
|
|
#include <DDS/QosProfile/DDS_DefaultQos.h>
|
|
#include <Common/ProjectConfig/project_defines.h>
|
|
|
|
|
|
Initialisation::Initialisation()
|
|
: m_domainParticipant(nullptr)
|
|
, m_domainParticipantSub(nullptr)
|
|
, m_domainId(0)
|
|
, m_exerciseId(-1)
|
|
, m_ddsPublisher(nullptr)
|
|
, m_ddsSubscriber(nullptr)
|
|
, m_subListener(new DDSGeneric::SubscriberListener)
|
|
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("UnitTests.Initialisation"))
|
|
{
|
|
if (!DDS::QosProfile::setDefault())
|
|
ERROR_LOG(m_logger) << "Error setting default QoS from xml-file ";
|
|
|
|
}
|
|
|
|
Initialisation::~Initialisation()
|
|
{
|
|
cleanupSubscriberListener();
|
|
m_ddsSubscriber = nullptr;
|
|
m_ddsPublisher = nullptr;
|
|
}
|
|
|
|
void Initialisation::cleanupSubscriberListener()
|
|
{
|
|
if (m_ddsSubscriber != nullptr && m_subListener != nullptr)
|
|
{
|
|
m_ddsSubscriber.listener(nullptr, dds::core::status::StatusMask::none());
|
|
delete m_subListener;
|
|
m_subListener = nullptr;
|
|
}
|
|
}
|
|
|
|
|
|
bool Initialisation::initDDS(int domainId, int exerciseId, PubSub pubsub)
|
|
{
|
|
if (m_domainParticipant == nullptr)
|
|
m_domainParticipant = dds::domain::DomainParticipant(domainId, DDS::QosProfile::domainParticipantShm());
|
|
|
|
// SpatialData will be published to Partition $partitionId
|
|
|
|
if (pubsub == USE_PUBLISHER || pubsub == USE_PUB_SUB)
|
|
{
|
|
dds::pub::qos::PublisherQos publisherQos = m_domainParticipant.default_publisher_qos();
|
|
|
|
DEBUG_LOG(m_logger) << "Publish on partition " << IDL::exercisePartition(exerciseId);
|
|
|
|
// use only selected partition
|
|
dds::core::policy::Partition partitionQos;
|
|
partitionQos.name( { IDL::exercisePartition(exerciseId) } );
|
|
publisherQos << partitionQos;
|
|
|
|
m_ddsPublisher = dds::pub::Publisher(m_domainParticipant,
|
|
publisherQos);
|
|
}
|
|
|
|
if (pubsub == USE_SUBSCRIBER || pubsub == USE_PUB_SUB)
|
|
{
|
|
dds::domain::DomainParticipant domainPart = m_domainParticipant;
|
|
if ( domainPart == nullptr || m_domainParticipantSub == nullptr)
|
|
{
|
|
m_domainParticipantSub = dds::domain::DomainParticipant(domainId, DDS::QosProfile::domainParticipantShm());
|
|
domainPart = m_domainParticipantSub;
|
|
}
|
|
|
|
dds::sub::qos::SubscriberQos subscriberQos = domainPart.default_subscriber_qos();
|
|
|
|
DEBUG_LOG(m_logger) << "Subsribing on partition " << IDL::exercisePartition(exerciseId);
|
|
|
|
// use only selected partition
|
|
dds::core::policy::Partition partitionQos;
|
|
partitionQos.name( { IDL::exercisePartition(exerciseId) } );
|
|
subscriberQos << partitionQos;
|
|
|
|
m_ddsSubscriber = dds::sub::Subscriber(domainPart,
|
|
subscriberQos,
|
|
m_subListener,
|
|
m_subListener->mask());
|
|
}
|
|
|
|
if (m_domainId == 0)
|
|
m_domainId = domainId;
|
|
|
|
if (m_exerciseId < 0)
|
|
m_exerciseId = exerciseId;
|
|
|
|
return true;
|
|
}
|