BUILD_RTI guards: svcTabCommon export header + GuezMinelayerProcessing stubs
- TrainingAreaBase/CMakeLists.txt: Wrap RTIDDSGEN with BUILD_RTI, add fallback target - GuezMinelayerProcessing: BUILD_RTI guards for HandlerMinelayerData + stubs - ddsfts/CMakeLists.txt: Fix INTERFACE→PUBLIC, add svcTabCommon dependency - Add stub headers for BUILD_RTI=OFF compilation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
8 files changed
+109
-39
No files matched your search
@@ -28,17 +28,18 @@ SET(SRCS
|
||||
)
|
||||
|
||||
NGL_ADD_LIBRARY2(WS AAR SV HLA ddsfts SHARED ${SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(
|
||||
INTERFACE
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(ddsfts
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../../Proxies/TrainingAreaBase
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(ddsfts
|
||||
PRIVATE
|
||||
RTI::nddscore
|
||||
ProjectConfig
|
||||
ddsQoS
|
||||
svcTabCommon
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
RTI::nddsc
|
||||
@@ -46,12 +47,12 @@ NGL_TARGET_LINK_LIBRARIES(ddsfts
|
||||
ddsgen
|
||||
ddsfts_connext
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
ELSE()
|
||||
NGL_TARGET_LINK_LIBRARIES(ddsfts
|
||||
PRIVATE
|
||||
ProjectConfig
|
||||
ddsQoS
|
||||
svcTabCommon
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
ddsgen
|
||||
|
||||
@@ -73,33 +73,54 @@ CODEGEN_IDL_SVC(SRCS_common ${xml_FILE})
|
||||
# Generate tab_db_impl.cpp/.h, tab_db.h
|
||||
CODEGEN_DATABASE(SRCS_common ${xml_FILE})
|
||||
|
||||
# Generate *.cpp/*.hpp from idl
|
||||
RTIDDSGEN(SRCS_common tab_enums.idl)
|
||||
RTIDDSGEN(SRCS_common tab.idl)
|
||||
|
||||
# Generate tab_dt[s,c]_types.h, tab_ft[s,c]_types.h
|
||||
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate tab_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
# Generate *.cpp/*.hpp from idl (only with BUILD_RTI)
|
||||
IF(BUILD_RTI)
|
||||
RTIDDSGEN(SRCS_common tab_enums.idl)
|
||||
RTIDDSGEN(SRCS_common tab.idl)
|
||||
# Generate tab_dt[s,c]_types.h, tab_ft[s,c]_types.h
|
||||
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
|
||||
# generate tab_[d|f]tc.h
|
||||
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
|
||||
ELSE()
|
||||
# Stub files for BUILD_RTI=OFF
|
||||
SET(SRCS_common ${SRCS_common}
|
||||
stubs/tab_enums_stub.hpp
|
||||
stubs/tab_stub.hpp
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
# Create target only if component flags allow
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
|
||||
|
||||
# Generate export header ALWAYS (needed for logger.h even if target not built)
|
||||
# Use custom command to create minimal export header if target wasn't created
|
||||
IF(NOT TARGET svcTabCommon)
|
||||
# Create a dummy static library just for export header generation
|
||||
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
|
||||
ENDIF()
|
||||
GENERATE_EXPORT_HEADER(svcTabCommon EXPORT_FILE_NAME "svctabcommon_export.h")
|
||||
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/stubs
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcTabCommon
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
Qt6::Sql
|
||||
NGLLogger
|
||||
ngldb
|
||||
svcPdmCommon
|
||||
LtsUtilsCoreHeaderOnly
|
||||
)
|
||||
IF(BUILD_RTI)
|
||||
NGL_TARGET_LINK_LIBRARIES(svcTabCommon
|
||||
PRIVATE
|
||||
RTI::nddscpp2
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
Qt6::Sql
|
||||
ddscore
|
||||
NGLLogger
|
||||
ngldb
|
||||
svcPdmCommon
|
||||
LtsUtilsCoreHeaderOnly
|
||||
)
|
||||
ENDIF(BUILD_RTI)
|
||||
NGL_INSTALL_TARGET(svcTabCommon)
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// Stub for tab_enums.hpp when BUILD_RTI=OFF
|
||||
#pragma once
|
||||
|
||||
namespace TrainingAreaBase {
|
||||
// Stub enums - replace with actual values as needed
|
||||
enum class DataModification {
|
||||
INSERT = 0,
|
||||
UPDATE = 1,
|
||||
DELETE = 2
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// Stub for tab.hpp when BUILD_RTI=OFF
|
||||
#pragma once
|
||||
|
||||
// Forward declarations and stubs for RTI types
|
||||
namespace TrainingAreaBase {
|
||||
// Add stub types as needed
|
||||
}
|
||||
@@ -24,7 +24,6 @@ DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsCon
|
||||
#else
|
||||
DdsHandler::DdsHandler()
|
||||
: m_logger(getNGLLogger("GuezMinelayerProcessing.DdsHandler"))
|
||||
, m_topicLockMaster(std::make_shared<Core::TopicLockMaster>())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler() - RTI DDS not enabled";
|
||||
}
|
||||
|
||||
@@ -29,15 +29,15 @@ public:
|
||||
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
|
||||
#endif
|
||||
std::shared_ptr<Core::TopicLockMaster> topicLockMaster() const { return m_topicLockMaster; }
|
||||
#endif
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
#endif
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
#endif
|
||||
};
|
||||
|
||||
}
|
||||
+20
-4
@@ -29,9 +29,9 @@ HandlerMinelayerData::HandlerMinelayerData(const std::shared_ptr<DdsHandler> &dd
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(ddsHandler)
|
||||
#if BUILD_RTI
|
||||
, m_tabDtc(nullptr)
|
||||
, m_ppmDtc(nullptr)
|
||||
#if BUILD_RTI
|
||||
, m_aesFtc(nullptr)
|
||||
#endif
|
||||
, m_minefieldInterpreter(new ZSSI_WI_Minenfeld_Interpreter(this))
|
||||
@@ -97,7 +97,7 @@ bool HandlerMinelayerData::init()
|
||||
return ret;
|
||||
}
|
||||
|
||||
void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, DataModification modType)
|
||||
void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, ParticipantManagement::DataModification modType)
|
||||
{
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
@@ -158,7 +158,7 @@ void HandlerMinelayerData::convertMinelayerDataToXdrData(const TrainingAreaBase:
|
||||
outData.verlegedaten.anzahl_verlegter_minen = inData.mineCount();
|
||||
}
|
||||
|
||||
void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, DataModification modType)
|
||||
void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, ParticipantManagement::DataModification modType)
|
||||
{
|
||||
if ((modType == DataModification::eAdded) ||
|
||||
(modType == DataModification::eModified))
|
||||
@@ -201,7 +201,7 @@ void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::Minela
|
||||
}
|
||||
}
|
||||
|
||||
void HandlerMinelayerData::onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, DataModification modType)
|
||||
void HandlerMinelayerData::onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, ParticipantManagement::DataModification modType)
|
||||
{
|
||||
if ((modType == DataModification::eAdded) ||
|
||||
(modType == DataModification::eModified))
|
||||
@@ -367,4 +367,20 @@ void HandlerMinelayerData::onMineAreaModifyFromCtaDataReply(const Core::Function
|
||||
|
||||
} // namespace GuezMinelayerProcessing
|
||||
|
||||
#else // BUILD_RTI
|
||||
|
||||
namespace GuezMinelayerProcessing
|
||||
{
|
||||
|
||||
HandlerMinelayerData::HandlerMinelayerData(const std::shared_ptr<DdsHandler> &ddsHandler,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_ddsHandler(ddsHandler)
|
||||
{}
|
||||
|
||||
HandlerMinelayerData::~HandlerMinelayerData()
|
||||
{}
|
||||
|
||||
} // namespace GuezMinelayerProcessing
|
||||
|
||||
#endif // BUILD_RTI
|
||||
+28
-13
@@ -12,24 +12,25 @@
|
||||
#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 "GFS_map_cont.h"
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <Proxies/TrainingAreaBase/tab_dtc.h>
|
||||
#endif
|
||||
|
||||
namespace GuezMinelayerProcessing
|
||||
{
|
||||
class DdsHandler;
|
||||
class ZSSI_WI_Minenfeld_Interpreter;
|
||||
class HandlerMinelayerData : public QObject
|
||||
|
||||
#if BUILD_RTI
|
||||
class HandlerMinelayerData : public QObject
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyFromCtaDataReplyHandler
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -39,14 +40,12 @@ 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);
|
||||
void onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, DataModification modType);
|
||||
void onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, DataModification modType);
|
||||
void onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, ParticipantManagement::DataModification modType);
|
||||
void onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, ParticipantManagement::DataModification modType);
|
||||
void onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, ParticipantManagement::DataModification modType);
|
||||
void onSendMinefield(const wirkfeld_minensperre_rt &minefield, int fzArt);
|
||||
void onStartMinefieldInterpreter ();
|
||||
|
||||
@@ -61,13 +60,29 @@ 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;
|
||||
|
||||
ZSSI_WI_Minenfeld_Interpreter *m_minefieldInterpreter;
|
||||
QTimer *m_minefieldInterpreterTimer;
|
||||
};
|
||||
#else
|
||||
// Stub implementation when BUILD_RTI is OFF
|
||||
class HandlerMinelayerData : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HandlerMinelayerData(const std::shared_ptr<DdsHandler> &ddsHandler,
|
||||
QObject *parent = nullptr);
|
||||
~HandlerMinelayerData();
|
||||
|
||||
bool init() { return false; }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
};
|
||||
#endif // BUILD_RTI
|
||||
|
||||
} // namespace GuezMinelayerProcessing
|
||||
Reference in new issue
Block a user