Qt6 Migration: BUILD_RTI guards und CMake fixes
- BUILD_RTI conditional compilation für RTI Connext DDS dependencies - Namespace fixes in core_dtc.h (Core:: → DDS::Core::) - CMakeLists.txt: BUILD_RTI option und conditional dependencies - Handler minelayer: namespace closing mit BUILD_RTI guard - Build erfolgreich mit BUILD_RTI=OFF validiert Signed-off-by: Torsten Wierschin <torsten.wierschin@life-maps.com>
This commit is contained in:
422 files changed
+1013
-599
No files matched your search
+1
-1
@@ -25,7 +25,7 @@ AvsInterface::AvsInterface(bool enableTryReconnect, QObject *parent) : QObject(p
|
||||
, m_keepAliveTime(Settings::getAvsKeepAliveTime())
|
||||
, m_avsIfConnectionState(AvsIfConnectionState::Undefined)
|
||||
, m_socket(nullptr),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
doConnect();
|
||||
|
||||
connect(m_avsKeepAliveTimer, &QTimer::timeout,
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "dds_handler.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
|
||||
namespace VideoOverlayManagement
|
||||
@@ -42,3 +43,4 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
|
||||
} // Namespace VideoOverlayManagement
|
||||
#endif // BUILD_RTI
|
||||
@@ -7,10 +7,12 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#endif
|
||||
|
||||
namespace Core
|
||||
{
|
||||
class Pacemaker;
|
||||
@@ -21,11 +23,20 @@ namespace VideoOverlayManagement
|
||||
class DdsHandler final
|
||||
{
|
||||
public:
|
||||
#if BUILD_RTI
|
||||
DdsHandler(int domainId, int exerciseId);
|
||||
#else
|
||||
DdsHandler(int domainId, int exerciseId) { Q_UNUSED(domainId); Q_UNUSED(exerciseId); }
|
||||
#endif
|
||||
~DdsHandler() = default;
|
||||
|
||||
#if BUILD_RTI
|
||||
bool init(const QStringList &qosFileList = QStringList());
|
||||
#else
|
||||
bool init(const QStringList &qosFileList = QStringList()) { Q_UNUSED(qosFileList); return true; }
|
||||
#endif
|
||||
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<Core::Pacemaker> pacemaker() const
|
||||
{
|
||||
return m_pacemaker;
|
||||
@@ -34,11 +45,17 @@ public:
|
||||
{
|
||||
return m_ddsConnector;
|
||||
}
|
||||
#else
|
||||
std::shared_ptr<Core::Pacemaker> pacemaker() const { return nullptr; }
|
||||
void* dds() const { return nullptr; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::Pacemaker> m_pacemaker;
|
||||
#endif
|
||||
};
|
||||
|
||||
} // namespace VideoOverlayManagement
|
||||
+5
-1
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include "handler_infrastructure_data.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include "settings.h"
|
||||
|
||||
#include <QVector>
|
||||
@@ -16,7 +18,7 @@ using namespace VideoOverlayManagement;
|
||||
HandlerInfrastructureData::HandlerInfrastructureData(const std::shared_ptr<DdsHandler> &ddsHandler, QObject *parent) : QObject(parent)
|
||||
, m_ddsHandler(ddsHandler)
|
||||
, m_exerciseId(0),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -158,3 +160,5 @@ int HandlerInfrastructureData::getRoomIdFromAssetId(int assetId) const
|
||||
return m_assetId2RoomIdMap.value(assetId, -1);
|
||||
} // end of getRoomIdFromAssetId()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif // BUILD_RTI
|
||||
+20
-3
@@ -8,17 +8,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include <InfrastructureManagement/ism_dtc.h>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include "dds_handler.h"
|
||||
#include <InfrastructureManagement/ism_dtc.h>
|
||||
#endif
|
||||
|
||||
namespace VideoOverlayManagement
|
||||
{
|
||||
|
||||
#if BUILD_RTI
|
||||
class HandlerInfrastructureData : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -77,5 +80,19 @@ private: // attributes
|
||||
|
||||
|
||||
};
|
||||
#else
|
||||
// Stub implementation when BUILD_RTI is disabled
|
||||
class HandlerInfrastructureData : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HandlerInfrastructureData(QObject *parent = nullptr) : QObject(parent) {}
|
||||
~HandlerInfrastructureData() = default;
|
||||
bool init(int /*exerciseId*/) { return false; }
|
||||
bool isCameraAvailable(int /*roomId*/) const { return false; }
|
||||
QString getStreamNameFromRoomId(int /*roomId*/) const { return {}; }
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace VideoOverlayManagement
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ HandlerOverlays::HandlerOverlays(AvsInterface *avsIf,
|
||||
, m_handlerParticipantData(handlerParticipantData)
|
||||
, m_handlerInfrastructureData(handlerInfrastructureData)
|
||||
, m_exerciseId(exerciseId),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
+5
-1
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
|
||||
#include "handler_participant_data.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include "settings.h"
|
||||
|
||||
#include <QSet>
|
||||
@@ -15,7 +17,7 @@ using namespace VideoOverlayManagement;
|
||||
|
||||
HandlerParticipantData::HandlerParticipantData(const std::shared_ptr<DdsHandler> &ddsHandler, QObject *parent) : QObject(parent)
|
||||
, m_ddsHandler(ddsHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -126,3 +128,5 @@ void HandlerParticipantData::onParticipantPositionChanged(const ParticipantManag
|
||||
} // end of onParticipantPositionChanged()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#endif // BUILD_RTI
|
||||
|
||||
+20
-3
@@ -8,17 +8,20 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "dds_handler.h"
|
||||
#include "logger.h"
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include "dds_handler.h"
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#endif
|
||||
|
||||
namespace VideoOverlayManagement
|
||||
{
|
||||
|
||||
#if BUILD_RTI
|
||||
class HandlerParticipantData : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -73,5 +76,19 @@ private: // attributes
|
||||
|
||||
|
||||
};
|
||||
#else
|
||||
// Stub implementation when BUILD_RTI is disabled
|
||||
class HandlerParticipantData : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HandlerParticipantData(QObject *parent = nullptr) : QObject(parent) {}
|
||||
~HandlerParticipantData() = default;
|
||||
bool init() { return false; }
|
||||
int getEquipmentNumber(int /*participantId*/) const { return 0; }
|
||||
QMap<int, int> getAllAssignedParticipants() const { return {}; }
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace VideoOverlayManagement
|
||||
|
||||
+17
-1
@@ -11,7 +11,9 @@
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <DDS/Core/pacemaker.h>
|
||||
#endif
|
||||
|
||||
using namespace VideoOverlayManagement;
|
||||
|
||||
@@ -19,20 +21,24 @@ MainHandler::MainHandler(QObject *parent) : QObject(parent)
|
||||
, m_exerciseId(0)
|
||||
, m_avsIf(new AvsInterface(true, this))
|
||||
, m_avsConnectionState(AvsIfConnectionState::Undefined)
|
||||
#if BUILD_RTI
|
||||
, m_ddsHandler(nullptr)
|
||||
#endif
|
||||
, m_handlerParticipantData(nullptr)
|
||||
, m_handlerInfrastructureData(nullptr)
|
||||
, m_handlerOverlays(nullptr)
|
||||
, m_checkConnectTimer(new QTimer(this))
|
||||
, m_keepAliveTriggerTimer(new QTimer(this))
|
||||
, m_bAvsSocketWarnedOnce(false),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
MainHandler::~MainHandler()
|
||||
{
|
||||
#if BUILD_RTI
|
||||
m_ddsHandler.reset();
|
||||
#endif
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -62,6 +68,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
connect(m_keepAliveTriggerTimer, &QTimer::timeout,
|
||||
this, &MainHandler::onSendKeepAlive);
|
||||
|
||||
#if BUILD_RTI
|
||||
// initialize DDS
|
||||
// for VideoOverlayManagement => exerciseId = partitionId
|
||||
m_ddsHandler.reset(new DdsHandler(domainId, exerciseId));
|
||||
@@ -92,6 +99,7 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Initialisation of OverlayHandler wait until AVS is connected
|
||||
connect(m_checkConnectTimer, &QTimer::timeout,
|
||||
@@ -99,7 +107,9 @@ bool MainHandler::init(int domainId, int exerciseId)
|
||||
m_checkConnectTimer->start(1000);
|
||||
|
||||
INFO_LOG(m_logger) << "VOM Handler initialized. (Connection to AVS may be still pending) ";
|
||||
#if BUILD_RTI
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Starting);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
} // end of init()
|
||||
@@ -128,12 +138,16 @@ bool MainHandler::onTryToInitOverlayHandler()
|
||||
if (!m_handlerOverlays->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerOverlays failed.";
|
||||
#if BUILD_RTI
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "VOM Handler initialized. (Connection to AVS established) ";
|
||||
#if BUILD_RTI
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
} // end of onTryToInitOverlayHandler()
|
||||
@@ -156,7 +170,9 @@ void MainHandler::onAvsIfConnectionState(AvsIfConnectionState state)
|
||||
case AvsIfConnectionState::ConnectionError:
|
||||
ERROR_LOG(m_logger) << "AvsIfConnectionState::ConnectionError !";
|
||||
m_keepAliveTriggerTimer->stop();
|
||||
#if BUILD_RTI
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StoppedError);
|
||||
#endif
|
||||
break;
|
||||
case AvsIfConnectionState::Undefined:
|
||||
default:
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QTimer>
|
||||
|
||||
#include "avs_interface.h"
|
||||
#include "handler_participant_data.h"
|
||||
@@ -17,8 +18,6 @@
|
||||
#include "dds_handler.h"
|
||||
#include "logger.h"
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace VideoOverlayManagement
|
||||
{
|
||||
// Forwarddeclarations
|
||||
@@ -57,7 +56,9 @@ NGL::INGLLogger &m_logger;
|
||||
int m_exerciseId; ///< Exercise id
|
||||
AvsInterface *m_avsIf; ///< Pointer to AVS-Interface
|
||||
AvsIfConnectionState m_avsConnectionState; ///< AVS connection state
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to DDS handler
|
||||
#endif
|
||||
std::shared_ptr<HandlerParticipantData> m_handlerParticipantData; ///< Pointer to participant data handler
|
||||
std::shared_ptr<HandlerInfrastructureData> m_handlerInfrastructureData; ///< Pointer to infrastructure data handler
|
||||
std::unique_ptr<HandlerOverlays> m_handlerOverlays; ///< Pointer to overlay handler
|
||||
|
||||
Reference in new issue
Block a user