- 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>
191 lines
4.7 KiB
C++
191 lines
4.7 KiB
C++
/**
|
|
* @file pre_dtc.h
|
|
* @brief DDS-generated Stub-Header für PresentationManagement DTC (Data Transfer Component)
|
|
*
|
|
* Dieser Header ist ein Stub für den von RTI DDS Generator erzeugten Header.
|
|
* Ermöglicht Build ohne echte DDS-Codegenerierung.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QtCore/QList>
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QString>
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
namespace PresentationManagement
|
|
{
|
|
|
|
// Forward declarations
|
|
struct Presentation;
|
|
struct PresentationContent;
|
|
struct GetPresentationContentReply;
|
|
|
|
// FileStatus Enum - Status einer Präsentation
|
|
enum class FileStatus : int { Valid = 0, Deleted = 1 };
|
|
|
|
// Presentation - DDS-generierter Typ für Präsentationen
|
|
struct Presentation
|
|
{
|
|
int32_t id = 0;
|
|
QString name;
|
|
QString description;
|
|
int32_t operatorId = 0;
|
|
qint64 lastModified = 0;
|
|
FileStatus fileStatus = FileStatus::Valid;
|
|
};
|
|
|
|
// PresentationContent - Inhalt einer Präsentation
|
|
struct PresentationContent
|
|
{
|
|
QString attributes;
|
|
QString channel;
|
|
QString description;
|
|
int32_t duration = 0;
|
|
double height = 0.0;
|
|
int32_t id = 0;
|
|
int32_t index = 0;
|
|
int32_t presentationId = 0;
|
|
QString presentationTopicType;
|
|
qint64 startTime = 0;
|
|
double width = 0.0;
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
};
|
|
|
|
// GetPresentationContentReply - Reply für GetPresentationContent Request
|
|
struct GetPresentationContentReply
|
|
{
|
|
QList<PresentationContent> content;
|
|
};
|
|
|
|
namespace Interface
|
|
{
|
|
|
|
/**
|
|
* @brief Dtc - Data Transfer Component für Presentation Management
|
|
*
|
|
* DDS-generierte Klasse mit Präsentation-Daten und Signalen für Änderungen.
|
|
*/
|
|
class Dtc : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Dtc() = default;
|
|
~Dtc() override = default;
|
|
|
|
// Präsentations-Liste abrufen (Callback-basiert)
|
|
void presentations(const std::function<void(const Presentation&)>& callback) const
|
|
{
|
|
for (const auto& p : m_presentations)
|
|
{
|
|
callback(p);
|
|
}
|
|
}
|
|
|
|
// Präsentations-Liste als QList (für direkten Zugriff)
|
|
QList<Presentation> presentationsList() const
|
|
{
|
|
return m_presentations;
|
|
}
|
|
|
|
// Präsentation hinzufügen/entfernen/ändern
|
|
void addPresentation(const Presentation& p)
|
|
{
|
|
m_presentations.append(p);
|
|
emit presentationChanged(p, 0); // 0 = added
|
|
}
|
|
|
|
void updatePresentation(const Presentation& p)
|
|
{
|
|
for (auto& existing : m_presentations)
|
|
{
|
|
if (existing.id == p.id)
|
|
{
|
|
existing = p;
|
|
emit presentationChanged(p, 1); // 1 = modified
|
|
return;
|
|
}
|
|
}
|
|
addPresentation(p);
|
|
}
|
|
|
|
void removePresentation(int id)
|
|
{
|
|
for (auto it = m_presentations.begin(); it != m_presentations.end(); ++it)
|
|
{
|
|
if (it->id == id)
|
|
{
|
|
Presentation removed = *it;
|
|
m_presentations.erase(it);
|
|
emit presentationChanged(removed, 2); // 2 = removed
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Content getter/setter für PresentationContent
|
|
void content(const std::function<void(const PresentationContent&)>& callback) const
|
|
{
|
|
for (const auto& c : m_content)
|
|
{
|
|
callback(c);
|
|
}
|
|
}
|
|
|
|
QList<PresentationContent> contentList() const
|
|
{
|
|
return m_content;
|
|
}
|
|
|
|
void setContent(const QList<PresentationContent>& content)
|
|
{
|
|
m_content = content;
|
|
}
|
|
|
|
signals:
|
|
// Signal für Präsentations-Änderungen
|
|
void presentationChanged(const Presentation& presentation, int modificationType);
|
|
|
|
private:
|
|
QList<Presentation> m_presentations;
|
|
QList<PresentationContent> m_content;
|
|
};
|
|
|
|
/**
|
|
* @brief Ftc - Filter Topic Client für Presentation Management
|
|
*
|
|
* DDS-generierte Klasse für Presentation-Client-Operationen.
|
|
*/
|
|
class Ftc
|
|
{
|
|
public:
|
|
using ModifyTypeReplyHandler = std::function<void(bool success)>;
|
|
|
|
virtual ~Ftc() = default;
|
|
|
|
/**
|
|
* @brief Factory-Methode zur Erstellung einer Ftc-Instanz
|
|
* @param connector DDS-Connector (wird im Stub ignoriert)
|
|
* @return Shared Pointer zur Ftc-Instanz (nullptr im Stub)
|
|
*/
|
|
static std::shared_ptr<Ftc> create(void* /*connector*/)
|
|
{
|
|
return nullptr; // Stub returns nullptr - actual implementation requires DDS
|
|
}
|
|
|
|
// PresentationModify Reply Handler
|
|
virtual void presentationModifyReply(ModifyTypeReplyHandler handler) = 0;
|
|
|
|
// PresentationRemove Reply Handler
|
|
virtual void presentationRemoveReply(ModifyTypeReplyHandler handler) = 0;
|
|
|
|
// GetPresentationContent Reply Handler
|
|
virtual void getPresentationContentReply(const GetPresentationContentReply& reply) = 0;
|
|
};
|
|
|
|
} // namespace Interface
|
|
} // namespace PresentationManagement
|