Migration of Legatus codebase to Qt6 with RTI Connext DDS 7.7 integration is partially complete. Core DDS targets build successfully, but ProjectDataManagement module blocks full ddsfts compilation due to IDL definition conflicts.
This commit is contained in:
256 files changed
+1170
-610
No files matched your search
@@ -123,6 +123,7 @@ IF(BUILD_GRANTLEE AND TARGET KF6::TextTemplate)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_grantlee
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_BINARY_DIR}/Z/src/NGLLogger
|
||||
)
|
||||
|
||||
# Smoke-test: parse all .grantlee templates in this directory to detect parse/render regressions
|
||||
|
||||
@@ -859,7 +859,7 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation& mi) const
|
||||
QStringLiteral("static_cast<") + svcName + mi.enumeration->enumName + QStringLiteral(">(");
|
||||
mi.cpp.fromVariantPost = QStringLiteral(".toInt())");
|
||||
mi.cpp.toVariantPre = QStringLiteral("static_cast<int>(");
|
||||
mi.cpp.toVariantPost.clear();
|
||||
mi.cpp.toVariantPost = QStringLiteral(")");
|
||||
mi.cpp.toJsonPre = QStringLiteral("toJson(static_cast<int>(");
|
||||
mi.cpp.toJsonPost = QStringLiteral("))");
|
||||
if (!mi.enumeration->values.isEmpty())
|
||||
|
||||
@@ -186,6 +186,8 @@ class DtcGenerator(object):
|
||||
def generate( self, outfile, parser ):
|
||||
outputHeader( outfile, parser, 'DTC' )
|
||||
outfile.write('\n')
|
||||
outfile.write('#include <DDS/Generic/generic_data_reader.h>\n')
|
||||
outfile.write('\n')
|
||||
outfile.write('/**\n')
|
||||
outfile.write(' * Type definitions \n')
|
||||
outfile.write(' * => DataTopicClients (DTCs)\n')
|
||||
@@ -462,13 +464,13 @@ def main():
|
||||
generate(parser, OperatorRightsSql(), os.path.join(out_dir, parser.service_abbr + '_operator_rights.sql'))
|
||||
elif option_str == "ALL":
|
||||
out_dir = sys.argv[3]
|
||||
fn = parser.service_abbr + '_%s_types.h'
|
||||
fn = out_dir + '/' + parser.service_abbr + '_%s_types.h'
|
||||
generate(parser, DtsGenerator(), fn % 'dts')
|
||||
generate(parser, DtcGenerator(), fn % 'dtc')
|
||||
generate(parser, FtsGenerator(), fn % 'fts')
|
||||
generate(parser, FtcGenerator(), fn % 'ftc')
|
||||
generate(parser, OperatorRights(), parser.service_abbr + '_operator_rights.h')
|
||||
generate(parser, OperatorRightsCpp(), parser.service_abbr + '_operator_rights.cpp')
|
||||
generate(parser, OperatorRights(), out_dir + '/' + parser.service_abbr + '_operator_rights.h')
|
||||
generate(parser, OperatorRightsCpp(), out_dir + '/' + parser.service_abbr + '_operator_rights.cpp')
|
||||
else:
|
||||
usage("invalid option '%s'" % option_str)
|
||||
sys.exit(0)
|
||||
|
||||
@@ -30,6 +30,23 @@ QString fixupEmptyJsonString(const QString &str)
|
||||
return str.isEmpty() ? QStringLiteral("{}") : str;
|
||||
}
|
||||
|
||||
// Basic type toJson overloads
|
||||
QJsonValue toJson(int val)
|
||||
{
|
||||
return QJsonValue(val);
|
||||
}
|
||||
QJsonValue toJson(double val)
|
||||
{
|
||||
return QJsonValue(val);
|
||||
}
|
||||
QJsonValue toJson(qint64 val)
|
||||
{
|
||||
return QJsonValue(QString::number(val));
|
||||
}
|
||||
QJsonValue toJson(const std::string &val)
|
||||
{
|
||||
return QJsonValue(QString::fromStdString(val));
|
||||
}
|
||||
|
||||
// QPointF
|
||||
QJsonValue toJson(const QPointF &element)
|
||||
|
||||
@@ -9,7 +9,9 @@ option(BUILD_GTEST_SMOKE "Build GTest smoke tests" OFF)
|
||||
add_subdirectory(mocks)
|
||||
|
||||
if(BUILD_SMOKE_TESTS)
|
||||
find_package(Qt6 REQUIRED COMPONENTS Test)
|
||||
if(NOT TARGET Qt6::Test)
|
||||
find_package(Qt6 REQUIRED COMPONENTS Test)
|
||||
endif()
|
||||
add_executable(coordTransTests_smoke coordTransTests_smoke.cpp)
|
||||
target_link_libraries(coordTransTests_smoke PRIVATE Qt6::Test MockCoordTrans::MockCoordTrans)
|
||||
add_test(NAME coordTransTests_smoke COMMAND coordTransTests_smoke)
|
||||
|
||||
@@ -13,24 +13,8 @@ else()
|
||||
set(Qt6_Gui "")
|
||||
endif()
|
||||
|
||||
|
||||
OPTION(BUILD_RTI "Build with RTI Connext DDS support" ON)
|
||||
|
||||
# Find RTI Connext DDS - manual configuration (no CMake config file available)
|
||||
IF(BUILD_RTI)
|
||||
SET(RTI_BASE_DIR "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
|
||||
SET(RTI_INCLUDE_DIR "${RTI_BASE_DIR}/include")
|
||||
SET(RTI_LIB_DIR "${RTI_BASE_DIR}/lib/x64Linux4gcc8.5.0")
|
||||
|
||||
# Check if RTI directories exist
|
||||
IF(EXISTS "${RTI_INCLUDE_DIR}" AND EXISTS "${RTI_LIB_DIR}")
|
||||
MESSAGE(STATUS "Using RTI Connext DDS from ${RTI_BASE_DIR}")
|
||||
SET(BUILD_RTI ON)
|
||||
ELSE()
|
||||
MESSAGE(WARNING "RTI Connext DDS not found at ${RTI_BASE_DIR}, building without RTI support")
|
||||
SET(BUILD_RTI OFF)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# BUILD_RTI is set by parent CMakeLists.txt - do not override here
|
||||
# RTI paths are also set by parent and imported targets are available
|
||||
|
||||
# LtsSessionDataDds (always built, with stub implementation for non-RTI builds)
|
||||
SET(LtsSessionDataDds_SRCS
|
||||
@@ -58,7 +42,11 @@ IF(BUILD_RTI)
|
||||
PUBLIC
|
||||
${RTI_INCLUDE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/Lts
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
${CMAKE_BINARY_DIR}/Lts/DDS
|
||||
)
|
||||
# ddscore target generates core_dtc_types.h
|
||||
ADD_DEPENDENCIES(LtsSessionDataDds ddscore)
|
||||
NGL_TARGET_LINK_DIRECTORIES(LtsSessionDataDds
|
||||
PRIVATE
|
||||
${RTI_LIB_DIR}
|
||||
|
||||
@@ -74,7 +74,7 @@ class DdsConnectionContainer
|
||||
for (int i = ddsConnections.size() - 1; i >= 0; --i)
|
||||
{
|
||||
const DdsConnection& conn = ddsConnections.at(i);
|
||||
if (conn.partitionType != IDL::PartitionType::Global)
|
||||
if (toIdlPartitionType(conn.partitionType) != IDL::PartitionType::Global)
|
||||
continue;
|
||||
auto ret = conn.ddsConnector.lock();
|
||||
if (ret != nullptr)
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
|
||||
#ifdef BUILD_RTI
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
#include "INGLLogger.h"
|
||||
#include "DDS/Core/core_dtc_types.h"
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "Core/core.hpp"
|
||||
#include "Core/core_dtc_types.h"
|
||||
#include "Lts/Common/ProjectConfig/project_defines.h"
|
||||
namespace DDSConnector { class DdsConnector; }
|
||||
namespace DTC { template<typename T> class GenericDTCImpl; }
|
||||
namespace DataPluginBase { class Interface; }
|
||||
namespace GuiPluginBase { class Interface; }
|
||||
#else
|
||||
@@ -165,8 +167,8 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
|
||||
return true;
|
||||
}
|
||||
val.reset();
|
||||
if (m_logger.isDebug())
|
||||
m_logger.debug() << "Cannot find foreign gui ifc " << typeid(S).name() << " in " << toString();
|
||||
if (m_logger.isDebugEnabled())
|
||||
DEBUG_LOG(m_logger) << "Cannot find foreign gui ifc " << typeid(S).name() << " in " << toString();
|
||||
#else
|
||||
val.reset();
|
||||
#endif
|
||||
@@ -182,6 +184,7 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
|
||||
bool initInternal();
|
||||
void onPartitionTimeChangedInternal();
|
||||
static LtsSession::PartitionType toPartitionType(IDL::PartitionType idlType);
|
||||
static IDL::PartitionType toIdlPartitionType(LtsSession::PartitionType type);
|
||||
|
||||
// Member variables - only with RTI
|
||||
int m_exerciseId;
|
||||
@@ -191,7 +194,7 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
|
||||
Fetcher* m_fetcher;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorGlobal;
|
||||
std::shared_ptr<DTC::GenericDTCImpl<Core::PartitionTime>> m_dtcPartitionTime;
|
||||
std::shared_ptr<DTC::PartitionTime> m_dtcPartitionTime;
|
||||
NGL::INGLLogger& m_logger;
|
||||
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> m_dataPluginInterfaces;
|
||||
QMap<QString, std::shared_ptr<GuiPluginBase::Interface>> m_guiPluginInterfaces;
|
||||
|
||||
@@ -4,55 +4,55 @@
|
||||
# $Author$
|
||||
#
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
# DataPluginInterface
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
DataPluginInterface
|
||||
ADD_LIBRARY(DataPluginInterface SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/data_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
Qt6::Core
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/data_plugin_interface.cpp
|
||||
)
|
||||
set_target_properties(DataPluginInterface PROPERTIES AUTOMOC ON)
|
||||
TARGET_INCLUDE_DIRECTORIES(DataPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
TARGET_LINK_LIBRARIES(DataPluginInterface PUBLIC Qt6::Core)
|
||||
|
||||
# GuiPluginInterface
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
GuiPluginInterface
|
||||
ADD_LIBRARY(GuiPluginInterface SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gui_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
Qt6::Core LtsWidgets ProjectConfig LtsAppDescriptor LtsUtilsCore
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gui_plugin_interface.cpp
|
||||
)
|
||||
set_target_properties(GuiPluginInterface PROPERTIES AUTOMOC ON)
|
||||
TARGET_INCLUDE_DIRECTORIES(GuiPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
TARGET_LINK_LIBRARIES(GuiPluginInterface PUBLIC Qt6::Core LtsWidgets ProjectConfig LtsAppDescriptor LtsUtilsCore)
|
||||
|
||||
# projectPluginInterface
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
ProjectPluginInterface
|
||||
ADD_LIBRARY(ProjectPluginInterface SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/project_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
Qt6::Core
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/project_plugin_interface.cpp
|
||||
)
|
||||
set_target_properties(ProjectPluginInterface PROPERTIES AUTOMOC ON)
|
||||
TARGET_INCLUDE_DIRECTORIES(ProjectPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
TARGET_LINK_LIBRARIES(ProjectPluginInterface PUBLIC Qt6::Core)
|
||||
|
||||
# stylePluginInterface
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
StylePluginInterface
|
||||
ADD_LIBRARY(StylePluginInterface SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/style_plugin_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
Qt6::Core
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/style_plugin_interface.cpp
|
||||
)
|
||||
set_target_properties(StylePluginInterface PROPERTIES AUTOMOC ON)
|
||||
TARGET_INCLUDE_DIRECTORIES(StylePluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
TARGET_LINK_LIBRARIES(StylePluginInterface PUBLIC Qt6::Core)
|
||||
|
||||
# record_replay_plugin
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
RecordReplayPlugin
|
||||
ADD_LIBRARY(RecordReplayPlugin SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
Qt6::Core
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.cpp
|
||||
)
|
||||
set_target_properties(RecordReplayPlugin PROPERTIES AUTOMOC ON)
|
||||
TARGET_INCLUDE_DIRECTORIES(RecordReplayPlugin PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||
TARGET_LINK_LIBRARIES(RecordReplayPlugin PUBLIC Qt6::Core)
|
||||
|
||||
# Topic Replay Interface
|
||||
ADD_INTERFACE_LIBRARY(
|
||||
TopicReplayInterface
|
||||
ADD_LIBRARY(TopicReplayInterface SHARED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
Qt6::Core
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.cpp
|
||||
)
|
||||
TARGET_INCLUDE_DIRECTORIES(TopicReplayInterface PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||
${CMAKE_BINARY_DIR}/Lts/Common/TopicEditorBase # topiceditorbase_export.h
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(TopicReplayInterface PUBLIC Qt6::Core TopicEditorBase)
|
||||
@@ -21,8 +21,7 @@ namespace DataPluginBase
|
||||
|
||||
class Interface
|
||||
{
|
||||
public:
|
||||
Interface() = default;
|
||||
public:
|
||||
virtual ~Interface() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
#include <LtsWidgets/lts_base.h>
|
||||
#include <ProjectConfig/project_defines.h>
|
||||
#include <QtCore/QFlags>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QVector>
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
|
||||
namespace NGL
|
||||
@@ -33,8 +33,9 @@ class Interface;
|
||||
|
||||
class Plugin
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
Plugin() = default;
|
||||
virtual ~Plugin() = default;
|
||||
|
||||
virtual QString pluginName() = 0;
|
||||
|
||||
+5
-3
@@ -2,14 +2,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
|
||||
namespace ProjectPlugin
|
||||
{
|
||||
|
||||
class Plugin
|
||||
{
|
||||
public:
|
||||
Plugin() = default;
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
virtual ~Plugin() = default;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QObject>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
@@ -19,8 +19,9 @@ namespace RecordReplay
|
||||
{
|
||||
class RecordReplayPlugin
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
RecordReplayPlugin() = default;
|
||||
virtual ~RecordReplayPlugin() = default;
|
||||
|
||||
virtual QString pluginName() const = 0;
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QObject>
|
||||
|
||||
namespace StylePlugin
|
||||
{
|
||||
class Plugin
|
||||
{
|
||||
Q_GADGET
|
||||
|
||||
public:
|
||||
Plugin() = default;
|
||||
virtual ~Plugin() = default;
|
||||
|
||||
virtual void loadStyle(bool highDpi) = 0;
|
||||
|
||||
@@ -46,6 +46,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(TopicEditorBase
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
${CMAKE_CURRENT_BINARY_DIR}/../ # auto-export file
|
||||
${CMAKE_BINARY_DIR}/Z/src/NGLLogger # ngllogger_export.h
|
||||
)
|
||||
|
||||
if(QT6_GUI_AVAILABLE)
|
||||
|
||||
@@ -219,7 +219,8 @@ QColor topicTypeColor(TopicType topicType)
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, TopicType topicType)
|
||||
{
|
||||
stream << "TopicType::" << topicTypeString(topicType).toStdString().c_str();
|
||||
const std::string str = std::string("TopicType::") + topicTypeString(topicType).toStdString();
|
||||
stream << str;
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -274,7 +275,7 @@ QJsonObject TopicData::toJson() const
|
||||
|
||||
QDataStream& operator<<(QDataStream& stream, const TopicData& data)
|
||||
{
|
||||
const QByteArray properties = QJsonDocument(data.properties).toBinaryData();
|
||||
const QByteArray properties = QJsonDocument(data.properties).toJson(QJsonDocument::Compact);
|
||||
stream << data.id << static_cast<quint8>(data.topicType) << data.startTime << data.duration << data.state
|
||||
<< data.index << properties << data.description << data.channel << data.parentChannel << data.x << data.y
|
||||
<< data.w << data.h;
|
||||
@@ -288,7 +289,7 @@ QDataStream& operator>>(QDataStream& stream, TopicData& data)
|
||||
stream >> data.id >> topicType >> data.startTime >> data.duration >> data.state >> data.index >> properties >>
|
||||
data.description >> data.channel >> data.parentChannel >> data.x >> data.y >> data.w >> data.h;
|
||||
data.topicType = static_cast<TopicType>(topicType);
|
||||
data.properties = QJsonDocument::fromBinaryData(properties).object();
|
||||
data.properties = QJsonDocument::fromJson(properties).object();
|
||||
return stream;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user