Reduce qt6-after tree to release validation scope

Kept: TetraIF/, Z/src, Lts/Common, Lts/Proxies/TrainingAreaBase
(tabTelegrams dependency of TetraIF) plus build scaffolding
(cmake/, include/, external/, doxygen/, tests/, translations/,
lts-cc.conf, CTestCustom.ctest, new_docker_build.sh, rti_license.dat).
Removed: out-of-scope Lts modules (Application, DDS, Plugins, Projects,
Services, Tools, Viewer, all Proxies except TrainingAreaBase),
top-level src/, specs/, Qt5 tree (qt5-before + .gitmodules entry),
migration reports and leftover scripts.
This commit is contained in:
berrux-dev committed 2026-10-13 17:24:34 +02:00
1 parent 1a38b88229
commit e4743d631d
12095 files changed
-2345836

No files matched your search

@@ -1,154 +0,0 @@
#
# $Id$
# $HeadURL$
# $Author$
#
IF(BUILD_RTI)
INCLUDE(MacroRTIDDSGen)
INCLUDE(MacroCodeGenIdl)
# Resolve <DDS/...> includes (generic_data_reader.h, generic_dtc.h, ...) to the
# real headers under Lts/DDS/ instead of the migration stub tree in include/.
# The generated core_dtc_impl.h relies on GenericDtc::TopicType, which only the
# real DDSGeneric::GenericDataReader base provides — the stub variant lacks it.
# Same fix the migrated service CMakeLists (FileManagement/FilterManagement)
# already enforce; svcFileManagement links svcCoreClient, so Core must build.
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
SET(xml_FILE core.xml)
#
# --- Library svcCoreCommon / ddscore --------------------------------------------------------------------------------
#
SET(SRCS_common
core_export.h
function_reply_object.cpp
function_reply_object.h
logger.cpp
logger.h
)
# Generates core.idl / core_enums.idl
CODEGEN_IDL_SVC(SRCS_common ${xml_FILE})
# Generate core.sql
CODEGEN_SQL(SRCS_common ${xml_FILE})
# Generate *.cpp/*.hpp from core_enums.idl / core.idl
RTIDDSGEN(SRCS_common core_enums.idl)
RTIDDSGEN(SRCS_common core.idl)
# Generate core_dt[s,c]_types.h, core_ft[s,c]_types.h
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate core_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
# Get the generated core_dtc.h path for manual MOC handling
# When BUILD_GRANTLEE=OFF, file is in source dir; otherwise in build dir
IF(BUILD_GRANTLEE)
SET(CORE_DTC_H_GENERATED "${CMAKE_CURRENT_BINARY_DIR}/core_dtc.h")
ELSE()
SET(CORE_DTC_H_GENERATED "${CMAKE_CURRENT_SOURCE_DIR}/core_dtc.h")
# Copy to build directory for consistent MOC handling
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/core_dtc.h" "${CMAKE_CURRENT_BINARY_DIR}/core_dtc.h" COPYONLY)
ENDIF()
NGL_ADD_LIBRARY2(WS AAR HLA SV ddscore SHARED ${SRCS_common})
# Add RTI compile definitions explicitly (required for RTI headers to compile)
# NDDS_USER_SYMBOL_EXPORT triggers visibility attributes in RTI-generated code
# without the later undef that happens with NDDS_USER_DLL_EXPORT
TARGET_COMPILE_DEFINITIONS(ddscore
PRIVATE
RTI_UNIX
RTI_LINUX
RTI_64BIT
MAKE_DDSCORE_LIB
PUBLIC
NDDS_USER_SYMBOL_EXPORT
)
# Skip AUTOMOC for generated header - it will be processed manually with correct dependencies
SET_SOURCE_FILES_PROPERTIES(${CORE_DTC_H_GENERATED} PROPERTIES SKIP_AUTOMOC ON)
# Ensure AUTOMOC can find generated headers - add include path
TARGET_INCLUDE_DIRECTORIES(ddscore
PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/../../
)
NGL_TARGET_INCLUDE_DIRECTORIES(ddscore
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../
)
# Manually add MOC for the generated core_dtc.h with proper include paths
QT6_WRAP_CPP(ddscore_moc_sources ${CORE_DTC_H_GENERATED}
OPTIONS --include core_dtc.h -I${CMAKE_CURRENT_BINARY_DIR}/../.. -I${CMAKE_CURRENT_SOURCE_DIR}/../..
)
TARGET_SOURCES(ddscore PRIVATE ${ddscore_moc_sources})
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(ddscore
PRIVATE
NGLLogger
PUBLIC
LtsUtilsCoreHeaderOnly
ddsdts
Qt6::Core
RTI::nddsc # DDS_GroupDataQosPolicy_initialize (wo auch immer das herkommt)
RTI::nddscore # RTI_LOG_ANY_FAILURE_s (wo auch immer das herkommt)
RTI::nddscpp2
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(ddscore)
#
# --- Library svcCoreClient --------------------------------------------------------------------------------
#
SET(SRCS_client
core_export.h
pacemaker.h
pacemaker.cpp
topic_lock_master.h
topic_lock_master.cpp
)
# generate core_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS HLA svcCoreClient SHARED ${SRCS_client})
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
# MAKE_<SYMBOL>_LIB compile guard, but the generated core_[d|f]tc_impl.h
# headers require MAKE_SVCCORECLIENT_LIB — same situation as ddscore above,
# which defines MAKE_DDSCORE_LIB explicitly for the same reason.
TARGET_COMPILE_DEFINITIONS(svcCoreClient PRIVATE MAKE_SVCCORECLIENT_LIB)
NGL_TARGET_INCLUDE_DIRECTORIES(svcCoreClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../
${CMAKE_CURRENT_BINARY_DIR}/../../
)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcCoreClient
PRIVATE
RTI::nddscpp2
ddsconnector
PUBLIC
ddscore
ddsftc
)
ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcCoreClient)
#
# --- Library svcCoreServer --------------------------------------------------------------------------------
# not used (no core service needed)
#
#
# --- Topic Type Plugin --------------------------------------------------------------
#
CREATE_TOPIC_TYPE_PLUGIN(${xml_FILE})
ENDIF(BUILD_RTI)
@@ -1,204 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<service namespace="Core" abbreviation="CORE" procNames="Core" exerciseDependency="Global">
<rcs>
<Id Id="$Id$"/>
<HeadURL HeadURL="$HeadURL$"/>
<Author Author="$Author$"/>
</rcs>
<tables>
<table name="ft_reply_state" comment="static data (not project specific) generate from enum">
<column name="id" datatype="integer" isPrimaryKey="1"/>
<column name="name" datatype="text"/>
</table>
<table name="replay_type" comment="Type of replay (Data for reports/events or situation)">
<column name="id" datatype="integer" isPrimaryKey="1"/>
<column name="name" datatype="text"/>
</table>
<table name="running_state">
<column name="id" datatype="integer" isPrimaryKey="1"/>
<column name="name" datatype="text"/>
</table>
<table name="service_group_type">
<column name="id" datatype="integer" isPrimaryKey="1"/>
<column name="name" datatype="text"/>
</table>
<table name="z_reference">
<column name="id" datatype="integer" isPrimaryKey="1"/>
<column name="name" datatype="text"/>
</table>
</tables>
<views/>
<topicTypes>
<topicType name="BaseEntity">
<column name="id" idlType="long" isKey="1"/>
<column name="name" idlType="string"/>
<column name="isDeleted" idlType="boolean"/>
<column name="isUsed" idlType="boolean" comment="Defines if it is used by others (i.e. foreign key constraint)"/>
</topicType>
<topicType name="BaseEntityTranslatable">
<column name="id" idlType="long" isKey="1"/>
<column name="name" idlType="string" isTranslatable="1"/>
<column name="isDeleted" idlType="boolean"/>
<column name="isUsed" idlType="boolean" comment="Defines if it is used by others (i.e. foreign key constraint)"/>
</topicType>
<topicType name="BaseEntityWithSampleTime" baseValueType="BaseEntity">
<column name="sampleTime" idlType="long long" comment="Timestamp"/>
</topicType>
<topicType name="CurrentRunningState" isDataObject="1" routeToClient="0" routeToServer="0" routeInReplay="0">
<column name="pid" idlType="long long" isKey="1"/>
<column name="runningState" idlType="RunningState"/>
<column name="ports" idlType="sequence&lt;PortInformation&gt;" isOptional="1"/>
<column name="errorString" idlType="string" isOptional="1"/>
</topicType>
<topicType name="FunctionReply">
<column name="id" idlType="long"/>
<column name="errorString" idlType="string"/>
<column name="errorParams" idlType="sequence&lt;string&gt;"/>
<column name="additionalInfo" idlType="string"/>
</topicType>
<topicType name="FunctionReplyWithState" baseValueType="FunctionReply">
<column name="replyState" idlType="FtReplyState"/>
</topicType>
<topicType name="GeoPositionAbsoluteTime" baseValueType="GeoPosition">
<column name="absoluteTime" idlType="long long" comment="Timestamp"/>
</topicType>
<topicType name="GeoPositionRelativeTime" baseValueType="GeoPosition">
<column name="relativeTime" idlType="long long" comment="Timestamp"/>
</topicType>
<topicType name="GeoPosition" baseValueType="GeoPosition2D">
<column name="z" idlType="double" comment="height above ground"/>
</topicType>
<topicType name="GeoPosition2D">
<column name="lon" idlType="double" comment="[m]"/>
<column name="lat" idlType="double" comment="[m]"/>
</topicType>
<topicType name="LockEntityError">
<column name="workstationName" idlType="string"/>
<column name="operatorName" idlType="string"/>
</topicType>
<topicType name="TryLockEntityReply" baseValueType="FunctionReply">
<column name="alreadyLocked" idlType="LockEntityError" isOptional="1"/>
</topicType>
<topicType name="LockedEntity" isDataObject="1" routeToClient="0" routeToServer="0" routeInReplay="0" baseValueType="LockedEntityBase">
<column name="id" idlType="long long" isKey="1"/>
</topicType>
<topicType name="LockedEntityBase">
<column name="operatorId" idlType="long"/>
<column name="workstationId" idlType="long"/>
<column name="exerciseId" idlType="long"/>
<column name="entityId" idlType="long long"/>
<column name="entityTypeName" idlType="string"/>
</topicType>
<topicType name="TryLockEntityRequest" baseValueType="LockedEntityBase">
<column name="id" idlType="long"/>
</topicType>
<topicType name="TryUnlockEntityRequest">
<column name="id" idlType="long"/>
</topicType>
<topicType name="Orientation">
<column name="heave" idlType="double"/>
<column name="pitch" idlType="double"/>
<column name="roll" idlType="double"/>
</topicType>
<topicType name="PartitionTime" isDataObject="1" routeToClient="1" routeToServer="0" routeInReplay="0">
<column name="timeStamp" idlType="long long"/>
</topicType>
<topicType name="PortInformation">
<column name="number" idlType="long"/>
<column name="type" idlType="CorePortType"/>
<column name="properties" idlType="string"/>
</topicType>
<topicType name="RelativePosition">
<column name="offsetX" idlType="double" comment="in meter"/>
<column name="offsetY" idlType="double" comment="in meter"/>
<column name="offsetZ" idlType="double" comment="in meter"/>
</topicType>
<topicType name="RelativePositionAbsoluteTime" isDataObject="1" autosubscribe="1" routeToClient="1" routeToServer="0" routeInReplay="0" baseValueType="RelativePosition">
<column name="absoluteTime" idlType="long long" comment="TimeStamp"/>
</topicType>
<topicType name="RelativePositionRelativeTime" isDataObject="1" autosubscribe="1" routeToClient="1" routeToServer="0" routeInReplay="0" baseValueType="RelativePosition">
<column name="relativeTime" idlType="long long" comment="TimeStamp"/>
</topicType>
<topicType name="RemoveElementRequest">
<column name="id" idlType="long"/>
</topicType>
<topicType name="ReplayPartition" isDataObject="1" routeToClient="1" routeToServer="0" routeInReplay="0">
<column name="id" idlType="long" isKey="1"/>
<column name="name" idlType="string"/>
<column name="exerciseId" idlType="long"/>
<column name="workstationId" idlType="long"/>
<column name="operatorId" idlType="long"/>
<column name="replayType" idlType="ReplayType"/>
<column name="domainId" idlType="long"/>
<column name="tcpConnectionUrl" idlType="string"/>
</topicType>
<topicType name="Velocity">
<column name="x" idlType="double"/>
<column name="y" idlType="double"/>
<column name="z" idlType="double"/>
</topicType>
</topicTypes>
<functionTopics>
<functionTopic name="TryLockEntity" requestTopicType="TryLockEntityRequest" replyTopicType="TryLockEntityReply" requestTopicName="TryLockEntityRequest" replyTopicName="TryLockEntityReply" routeInReplay="1"/>
<!-- <functionTopic name="TryLockEntity" requestTopicType="LockedEntityBase" replyTopicType="TryLockEntityReply" requestTopicName="TryLockEntityRequest" replyTopicName="TryLockEntityReply" routeInReplay="1"/>-->-->
<functionTopic name="TryUnlockEntity" requestTopicType="TryUnlockEntityRequest" replyTopicType="FunctionReply" requestTopicName="TryUnlockEntityRequest" replyTopicName="TryUnlockEntityReply" routeInReplay="1"/>
</functionTopics>
<enumerations>
<enumeration name="FtReplyState" table="ft_reply_state">
<attribute key="NotStarted" value="0"/>
<attribute key="InProgress" value="1"/>
<attribute key="Completed" value="2"/>
<attribute key="Error" value="4"/>
</enumeration>
<enumeration name="CorePortType">
<attribute key="Unknown" value="0"/>
<attribute key="WebSocketServer" value="1"/>
<attribute key="WebSocketPositionServer" value="2"/>
<attribute key="WebSocketAdlerServer" value="3"/>
</enumeration>
<enumeration name="PositionReportingSource">
<attribute key="Gps" value="0"/>
<attribute key="Wls" value="1"/>
<attribute key="Ops" value="2"/>
<attribute key="External" value="3"/>
<attribute key="SetByOperator" value="4"/>
<attribute key="MovementSimulation" value="5"/>
<attribute key="OpsTunnel" value="6"/>
<attribute key="OpsBuilding" value="7"/>
</enumeration>
<enumeration name="ReplayType" table="replay_type">
<attribute key="UnknownData" value="0"/>
<attribute key="SituationData" value="1"/>
<attribute key="ReportData" value="2"/>
<attribute key="EventData" value="3"/>
<attribute key="OtherData" value="4"/>
<attribute key="SnapshotData" value="5"/>
</enumeration>
<enumeration name="RunningState" table="running_state">
<attribute key="NotYetStarted" value="0"/>
<attribute key="Starting" value="1"/>
<attribute key="StartingError" value="2"/>
<attribute key="Running" value="3"/>
<attribute key="Stopping" value="4"/>
<attribute key="StoppedNormally" value="5"/>
<attribute key="StoppedError" value="6"/>
</enumeration>
<enumeration name="ServiceGroupType" table="service_group_type">
<attribute key="Master" value="0"/>
<attribute key="Core" value="1"/>
<attribute key="ExercisePreparation" value="2"/>
<attribute key="ExerciseExecution" value="3"/>
<attribute key="ExercisePaused" value="4"/>
<attribute key="ExerciseAfterActionReview" value="5"/>
<attribute key="Playback" value="6"/>
</enumeration>
<enumeration name="ZReference" table="z_reference">
<attribute key="ZrUndefined" value="0"/>
<attribute key="Zr_Unused" value="1"/>
<attribute key="ZrRelativeAGL" value="100"/>
<attribute key="ZrAbsolute" value="200"/>
<attribute key="ZrDrapedOnGround" value="300"/>
<attribute key="ZrRelativeToDefinedValue" value="400"/>
</enumeration>
</enumerations>
</service>
@@ -1,152 +0,0 @@
/**
* CORE Data Topic Client Interface
* $Id$
* $HeadURL$
* $Author$
* Created by Hanna E. Rathje, SLSE, 2016-01-04
*/
// filename: core_dtc.h
#pragma once
#include <QMap>
#include <QObject>
#include <functional>
#include <LtsUtilsCore/data_modification_enum.h>
#include <DDS/Core/core_export.h>
#include <DDS/Core/core.hpp>
// Bring Core namespace types into scope for Interface namespace
using namespace Core;
namespace DDSConnector
{
class DdsConnector;
}
namespace Core
{
namespace Interface
{
class CORE_COMMON_EXPORT Dtc : public QObject
{
Q_OBJECT
protected:
Dtc() = default;
public:
virtual ~Dtc() = default;
/**
* Create a new instance for Core::Interface::Dtc.
*/
static std::shared_ptr<Dtc> create(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector);
/**
* A unique identifier for this DTC
*/
static inline const char *identifier() { return "Core.Interface.Dtc"; }
/**
* initialize this Dts instance with all data topic readers
*/
virtual bool enableAll(bool enable = true) = 0;
/**
* only initialize the specific reader (can be called instead enableAll())
*/
virtual bool enableCurrentRunningState(bool enable = true) = 0;
virtual bool isCurrentRunningStateEnabled() const = 0;
virtual bool waitForHistoricalDataCurrentRunningState(int timeoutMSec = -1) = 0;
virtual bool enableLockedEntity(bool enable = true) = 0;
virtual bool isLockedEntityEnabled() const = 0;
virtual bool waitForHistoricalDataLockedEntity(int timeoutMSec = -1) = 0;
virtual bool enablePartitionTime(bool enable = true) = 0;
virtual bool isPartitionTimeEnabled() const = 0;
virtual bool waitForHistoricalDataPartitionTime(int timeoutMSec = -1) = 0;
virtual bool enableRelativePositionAbsoluteTime(bool enable = true) = 0;
virtual bool isRelativePositionAbsoluteTimeEnabled() const = 0;
virtual bool waitForHistoricalDataRelativePositionAbsoluteTime(int timeoutMSec = -1) = 0;
virtual bool enableRelativePositionRelativeTime(bool enable = true) = 0;
virtual bool isRelativePositionRelativeTimeEnabled() const = 0;
virtual bool waitForHistoricalDataRelativePositionRelativeTime(int timeoutMSec = -1) = 0;
virtual bool enableReplayPartition(bool enable = true) = 0;
virtual bool isReplayPartitionEnabled() const = 0;
virtual bool waitForHistoricalDataReplayPartition(int timeoutMSec = -1) = 0;
public:
//
// Data Topic 'CurrentRunningState'
//
virtual QMap<qint64, ::Core::CurrentRunningState> currentRunningStates() = 0;
virtual bool currentRunningStates(const std::function<void(const ::Core::CurrentRunningState &data)> &cb) = 0;
// when the cb returns true, the loop is stopped (useful when searching for a specific topic)
virtual bool currentRunningStates(const std::function<bool(const ::Core::CurrentRunningState &data)> &cb) = 0;
virtual ::Core::CurrentRunningState currentRunningState(qint64 pid) = 0;
Q_SIGNALS:
void currentRunningStateChanged(const ::Core::CurrentRunningState &data, DataModification modType);
public:
//
// Data Topic 'LockedEntity'
//
virtual QMap<qint64, ::Core::LockedEntity> lockedEntitys() = 0;
virtual bool lockedEntitys(const std::function<void(const ::Core::LockedEntity &data)> &cb) = 0;
// when the cb returns true, the loop is stopped (useful when searching for a specific topic)
virtual bool lockedEntitys(const std::function<bool(const ::Core::LockedEntity &data)> &cb) = 0;
virtual ::Core::LockedEntity lockedEntity(qint64 id) = 0;
Q_SIGNALS:
void lockedEntityChanged(const ::Core::LockedEntity &data, DataModification modType);
public:
//
// Data Topic 'PartitionTime'
//
virtual ::Core::PartitionTime partitionTime() = 0;
Q_SIGNALS:
void partitionTimeChanged(const ::Core::PartitionTime &data, DataModification modType);
public:
//
// Data Topic 'RelativePositionAbsoluteTime'
//
virtual ::Core::RelativePositionAbsoluteTime relativePositionAbsoluteTime() = 0;
Q_SIGNALS:
void relativePositionAbsoluteTimeChanged(const ::Core::RelativePositionAbsoluteTime &data, DataModification modType);
public:
//
// Data Topic 'RelativePositionRelativeTime'
//
virtual ::Core::RelativePositionRelativeTime relativePositionRelativeTime() = 0;
Q_SIGNALS:
void relativePositionRelativeTimeChanged(const ::Core::RelativePositionRelativeTime &data, DataModification modType);
public:
//
// Data Topic 'ReplayPartition'
//
virtual QMap<qint32, ::Core::ReplayPartition> replayPartitions() = 0;
virtual bool replayPartitions(const std::function<void(const ::Core::ReplayPartition &data)> &cb) = 0;
// when the cb returns true, the loop is stopped (useful when searching for a specific topic)
virtual bool replayPartitions(const std::function<bool(const ::Core::ReplayPartition &data)> &cb) = 0;
virtual ::Core::ReplayPartition replayPartition(qint32 id) = 0;
Q_SIGNALS:
void replayPartitionChanged(const ::Core::ReplayPartition &data, DataModification modType);
};
} // namespace Interface
} // namespace Core
@@ -1,48 +0,0 @@
#pragma once
#include <QtCore/qglobal.h>
#ifndef CORE_COMMON_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define CORE_COMMON_EXPORT
# else
# if defined(MAKE_DDSCORE_LIB)
# define CORE_COMMON_EXPORT Q_DECL_EXPORT
# ifndef WIN32
# ifdef NDDSUSERDllExport
# undef NDDSUSERDllExport
# endif
# define NDDSUSERDllExport Q_DECL_EXPORT
# endif
# else
# define CORE_COMMON_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
#ifndef CORE_CLIENT_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define CORE_CLIENT_EXPORT
# else
# if defined(MAKE_DDSCORE_LIB) || defined(MAKE_SVCCORECLIENT_LIB)
# define CORE_CLIENT_EXPORT Q_DECL_EXPORT
# else
# define CORE_CLIENT_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
#ifndef CORE_SERVER_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define CORE_SERVER_EXPORT
# else
# if defined(MAKE_SVCCORESERVER_LIB)
# define CORE_SERVER_EXPORT Q_DECL_EXPORT
# else
# define CORE_SERVER_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
@@ -1,95 +0,0 @@
/**
* Core Function Topic Client interface
* $Id$
* $HeadURL$
* $Author$
*/
// filename: core_ftc.h
#pragma once
#include <DDS/Core/core_export.h>
#include <DDS/Core/core.hpp>
#include <DDS/Core/function_reply_object.h>
namespace DDSConnector
{
class DdsConnector;
}
namespace Core
{
namespace Interface
{
class Ftc
{
protected:
Ftc() = default;
public:
virtual ~Ftc() = default;
/**
* Create a new instance for Core::Interface::Ftc.
* The caller takes ownership of the returned instance!
*/
CORE_CLIENT_EXPORT static std::shared_ptr<Ftc> create(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector, bool forceCreate = false);
/**
* A unique identifier for this FTC
*/
CORE_CLIENT_EXPORT static inline const char *identifier() { return "Core.Interface.Ftc"; }
/**
* initialize this Ftc instance with all function topic clients
*/
virtual bool enableAll(bool enable = true) = 0;
/**
* only initialize the specific function topic client (can be called instead enableAll())
*/
virtual bool enableTryLockEntity(bool enable = true) = 0;
virtual bool isTryLockEntityEnabled() const = 0;
virtual bool enableTryUnlockEntity(bool enable = true) = 0;
virtual bool isTryUnlockEntityEnabled() const = 0;
//
// Function Topic 'TryLockEntity'
//
class TryLockEntityReplyHandler
{
public:
TryLockEntityReplyHandler() = default;
virtual ~TryLockEntityReplyHandler() = default;
virtual void onTryLockEntityReply(const TryLockEntityReply &reply) = 0;
};
virtual int64_t tryLockEntityRequest(const TryLockEntityRequest &request, TryLockEntityReplyHandler *handler) = 0;
virtual int64_t tryLockEntityRequest(const TryLockEntityRequest &request, const std::function<void(const TryLockEntityReply&)> &cb) = 0;
virtual TryLockEntityReply tryLockEntityRequest(const TryLockEntityRequest &request) noexcept(false) = 0; // await
virtual int64_t lastTryLockEntityRequestUniqueId() const = 0;
//
// Function Topic 'TryUnlockEntity'
//
class TryUnlockEntityReplyHandler
{
public:
TryUnlockEntityReplyHandler() = default;
virtual ~TryUnlockEntityReplyHandler() = default;
virtual void onTryUnlockEntityReply(const Core::FunctionReplyObject &reply) = 0;
};
virtual int64_t tryUnlockEntityRequest(const TryUnlockEntityRequest &request, TryUnlockEntityReplyHandler *handler) = 0;
virtual int64_t tryUnlockEntityRequest(const TryUnlockEntityRequest &request, const std::function<void(const Core::FunctionReplyObject&)> &cb) = 0;
virtual int32_t tryUnlockEntityRequest(const TryUnlockEntityRequest &request) noexcept(false) = 0; // await
virtual int64_t lastTryUnlockEntityRequestUniqueId() const = 0;
};
} // namespace Interface
} // namespace Core
@@ -1,48 +0,0 @@
#include "function_reply_object.h"
#include <QtCore/QString>
#include <QtCore/QCoreApplication>
namespace Core
{
FunctionReplyObject &FunctionReplyObject::arg(qint64 val)
{
m_args.push_back(std::to_string(val));
return *this;
}
FunctionReplyObject &FunctionReplyObject::arg(const std::string &str)
{
m_args.push_back(str);
return *this;
}
FunctionReplyObject &FunctionReplyObject::arg(const QString &str)
{
m_args.push_back(str.toStdString());
return *this;
}
std::string FunctionReplyObject::operator()() const
{
if (m_args.empty())
return m_str;
QString ret(QString::fromStdString(m_str));
for (const std::string &s : m_args)
ret = ret.arg(QString::fromStdString(s));
return ret.toStdString();
}
QString FunctionReplyObject::translated() const
{
QString ret(QCoreApplication::translate("dds", m_str.c_str()));
for (const std::string &s : m_args)
ret = ret.arg(QString::fromStdString(s));
return ret;
}
}
@@ -1,95 +0,0 @@
#pragma once
#include <string>
#include <vector>
#include "core_export.h"
#ifndef tr_lts
#define tr_lts(ctx, t) (t)
#endif
namespace Core
{
class CORE_COMMON_EXPORT FunctionReplyObject
{
public:
explicit FunctionReplyObject(int id = -1, const char *str = nullptr)
: m_str(str ? str : std::string())
, m_id(id)
{}
explicit FunctionReplyObject(const char *str)
: m_str(str ? str : std::string())
{}
explicit FunctionReplyObject(int id, const std::string &errStr, const std::vector<std::string> &errArgs)
: m_str(errStr)
, m_args(errArgs)
, m_id(id)
{}
explicit FunctionReplyObject(int id, std::string &&errStr, std::vector<std::string> &&errArgs)
: m_str(std::move(errStr))
, m_args(std::move(errArgs))
, m_id(id)
{}
explicit FunctionReplyObject(int id, const std::string &errStr, const std::vector<std::string> &errArgs, const std::string &additionalInfo)
: m_str(errStr)
, m_additionalInfo(additionalInfo)
, m_args(errArgs)
, m_id(id)
{}
explicit FunctionReplyObject(int id, std::string &&errStr, std::vector<std::string> &&errArgs, std::string &&additionalInfo)
: m_str(std::move(errStr))
, m_additionalInfo(std::move(additionalInfo))
, m_args(std::move(errArgs))
, m_id(id)
{}
~FunctionReplyObject() = default;
FunctionReplyObject &arg(qint64 val);
FunctionReplyObject &arg(const std::string &str);
FunctionReplyObject &arg(const QString &str);
bool error() const { return !m_str.empty(); }
void setId(int id) { m_id = id; }
FunctionReplyObject &setStr(const char *str) { m_str = str; return *this; }
FunctionReplyObject &setAdditionalInfo(const char *additionalInfo) { m_additionalInfo = additionalInfo; return *this; }
int id() const { return m_id; }
std::string str() const { return m_str; }
std::string additionalInfo() const { return m_additionalInfo; }
std::vector<std::string> args() const { return m_args; }
std::string operator()() const;
QString translated() const;
int64_t uniqueId() const { return m_uniqueId; }
void setUniqueId(int64_t uniqueId) { m_uniqueId = uniqueId; }
private:
std::string m_str;
std::string m_additionalInfo;
std::vector<std::string> m_args;
int64_t m_uniqueId = 0;
int m_id = -1;
};
}
@@ -1,31 +0,0 @@
#include "logger.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace Core
{
LOGGER_T getLogger(const char *name)
{
static const char ns[] = "CORE.";
std::string loggerName;
const size_t len = strlen(name);
loggerName.reserve(sizeof(ns) + len);
loggerName.append(ns, sizeof(ns) - 1);
loggerName.append(name, len);
try
{
return ::NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger( loggerName );
}
catch ( const std::exception &ex )
{
fprintf(stderr, "Error retrieving logger: %s", ex.what());
abort();
}
}
}
@@ -1,13 +0,0 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "core_export.h"
namespace Core
{
using LOGGER_T = ::NGL::INGLLogger&;
CORE_COMMON_EXPORT LOGGER_T getLogger(const char *name);
}
@@ -1,165 +0,0 @@
#include "pacemaker.h"
#if BUILD_RTI
#include <DDS/DDSConnector/dds_connector.h>
#include <DDS/DTS/generic_dts.h>
#include <DDS/DTS/generic_dts_impl.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QThread>
#include <QtCore/QTimer>
namespace Core
{
Pacemaker::Pacemaker(DDSConnector::DdsConnector *ddsConnector)
: QObject(nullptr)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Core.Pacemaker"))
{
init(ddsConnector);
}
Pacemaker::~Pacemaker()
{
m_paceThread->requestInterruption();
m_paceThread->quit();
m_paceThread->wait();
delete m_paceThread;
m_publishTimer->deleteLater();
delete m_dtsCurrentRunningState;
}
void Pacemaker::setNewState(Core::RunningState newState, const QString& errorString)
{
if (QThread::currentThread() == this->thread())
setNewStateInternal(newState, errorString);
else
QTimer::singleShot(0, this, [this, newState, errorString]() { setNewStateInternal(newState, errorString); });
}
void Pacemaker::setNewStateInternal(Core::RunningState newState, const QString& errorString)
{
m_state.runningState = newState;
if (errorString.isEmpty())
m_state.errorString.reset();
else
m_state.errorString = errorString.toStdString();
publishState();
}
void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, const QString& properties)
{
if (QThread::currentThread() == this->thread())
addPortInternal(number, portType, properties);
else
QTimer::singleShot(0, this,
[this, number, portType, properties]() { addPortInternal(number, portType, properties); });
}
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
{
if (!m_state.ports.is_set())
m_state.ports = std::vector<Core::PortInformation>();
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
publishState();
}
void Pacemaker::publishState()
{
if (!m_dtsCurrentRunningState)
return;
m_dtsCurrentRunningState->write(m_state);
}
void Pacemaker::init(DDSConnector::DdsConnector* ddsConnector)
{
m_dtsCurrentRunningState = ddsConnector->createDTS<DTS::CurrentRunningStateImpl>();
if (!m_dtsCurrentRunningState)
{
WARNING_LOG(m_logger) << "Can not initialize DTS::CurrentRunningState!";
return;
}
m_state.pid = QCoreApplication::applicationPid();
m_state.runningState = Core::RunningState::Starting;
m_paceThread = new QThread;
this->moveToThread(m_paceThread);
startTimer();
publishState();
}
void Pacemaker::startTimer()
{
if (m_publishTimer)
return;
m_publishTimer = new QTimer();
m_publishTimer->moveToThread(m_paceThread);
connect(m_publishTimer, &QTimer::timeout, this, &Pacemaker::publishState);
m_publishTimer->setSingleShot(false);
m_publishTimer->setInterval(m_publishTimerDelay);
connect(m_paceThread, &QThread::started, this, [this]() { m_publishTimer->start(); });
m_paceThread->start();
}
#else // BUILD_RTI
Pacemaker::Pacemaker(void* ddsConnector)
: QObject(nullptr)
{
Q_UNUSED(ddsConnector)
}
Pacemaker::~Pacemaker()
{
}
void Pacemaker::setNewState(Core::RunningState newState, const QString& errorString)
{
Q_UNUSED(newState)
Q_UNUSED(errorString)
}
void Pacemaker::setNewStateInternal(Core::RunningState newState, const QString& errorString)
{
Q_UNUSED(newState)
Q_UNUSED(errorString)
}
void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, const QString& properties)
{
Q_UNUSED(number)
Q_UNUSED(portType)
Q_UNUSED(properties)
}
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
{
Q_UNUSED(number)
Q_UNUSED(portType)
Q_UNUSED(properties)
}
void Pacemaker::publishState()
{
}
void Pacemaker::init(void* ddsConnector)
{
Q_UNUSED(ddsConnector)
}
void Pacemaker::startTimer()
{
}
#endif // BUILD_RTI
} // namespace Core
@@ -1,62 +0,0 @@
/**
* The Pacemaker class implements functionality to publish Service states in DDS.
* $Id$
* $HeadURL$
* $Author$
* Created by Hannes Baeuerle, SLSE, 29.02.2016
*/
#pragma once
#include <QtCore/QObject>
#include <QtCore/QThread>
#include <DDS/Core/core_dts_types.h>
#include "core_export.h"
namespace DDSConnector
{
class DdsConnector;
}
class QTimer;
namespace NGL
{
class INGLLogger;
}
namespace Core
{
class CORE_CLIENT_EXPORT Pacemaker final : public QObject
{
Q_OBJECT
public:
explicit Pacemaker(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: Pacemaker(ddsConnector.get())
{}
explicit Pacemaker(DDSConnector::DdsConnector *ddsConnector);
~Pacemaker();
void startTimer();
public Q_SLOTS:
void setNewState(Core::RunningState newState, const QString &errorString = QString());
void addPort(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
// only public for special purposes, not needed to call explicitly by default
void publishState();
private:
void init(DDSConnector::DdsConnector *ddsConnector);
void setNewStateInternal(Core::RunningState newState, const QString &errorString = QString());
void addPortInternal(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
private:
static constexpr const int m_publishTimerDelay = 3000;
CurrentRunningState m_state;
QTimer *m_publishTimer = nullptr;
QThread *m_paceThread = nullptr;
DTS::CurrentRunningStateImpl *m_dtsCurrentRunningState;
NGL::INGLLogger &m_logger;
};
} // namespace Core
@@ -1,52 +0,0 @@
#include "topic_lock_master.h"
#if BUILD_RTI
#include <DDS/DDSConnector/dds_connector.h>
#include <functional>
namespace Core
{
TopicLockMaster::TopicLockMaster(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: QObject(nullptr)
, m_coreDtc(nullptr)
{
init(ddsConnector);
}
TopicLockMaster::~TopicLockMaster()
{
m_coreDtc.reset();
}
bool TopicLockMaster::init(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
{
if (!ddsConnector)
return false;
m_coreDtc = Core::Interface::Dtc::create(ddsConnector);
if (!m_coreDtc)
return false;
m_coreDtc->enableAll();
m_coreDtc->lockedEntitys([this] (const ::Core::LockedEntity &data) {
m_lockedEntitys << key(data.entityId, data.exerciseId, QString::fromStdString(data.entityTypeName));
});
connect(m_coreDtc.get(), &Core::Interface::Dtc::lockedEntityChanged, this,
[this] (const ::Core::LockedEntity &data, DataModification modType)
{
key k(data.entityId, data.exerciseId, QString::fromStdString(data.entityTypeName));
if (modType == DataModification::eAdded)
m_lockedEntitys << k;
else if (modType == DataModification::eRemoved)
m_lockedEntitys.remove(k);
} );
return true;
}
}
#endif // BUILD_RTI
@@ -1,86 +0,0 @@
#pragma once
#include <QtCore/QSet>
#include <QtCore/QString>
#include <QObject>
#include <Core/core_export.h>
#if BUILD_RTI
// Resolves to the codegen-generated core_dtc.h via the build-dir include
// root (build4/Lts). The old <Core/core_dtc.h> spelling hit the migration
// stub tree (include/Core/core_dtc.h), whose DDS::Core::Interface forward
// declarations don't match the generated Core::Interface::Dtc.
#include <DDS/Core/core_dtc.h>
#else
// Forward declarations for moc compatibility when BUILD_RTI=OFF
namespace Core { namespace Interface { class Dtc; } }
#endif
namespace DDSConnector
{
class DdsConnector;
}
namespace Core
{
struct key
{
inline key() = default;
inline key(int64_t id, int exId, const QString &name)
: entityTypeName(name)
, entityId(id)
, exerciseId(exId)
{}
inline bool operator==(const key &o) const
{
return entityId == o.entityId &&
exerciseId == o.exerciseId &&
entityTypeName == o.entityTypeName;
}
QString entityTypeName;
int64_t entityId = 0;
int exerciseId = 0;
};
inline uint qHash(const Core::key &k, uint seed = 0)
{
return ::qHash(k.entityTypeName, seed) ^ ::qHash(k.entityId, seed) ^ ::qHash(k.exerciseId, seed);
}
class CORE_CLIENT_EXPORT TopicLockMaster : public QObject
{
Q_OBJECT
public:
#if BUILD_RTI
explicit TopicLockMaster(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector);
~TopicLockMaster();
bool init(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector);
#else
explicit TopicLockMaster(void* /*ddsConnector*/) {}
~TopicLockMaster() = default;
bool init(void* /*ddsConnector*/) { return false; }
#endif
template<typename E>
bool isLocked(const E &data, int exerciseId)
{
// rtiddsgen -stl generates plain public data members, so the id is
// accessed directly instead of the old getter call data.id().
auto it = m_lockedEntitys.constFind(key(data.id, exerciseId, QString::fromStdString(typeid(E).name())));
return !(it == m_lockedEntitys.cend());
}
private:
QSet<key> m_lockedEntitys;
#if BUILD_RTI
std::shared_ptr<Core::Interface::Dtc> m_coreDtc;
#endif
};
}