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
+4
-3
@@ -38,13 +38,14 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
GmpMinefieldInterpreterTestsMain::GmpMinefieldInterpreterTestsMain() : m_minefieldInterpreter(nullptr)
|
||||
GmpMinefieldInterpreterTestsMain::GmpMinefieldInterpreterTestsMain()
|
||||
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||
, m_minefieldInterpreter(nullptr)
|
||||
, m_receivedMinefield()
|
||||
, m_receivedVeType(0)
|
||||
, m_minefieldInterpreterTimer(nullptr)
|
||||
, m_minefieldSpy(nullptr)
|
||||
.getNGLLogger("Tests.GmpMinefieldInterpreterTest")),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -13,14 +13,26 @@
|
||||
namespace GuezMinelayerProcessing
|
||||
{
|
||||
|
||||
#if BUILD_RTI
|
||||
DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: m_ddsConnector(ddsConnector)
|
||||
, m_logger(getNGLLogger("GuezMinelayerProcessing.DdsHandler"))
|
||||
, m_topicLockMaster(std::make_shared<Core::TopicLockMaster>())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
#else
|
||||
DdsHandler::DdsHandler()
|
||||
: m_logger(getNGLLogger("GuezMinelayerProcessing.DdsHandler"))
|
||||
, m_topicLockMaster(std::make_shared<Core::TopicLockMaster>())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler() - RTI DDS not enabled";
|
||||
}
|
||||
#endif
|
||||
|
||||
bool DdsHandler::init(const QStringList &qosFileList)
|
||||
{
|
||||
#if BUILD_RTI
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
@@ -29,6 +41,10 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
// default initialize Publisher and Subscriber
|
||||
m_ddsConnector->initPublisherSubscriber();
|
||||
#else
|
||||
Q_UNUSED(qosFileList)
|
||||
DEBUG_LOG(m_logger) << "DdsHandler::init() - RTI DDS not enabled, skipping initialization";
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,10 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#include <DDS/Core/topic_lock_master.h>
|
||||
#endif
|
||||
#include "logger.h"
|
||||
|
||||
namespace GuezMinelayerProcessing
|
||||
@@ -16,17 +18,25 @@ namespace GuezMinelayerProcessing
|
||||
class DdsHandler final
|
||||
{
|
||||
public:
|
||||
#if BUILD_RTI
|
||||
explicit DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector);
|
||||
#else
|
||||
explicit DdsHandler();
|
||||
#endif
|
||||
~DdsHandler() = default;
|
||||
|
||||
bool init(const QStringList &qosFileList = QStringList());
|
||||
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
#endif
|
||||
std::shared_ptr<Core::TopicLockMaster> topicLockMaster() const { return m_topicLockMaster; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
#endif
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
};
|
||||
|
||||
|
||||
+21
-3
@@ -9,7 +9,9 @@
|
||||
|
||||
#include "handler_minelayer_data.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#endif
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
|
||||
@@ -18,6 +20,8 @@
|
||||
|
||||
#include <QLineF>
|
||||
|
||||
#if BUILD_RTI
|
||||
|
||||
namespace GuezMinelayerProcessing
|
||||
{
|
||||
|
||||
@@ -27,7 +31,9 @@ HandlerMinelayerData::HandlerMinelayerData(const std::shared_ptr<DdsHandler> &dd
|
||||
, m_ddsHandler(ddsHandler)
|
||||
, m_tabDtc(nullptr)
|
||||
, m_ppmDtc(nullptr)
|
||||
#if BUILD_RTI
|
||||
, m_aesFtc(nullptr)
|
||||
#endif
|
||||
, m_minefieldInterpreter(new ZSSI_WI_Minenfeld_Interpreter(this))
|
||||
, m_minefieldInterpreterTimer(new QTimer(this))
|
||||
{}
|
||||
@@ -37,19 +43,24 @@ HandlerMinelayerData::~HandlerMinelayerData()
|
||||
|
||||
bool HandlerMinelayerData::init()
|
||||
{
|
||||
#if BUILD_RTI
|
||||
// AES-Ftc
|
||||
m_aesFtc = AreaEffectSimulation::Interface::Ftc::create(m_ddsHandler->ddsConnector());
|
||||
bool ret = m_aesFtc->enableMineAreaModifyFromCtaData();
|
||||
if (!ret)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "AesFtc Can not enable MineAreaCreateFromCtaData()";
|
||||
ERROR_LOG(m_logger) << "AesFtc Can not enable MineAreaModifyFromCtaData()";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Data from training area base
|
||||
m_tabDtc = TrainingAreaBase::Interface::Dtc::create(m_ddsHandler->ddsConnector());
|
||||
bool ret = true;
|
||||
#if BUILD_RTI
|
||||
ret &= m_tabDtc->enableSpecialSensorData();
|
||||
#endif
|
||||
ret &= m_tabDtc->enableMinelayerTrailerData();
|
||||
ret &= m_tabDtc->enableMinelayerThrowerData();
|
||||
if (!ret)
|
||||
@@ -58,13 +69,17 @@ bool HandlerMinelayerData::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
#if BUILD_RTI
|
||||
connect(m_tabDtc.get(), &TrainingAreaBase::Interface::Dtc::specialSensorDataChanged, this, &HandlerMinelayerData::onSpecialSensorDataChanged);
|
||||
#endif
|
||||
connect(m_tabDtc.get(), &TrainingAreaBase::Interface::Dtc::minelayerTrailerDataChanged, this, &HandlerMinelayerData::onMinelayerTrailerData);
|
||||
connect(m_tabDtc.get(), &TrainingAreaBase::Interface::Dtc::minelayerThrowerDataChanged, this, &HandlerMinelayerData::onMinelayerThrowerData);
|
||||
|
||||
// PPM for partyId Mapping
|
||||
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
|
||||
#if BUILD_RTI
|
||||
ret &= m_ppmDtc->enableParticipant();
|
||||
#endif
|
||||
if (!ret)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "PpmDtc Can not enable Participant Data";
|
||||
@@ -290,6 +305,7 @@ static inline double compassFromMathAngleForSfm(int mathAngle)
|
||||
|
||||
void HandlerMinelayerData::onSendMinefield(const wirkfeld_minensperre_rt &minefield, int fzArt)
|
||||
{
|
||||
#if BUILD_RTI
|
||||
AreaEffectSimulation::MineArea outData;
|
||||
outData.participantId(minefield.header.identitaet);
|
||||
outData.partyId(partyIdFromEquipmentNumber(minefield.header.identitaet)); // Get from PPM;
|
||||
@@ -332,7 +348,7 @@ void HandlerMinelayerData::onSendMinefield(const wirkfeld_minensperre_rt &minefi
|
||||
|
||||
// request create mine area from aes
|
||||
m_aesFtc->mineAreaModifyFromCtaDataRequest(outData, this);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void HandlerMinelayerData::onStartMinefieldInterpreter()
|
||||
@@ -349,4 +365,6 @@ void HandlerMinelayerData::onMineAreaModifyFromCtaDataReply(const Core::Function
|
||||
INFO_LOG(m_logger) << "Got onMineAreaCreateFromCtaDataReply reply with id " << replyObject.id();
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace GuezMinelayerProcessing
|
||||
|
||||
#endif // BUILD_RTI
|
||||
+9
-1
@@ -12,10 +12,12 @@
|
||||
#include <QPointF>
|
||||
#include <QTimer>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <Proxies/TrainingAreaBase/tab_dtc.h>
|
||||
#endif
|
||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <Proxies/TrainingAreaBase/tab_dtc.h>
|
||||
#include "GFS_map_cont.h"
|
||||
|
||||
#include "logger.h"
|
||||
@@ -25,7 +27,9 @@ namespace GuezMinelayerProcessing
|
||||
class DdsHandler;
|
||||
class ZSSI_WI_Minenfeld_Interpreter;
|
||||
class HandlerMinelayerData : public QObject
|
||||
#if BUILD_RTI
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyFromCtaDataReplyHandler
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -35,7 +39,9 @@ public:
|
||||
|
||||
bool init();
|
||||
|
||||
#if BUILD_RTI
|
||||
void onMineAreaModifyFromCtaDataReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
#endif
|
||||
|
||||
private slots:
|
||||
void onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, DataModification modType);
|
||||
@@ -55,7 +61,9 @@ private:
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_tabDtc;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_aesFtc;
|
||||
#endif
|
||||
|
||||
LtsCoordTrans::UtmCoordinate m_baseCoord;
|
||||
|
||||
|
||||
+22
-1
@@ -9,23 +9,34 @@
|
||||
#include "dds_handler.h"
|
||||
#include "handler_minelayer_data.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#endif
|
||||
|
||||
using namespace GuezMinelayerProcessing;
|
||||
|
||||
Initialization::Initialization()
|
||||
: m_ddsHandler(nullptr)
|
||||
#if BUILD_RTI
|
||||
, m_handlerMinelayerData(nullptr)
|
||||
#endif
|
||||
{}
|
||||
|
||||
Initialization::~Initialization()
|
||||
{
|
||||
#if BUILD_RTI
|
||||
m_handlerMinelayerData = nullptr;
|
||||
#endif
|
||||
m_ddsHandler = nullptr;
|
||||
}
|
||||
|
||||
bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
bool Initialization::initialize(
|
||||
#if BUILD_RTI
|
||||
const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#if BUILD_RTI
|
||||
if (m_handlerMinelayerData)
|
||||
return true;
|
||||
|
||||
@@ -44,6 +55,16 @@ bool Initialization::initialize(const std::shared_ptr<DDSConnector::DdsConnector
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerMinelayerData failed.";
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(ddsConnector)
|
||||
// initialize DDS stub
|
||||
m_ddsHandler.reset(new DdsHandler());
|
||||
if (!m_ddsHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation ddsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+11
-1
@@ -6,7 +6,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <DDS/DDSConnector/dds_connector.h>
|
||||
#endif
|
||||
#include <ngldb/db_service_handler.h>
|
||||
#include "svcgmpserver_export.h"
|
||||
#include "logger.h"
|
||||
@@ -14,7 +16,9 @@
|
||||
namespace GuezMinelayerProcessing
|
||||
{
|
||||
class DdsHandler;
|
||||
#if BUILD_RTI
|
||||
class HandlerMinelayerData;
|
||||
#endif
|
||||
|
||||
class GMP_SERVER_EXPORT Initialization final
|
||||
{
|
||||
@@ -22,12 +26,18 @@ public:
|
||||
Initialization();
|
||||
~Initialization();
|
||||
|
||||
bool initialize(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector);
|
||||
bool initialize(
|
||||
#if BUILD_RTI
|
||||
const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector
|
||||
#endif
|
||||
);
|
||||
bool loadFromDatabase();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<HandlerMinelayerData> m_handlerMinelayerData;
|
||||
#endif
|
||||
};
|
||||
} // namespace GuezMinelayerProcessing
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include "svcgmpserver_export.h"
|
||||
#include "gmp_export.h"
|
||||
|
||||
namespace GuezMinelayerProcessing
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include <QString>
|
||||
#include "svcgmpserver_export.h"
|
||||
#include "gmp_export.h"
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user