- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
177 lines
5.0 KiB
C++
177 lines
5.0 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* DDS specific parts for a session
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*
|
|
* Created by Christian Ehrlicher, SLSE, 2017-02-27
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QStringList>
|
|
#include <QtCore/QUrl>
|
|
#include <memory>
|
|
|
|
#include <QtCore/QMap>
|
|
|
|
// Export macro for shared library
|
|
#include "ltssessiondatadds_export.h"
|
|
|
|
#ifdef BUILD_RTI
|
|
#include <dds/domain/DomainParticipant.hpp>
|
|
namespace DDSConnector { class DdsConnector; }
|
|
namespace DTC { template<typename T> class GenericDTCImpl; }
|
|
namespace Core { struct PartitionTime; }
|
|
namespace NGL { class INGLLogger; }
|
|
class Fetcher;
|
|
#else
|
|
// Forward declarations for stub types
|
|
namespace DataPluginBase { struct Interface; }
|
|
#endif
|
|
|
|
namespace LtsSession
|
|
{
|
|
|
|
// Stub enum for PartitionType
|
|
enum class PartitionType {
|
|
Any = 0,
|
|
Exercise,
|
|
Replay,
|
|
AllExercises,
|
|
Global,
|
|
Invalid = -1
|
|
};
|
|
|
|
struct DdsConnectionParams
|
|
{
|
|
int domainId = -1;
|
|
int partitionId = 0;
|
|
int exerciseId = 0;
|
|
PartitionType partitionType = PartitionType::Any;
|
|
QUrl tcpConnectionUrl;
|
|
QStringList qos_file;
|
|
|
|
DdsConnectionParams() = default;
|
|
|
|
bool isValid() const
|
|
{
|
|
return domainId >= 0 && partitionType != PartitionType::Any;
|
|
}
|
|
|
|
bool operator==(const DdsConnectionParams& o) const
|
|
{
|
|
return domainId == o.domainId && partitionId == o.partitionId && exerciseId == o.exerciseId &&
|
|
qos_file == o.qos_file && partitionType == o.partitionType && tcpConnectionUrl == o.tcpConnectionUrl;
|
|
}
|
|
|
|
bool operator!=(const DdsConnectionParams& o) const
|
|
{
|
|
return !operator==(o);
|
|
}
|
|
|
|
bool operator<(const DdsConnectionParams& o) const
|
|
{
|
|
if (domainId != o.domainId)
|
|
return domainId < o.domainId;
|
|
if (partitionId != o.partitionId)
|
|
return partitionId < o.partitionId;
|
|
if (exerciseId != o.exerciseId)
|
|
return exerciseId < o.exerciseId;
|
|
if (qos_file != o.qos_file)
|
|
return qos_file < o.qos_file;
|
|
if (partitionType != o.partitionType)
|
|
return partitionType < o.partitionType;
|
|
return tcpConnectionUrl.toString() < o.tcpConnectionUrl.toString();
|
|
}
|
|
|
|
#ifdef BUILD_RTI
|
|
bool hasSameDomainParams(const DdsConnectionParams& o) const
|
|
{
|
|
return domainId == o.domainId && partitionType == o.partitionType;
|
|
}
|
|
#endif
|
|
};
|
|
|
|
// Base class for session DDS data - always compiled, but RTI functionality guarded
|
|
class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit LtsSessionDataDds(QObject* parent = nullptr);
|
|
~LtsSessionDataDds();
|
|
|
|
// Initialization
|
|
#ifdef BUILD_RTI
|
|
bool init(const DdsConnectionParams& connParams);
|
|
bool init(const dds::domain::DomainParticipant& dp, const DdsConnectionParams& connParams);
|
|
Fetcher* fetcher(const QString& yourPluginsName);
|
|
#else
|
|
virtual bool init(const DdsConnectionParams& connParams);
|
|
virtual bool init(const void* dp, const DdsConnectionParams& connParams);
|
|
virtual void* fetcher(const QString& yourPluginsName);
|
|
#endif
|
|
|
|
// Accessors
|
|
int domainId() const;
|
|
int exerciseId() const;
|
|
int partitionId() const;
|
|
PartitionType partitionType() const;
|
|
static QString partitionTypeString(PartitionType partitionType);
|
|
QStringList qosFile() const;
|
|
QUrl tcpConnectionUrl() const;
|
|
DdsConnectionParams connParams() const;
|
|
|
|
bool isExercisePartition() const { return partitionType() == PartitionType::Exercise; }
|
|
bool isReplayPartition() const { return partitionType() == PartitionType::Replay; }
|
|
|
|
QString toString() const;
|
|
|
|
qint64 partitionTime() const { return m_emittedTime; }
|
|
|
|
// Data plugin interfaces
|
|
#ifdef BUILD_RTI
|
|
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> availableDataPluginInterfaces() const;
|
|
void addAvailablaeDataPluginInterfaces(const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins);
|
|
#else
|
|
// Stub returns empty map - void* doesn't work well in QMap template
|
|
QMap<QString, void*> availableDataPluginInterfaces() const { return QMap<QString, void*>(); }
|
|
void addAvailablaeDataPluginInterfaces(const QMap<QString, void*>& /*dataPlugins*/) {}
|
|
#endif
|
|
|
|
signals:
|
|
void partitionTimeChanged(qint64 newPartitionTime);
|
|
void partitionTimeChangedInternal();
|
|
|
|
protected:
|
|
#ifdef BUILD_RTI
|
|
bool initInternal();
|
|
void onPartitionTimeChangedInternal();
|
|
|
|
// Member variables - only with RTI
|
|
int m_exerciseId;
|
|
qint64 m_emittedTime;
|
|
qint64 m_curMSecSinceEpoch;
|
|
bool m_active;
|
|
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;
|
|
NGL::INGLLogger& m_logger;
|
|
#else
|
|
// Stub implementation - minimal members
|
|
bool initInternal();
|
|
void onPartitionTimeChangedInternal();
|
|
|
|
int m_exerciseId;
|
|
qint64 m_emittedTime;
|
|
qint64 m_curMSecSinceEpoch;
|
|
bool m_active;
|
|
void* m_fetcher;
|
|
#endif
|
|
};
|
|
|
|
} // namespace LtsSession
|