Added test case and setting Test configuration
This commit is contained in:
1 parent
f815271486
commit
a86f9b5bac
48 files changed
+423
-168
No files matched your search
@@ -38,11 +38,7 @@ bool GeneratorGrantleeBase::initInternal(const XmlReader* reader, StructBuilder*
|
||||
m_ctx->insert(QStringLiteral("namespace"), reader->getServiceNamespace());
|
||||
m_ctx->insert(QStringLiteral("namespace_abbr"), reader->getServiceAbbr().toLower());
|
||||
m_ctx->insert(QStringLiteral("namespace_abbr_upper"), reader->getServiceAbbr().toUpper());
|
||||
if (reader->getServiceNamespace() == QLatin1String("Core"))
|
||||
m_ctx->insert(QStringLiteral("include_prefix"),
|
||||
QStringLiteral("DDS/%1").arg(reader->getServiceNamespace()));
|
||||
else
|
||||
m_ctx->insert(QStringLiteral("include_prefix"), reader->getServiceNamespace());
|
||||
m_ctx->insert(QStringLiteral("include_prefix"), reader->getServiceNamespace());
|
||||
m_ctx->insert(QStringLiteral("custom_record_replay"), reader->hasCustomRecordReplayPlugin());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -61,17 +61,15 @@ QString MemberInformationWrapper::ddsToJsonElement() const
|
||||
if (cppMemberName().isEmpty())
|
||||
return QStringLiteral("obj[QStringLiteral(\"") + cppType() + QStringLiteral("\")] = element;");
|
||||
|
||||
const QString memberAccess = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()");
|
||||
// The DDS_PSM_Cxx mapping (see cmake/MacroRTIDDSGen.cmake) gives generated
|
||||
// types accessor methods, so members are always reached via foo().
|
||||
if (!isOptional())
|
||||
return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
||||
QStringLiteral("element.") + memberAccess + cppToJsonPost();
|
||||
QStringLiteral("element.") + cppMemberName() + QStringLiteral("()") + cppToJsonPost();
|
||||
|
||||
const QString optionalAccess =
|
||||
isCppStruct() ? cppMemberName() + QStringLiteral(".is_set()") : cppMemberName() + QStringLiteral("().is_set()");
|
||||
const QString getValue = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()");
|
||||
return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") +
|
||||
return QStringLiteral("if (element.") + cppMemberName() + QStringLiteral("().is_set()) ") +
|
||||
QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
||||
QStringLiteral("*element.") + getValue + cppToJsonPost();
|
||||
QStringLiteral("element.") + cppMemberName() + QStringLiteral("().get()") + cppToJsonPost();
|
||||
}
|
||||
|
||||
QString MemberInformationWrapper::jsonElementToDds() const
|
||||
@@ -86,12 +84,8 @@ QString MemberInformationWrapper::jsonElementToDds() const
|
||||
if (isOptional())
|
||||
ret += QStringLiteral("if (!val.isNull()) ");
|
||||
|
||||
if (isCppStruct())
|
||||
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() +
|
||||
QStringLiteral("val") + cppFromJsonPost();
|
||||
else
|
||||
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral("(") + cppFromJsonPre2() +
|
||||
QStringLiteral("val") + cppFromJsonPost() + QStringLiteral(")");
|
||||
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral("(") + cppFromJsonPre2() +
|
||||
QStringLiteral("val") + cppFromJsonPost() + QStringLiteral(")");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -288,6 +288,8 @@ class FtcGenerator(object):
|
||||
def generate( self, outfile, parser ):
|
||||
outputHeader( outfile, parser, 'FTC' )
|
||||
outfile.write('\n')
|
||||
outfile.write('#include <DDS/FTC/generic_ftc_impl.h>\n')
|
||||
outfile.write('\n')
|
||||
outfile.write('namespace FTC\n')
|
||||
outfile.write('{\n')
|
||||
outfile.write('template <typename REQ, typename REP, typename DUMMY> class GenericFtcImpl;\n')
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
#include <LtsUtilsCore/data_modification_enum.h>
|
||||
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}.hpp>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_dtc_types.h>
|
||||
|
||||
// Bring Core namespace types into scope for Interface namespace
|
||||
using namespace {{ namespace }};
|
||||
// Bring DTC namespace types into scope for Interface namespace
|
||||
using namespace DTC;
|
||||
|
||||
namespace DDSConnector
|
||||
{
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
{% autoescape off %}
|
||||
// filename: {{ namespace_abbr }}_ftc_impl.h
|
||||
#pragma once
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_ftc.h>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_ftc_types.h>
|
||||
#include <{{ include_prefix }}/{{ namespace_abbr }}_ftc.h>
|
||||
#include <{{ include_prefix }}/logger.h>
|
||||
|
||||
#include <DDS/FTC/abstract_requester.h>
|
||||
|
||||
@@ -34,6 +34,8 @@ NGL_TARGET_LINK_LIBRARIES(LtsSessionDataDds
|
||||
PUBLIC
|
||||
$<$<BOOL:${BUILD_RTI}>:nddscore>
|
||||
$<$<BOOL:${BUILD_RTI}>:ddsQoS>
|
||||
# fournit dds::topic::topic_type_support<Core::*>::register_type
|
||||
$<$<BOOL:${BUILD_RTI}>:$<IF:$<TARGET_EXISTS:ddscore>,ddscore,>>
|
||||
NGLLogger
|
||||
Qt6::Core
|
||||
)
|
||||
@@ -47,8 +49,10 @@ IF(BUILD_RTI)
|
||||
)
|
||||
# ddscore target generates core_dtc_types.h
|
||||
ADD_DEPENDENCIES(LtsSessionDataDds ddscore)
|
||||
# PUBLIC : nddscore est lie en PUBLIC ci-dessus, donc "-lnddscore" se propage
|
||||
# aux consommateurs ; le repertoire de recherche doit se propager avec lui.
|
||||
NGL_TARGET_LINK_DIRECTORIES(LtsSessionDataDds
|
||||
PRIVATE
|
||||
PUBLIC
|
||||
${RTI_LIB_DIR}
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
@@ -183,8 +183,10 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
|
||||
#ifdef BUILD_RTI
|
||||
bool initInternal();
|
||||
void onPartitionTimeChangedInternal();
|
||||
static LtsSession::PartitionType toPartitionType(IDL::PartitionType idlType);
|
||||
static IDL::PartitionType toIdlPartitionType(LtsSession::PartitionType type);
|
||||
static ::LtsSession::PartitionType toPartitionType(IDL::PartitionType idlType);
|
||||
// NOTE: toIdlPartitionType est une fonction du namespace anonyme dans le .cpp
|
||||
// (partagee avec DdsConnectionContainer), pas un membre. La declarer ici la
|
||||
// masquait dans les methodes de la classe -> reference non definie a l'edition de liens.
|
||||
|
||||
// Member variables - only with RTI
|
||||
int m_exerciseId;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "ltstimelineclassic_export.h"
|
||||
#include "AbstractTimelineModel.h"
|
||||
#include "Range.h"
|
||||
|
||||
@@ -10,7 +11,7 @@
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
class EventDelegate : public QStyledItemDelegate
|
||||
class LTSTIMELINECLASSIC_EXPORT EventDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ltstimelineclassic_export.h"
|
||||
#include "EventList.h"
|
||||
#include "LineMap.h"
|
||||
#include "Range.h"
|
||||
@@ -14,7 +15,7 @@ class QStyleOptionViewItem;
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
class PassiveEventContainer : public QObject
|
||||
class LTSTIMELINECLASSIC_EXPORT PassiveEventContainer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "ltstimelineclassic_export.h"
|
||||
#include "EventTools.h"
|
||||
|
||||
#include <QtWidgets/QHeaderView>
|
||||
@@ -11,7 +12,7 @@ class QPainter;
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
class TimelineHeaderView : public QHeaderView
|
||||
class LTSTIMELINECLASSIC_EXPORT TimelineHeaderView : public QHeaderView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "ltstimelineclassic_export.h"
|
||||
#include "EventTools.h"
|
||||
#include "LineMap.h"
|
||||
|
||||
@@ -23,7 +24,7 @@ namespace LtsTimelineClassic
|
||||
|
||||
class TimelineIndicatorTest;
|
||||
|
||||
class TimelineIndicator : public QWidget
|
||||
class LTSTIMELINECLASSIC_EXPORT TimelineIndicator : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
#pragma once
|
||||
#include "ltstimelineclassic_export.h"
|
||||
#include "AbstractTimelineModel.h"
|
||||
#include "LineMap.h"
|
||||
#include "Range.h"
|
||||
@@ -13,7 +14,7 @@
|
||||
namespace LtsTimelineClassic
|
||||
{
|
||||
|
||||
class TimelineView : public QTreeView
|
||||
class LTSTIMELINECLASSIC_EXPORT TimelineView : public QTreeView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ TARGET_COMPILE_DEFINITIONS(ddscore PRIVATE
|
||||
RTI_UNIX
|
||||
RTI_LINUX
|
||||
RTI_64BIT
|
||||
MAKE_DDSCORE_LIB
|
||||
)
|
||||
|
||||
# Skip AUTOMOC for generated header - it will be processed manually with correct dependencies
|
||||
@@ -105,6 +106,7 @@ SET(SRCS_client
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcCoreClient SHARED ${SRCS_client})
|
||||
TARGET_COMPILE_DEFINITIONS(svcCoreClient PRIVATE MAKE_SVCCORECLIENT_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcCoreClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
// filename: core_dtc.h
|
||||
#pragma once
|
||||
|
||||
#include <compare>
|
||||
#include <QtCore/qcompare.h>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <functional>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Core
|
||||
{
|
||||
Pacemaker::Pacemaker(DDSConnector::DdsConnector *ddsConnector)
|
||||
: QObject(nullptr)
|
||||
, m_logger(NGL::INGLLoggerBootstrap::getNGLLogger("Core.Pacemaker"))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Core.Pacemaker"))
|
||||
{
|
||||
init(ddsConnector);
|
||||
}
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
|
||||
// Forward declarations for moc compatibility (moc doesn't see BUILD_RTI guards)
|
||||
namespace Core { enum class RunningState; enum class PortType; }
|
||||
#if !BUILD_RTI
|
||||
// Only needed when the generated core_dts_types.h (which defines this as an
|
||||
// alias template instantiation) is not available.
|
||||
namespace DTS { class CurrentRunningStateImpl; }
|
||||
#endif
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <dds/core/core_dts_types.h>
|
||||
#include <dds/core/types/CurrentRunningState.h>
|
||||
#include <Core/core_dts_types.h>
|
||||
#endif
|
||||
|
||||
namespace DDSConnector
|
||||
@@ -65,7 +68,7 @@ class CORE_CLIENT_EXPORT Pacemaker final : public QObject
|
||||
void addPortInternal(unsigned short number, Core::PortType portType,
|
||||
const QString& properties = QStringLiteral(""));
|
||||
|
||||
CurrentRunningState m_state;
|
||||
::Core::CurrentRunningState m_state;
|
||||
DTS::CurrentRunningStateImpl* m_dtsCurrentRunningState = nullptr;
|
||||
#else
|
||||
void* m_reserved1 = nullptr;
|
||||
|
||||
@@ -32,12 +32,12 @@ bool TopicLockMaster::init(const std::shared_ptr<DDSConnector::DdsConnector> &dd
|
||||
});
|
||||
|
||||
connect(m_coreDtc.get(), &Interface::Dtc::lockedEntityChanged, this,
|
||||
[this] (const LockedEntity &data, DataModification modType)
|
||||
[this] (const LockedEntity &data, ::DataModification modType)
|
||||
{
|
||||
key k(data.entityId(), data.exerciseId(), QString::fromStdString(data.entityTypeName()));
|
||||
if (modType == DataModification::eAdded)
|
||||
if (modType == ::DataModification::eAdded)
|
||||
m_lockedEntitys << k;
|
||||
else if (modType == DataModification::eRemoved)
|
||||
else if (modType == ::DataModification::eRemoved)
|
||||
m_lockedEntitys.remove(k);
|
||||
} );
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "svccoreclient_export.h"
|
||||
|
||||
#include <QtCore/QSet>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QObject>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <Core/core_dtc.h>
|
||||
@@ -70,7 +73,7 @@ public:
|
||||
private:
|
||||
QSet<key> m_lockedEntitys;
|
||||
#if BUILD_RTI
|
||||
std::shared_ptr<DDS::Core::Interface::Dtc> m_coreDtc;
|
||||
std::shared_ptr<::Core::Interface::Dtc> m_coreDtc;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -377,8 +377,13 @@ class GenericFtcImpl final : public GenericFtc<TOPICTYPE_REQUEST, TOPICTYPE_REPL
|
||||
{
|
||||
INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName();
|
||||
|
||||
// Qt 6's Q_ARG yields QMetaMethodArgument, which cannot be mixed with
|
||||
// the Qt 5 QArgument<T> used here. The topic type is registered under a
|
||||
// runtime name (see qRegisterMetaType above), so Q_ARG's stringified
|
||||
// type name is not usable; build the argument the way Q_ARG does.
|
||||
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection,
|
||||
QArgument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()),
|
||||
QtPrivate::Invoke::argument<ReplyTopic>(
|
||||
TopicNameHelper::replyTopicTypeName(), reply.data()),
|
||||
Q_ARG(int, request.uniqueId), Q_ARG(bool, !inProgress));
|
||||
}
|
||||
else
|
||||
@@ -503,6 +508,8 @@ class GenericFtcImpl final : public GenericFtc<TOPICTYPE_REQUEST, TOPICTYPE_REPL
|
||||
bool m_dying{false};
|
||||
std::string m_partitionType;
|
||||
int m_partitionId;
|
||||
// Declared after m_partitionId to match the constructor initialiser order.
|
||||
DDS::LOGGER_T m_logger;
|
||||
std::mutex m_requestMutex;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ NGL_TARGET_LINK_LIBRARIES(ddsfts
|
||||
ProjectConfig
|
||||
ddsQoS
|
||||
svcTabCommon
|
||||
svcCoreClient
|
||||
PUBLIC
|
||||
Qt6::Core
|
||||
RTI::nddsc
|
||||
|
||||
@@ -282,7 +282,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
|
||||
, m_dataReader(nullptr)
|
||||
, m_contentFilteredTopic(nullptr)
|
||||
, m_curInstanceHandle(dds::core::InstanceHandle::nil())
|
||||
, m_logger(NGL::getNGLLogger("connext.requester"))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("connext.requester"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -417,6 +417,8 @@ private:
|
||||
dds::sub::DataReader<REPLY> m_dataReader;
|
||||
dds::topic::ContentFilteredTopic<REPLY> m_contentFilteredTopic;
|
||||
dds::core::InstanceHandle m_curInstanceHandle;
|
||||
// Declared last to match the constructor initialiser order.
|
||||
NGL::INGLLogger& m_logger;
|
||||
};
|
||||
|
||||
template <typename REQUEST, typename REPLY> class Replier final : public ReplyRequestBase<REQUEST, REPLY>
|
||||
@@ -431,7 +433,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
|
||||
, m_dataReader(dds::sub::DataReader<REQUEST>(replierParams.subscriber(),
|
||||
ReplyRequestBase<REQUEST, REPLY>::m_requestTopic,
|
||||
replierParams.datareader_qos()))
|
||||
, m_logger(NGL::getNGLLogger("connext.replier"))
|
||||
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("connext.replier"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -500,6 +502,8 @@ private:
|
||||
connext::ReplierParams<REQUEST, REPLY> m_replierParams;
|
||||
dds::pub::DataWriter<REPLY> m_dataWriter;
|
||||
dds::sub::DataReader<REQUEST> m_dataReader;
|
||||
// Declared last to match the constructor initialiser order.
|
||||
NGL::INGLLogger& m_logger;
|
||||
};
|
||||
|
||||
} // namespace connext
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <dds/topic/find.hpp>
|
||||
#include <rti/core/xtypes/DynamicDataImpl.hpp>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
|
||||
namespace DDSGeneric
|
||||
{
|
||||
@@ -309,6 +310,19 @@ class DynamicDataReader final
|
||||
callbackFunc(sample.data(), topicName, sample.info());
|
||||
}
|
||||
|
||||
template<typename C>
|
||||
static bool isValid(const C& callbackFunc)
|
||||
{
|
||||
// Generic version for any type - checks if callable/non-null
|
||||
// Use simple pointer check for function pointers, true for other types
|
||||
if constexpr (std::is_pointer_v<C>)
|
||||
return callbackFunc != nullptr;
|
||||
else if constexpr (std::is_function_v<std::remove_pointer_t<C>>)
|
||||
return callbackFunc != nullptr;
|
||||
else
|
||||
return true; // Assume valid for functor objects, std::function, etc.
|
||||
}
|
||||
|
||||
static bool isValid(const SubscriberCallback& callbackFunc)
|
||||
{
|
||||
return callbackFunc != nullptr;
|
||||
|
||||
@@ -114,6 +114,10 @@ ENDIF()
|
||||
# Create svcPdmCommon library with common sources
|
||||
SET(PDM_COMMON_TARGET svcPdmCommon)
|
||||
NGL_ADD_LIBRARY(AAR SV WS HLA ${PDM_COMMON_TARGET} SHARED ${SRCS_common})
|
||||
SET_TARGET_PROPERTIES(${PDM_COMMON_TARGET} PROPERTIES
|
||||
CXX_VISIBILITY_PRESET default
|
||||
VISIBILITY_INLINES_HIDDEN OFF
|
||||
)
|
||||
generate_export_header(${PDM_COMMON_TARGET}
|
||||
EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/svcpdmcommon_export.h"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,7 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
FIND_PACKAGE(KDReports REQUIRED)
|
||||
FIND_PACKAGE(KDReports)
|
||||
|
||||
SET(ltsReportDisplay_SRCS
|
||||
lts_report_display_widget.h
|
||||
@@ -29,8 +29,13 @@ if(QT6_GUI_AVAILABLE)
|
||||
LtsWidgets
|
||||
PUBLIC
|
||||
${Qt6_Widgets}
|
||||
KDReports::KDReports
|
||||
)
|
||||
if(TARGET KDReports::KDReports)
|
||||
NGL_TARGET_LINK_LIBRARIES(LtsReportDisplay
|
||||
PUBLIC
|
||||
KDReports::KDReports
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(LtsReportDisplay
|
||||
PUBLIC
|
||||
|
||||
Reference in new issue
Block a user