- cmake/FindRTI.cmake: Add INTERFACE placeholder targets when RTI not found - cmake/FindRTI.cmake: Force BUILD_RTI=OFF when RTI not installed - Lts/Common/LtsSession/CMakeLists.txt: Make LtsSessionDataDds conditional on BUILD_RTI - Lts/Viewer/CMakeLists.txt: Make LtsDataView conditional on BUILD_RTI - Lts/Plugins/*/CMakeLists.txt: 97 plugin files wrapped in BUILD_RTI conditionals - cmake/NGLMacros.cmake: Fix NGL_ADD_BIG_RESOURCES macro (removed premature return()) - Multiple Qt6 API fixes: QLinkedList→std::list, QStringRef→QStringView, etc. - BUILD_RTI_FIXES_SUMMARY.md: Comprehensive documentation of all fixes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
140 lines
3.2 KiB
C++
140 lines
3.2 KiB
C++
#pragma once
|
|
// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
|
|
// Für die Migration erstellen wir minimale Typ-Definitionen
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QList>
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
|
|
// Forward declarations
|
|
struct Participant;
|
|
struct Party;
|
|
struct ParticipantPosition;
|
|
struct DynamicParticipantData;
|
|
struct MainSchedule;
|
|
|
|
// DataModification Enum - gibt Art der Datenänderung an
|
|
enum class DataModification : int {
|
|
eAdded = 0,
|
|
eModified = 1,
|
|
eRemoved = 2
|
|
};
|
|
|
|
// Participant - Basisdaten eines Teilnehmers
|
|
struct Participant {
|
|
int id = 0;
|
|
QString internalName;
|
|
QString externalName;
|
|
int partyId = 0;
|
|
bool isVerbund = false;
|
|
int superiorId = 0;
|
|
|
|
// Additional fields as needed
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
double z = 0.0;
|
|
double heading = 0.0;
|
|
};
|
|
|
|
// Party - Gruppe/Organisation von Teilnehmern
|
|
struct Party {
|
|
int id = 0;
|
|
QString name;
|
|
QString shortName;
|
|
};
|
|
|
|
// ParticipantPosition - Position eines Teilnehmers
|
|
struct ParticipantPosition {
|
|
int participantId = 0;
|
|
double x = 0.0;
|
|
double y = 0.0;
|
|
double z = 0.0;
|
|
double heading = 0.0;
|
|
double speed = 0.0;
|
|
qint64 timestamp = 0;
|
|
};
|
|
|
|
// DynamicParticipantData - Dynamische Teilnehmerdaten
|
|
struct DynamicParticipantData {
|
|
int participantId = 0;
|
|
QString status;
|
|
QString role;
|
|
qint64 lastUpdate = 0;
|
|
};
|
|
|
|
// MainSchedule - Stub für DDS-generierten Typ
|
|
struct MainSchedule {
|
|
int32_t id = 0;
|
|
QString name;
|
|
QString description;
|
|
qint64 startTime = 0;
|
|
qint64 endTime = 0;
|
|
bool isActive = false;
|
|
};
|
|
|
|
namespace Interface
|
|
{
|
|
|
|
// Dtc - Data Transfer Component für Participant Management
|
|
// DDS-generierte Klasse mit participantChanged Signal
|
|
class Dtc : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Dtc() = default;
|
|
~Dtc() override = default;
|
|
|
|
// Teilnehmer-Liste abrufen (Callback-basiert wie im Original)
|
|
void participants(const std::function<void(const Participant&)>& callback) const {
|
|
for (const auto& p : m_participants) {
|
|
callback(p);
|
|
}
|
|
}
|
|
|
|
// Teilnehmer-Liste als QList (für direkten Zugriff)
|
|
QList<Participant> participantsList() const { return m_participants; }
|
|
|
|
// Teilnehmer hinzufügen/entfernen/ändern
|
|
void addParticipant(const Participant& p) {
|
|
m_participants.append(p);
|
|
emit participantChanged(p, DataModification::eAdded);
|
|
}
|
|
|
|
void updateParticipant(const Participant& p) {
|
|
for (auto& existing : m_participants) {
|
|
if (existing.id == p.id) {
|
|
existing = p;
|
|
emit participantChanged(p, DataModification::eModified);
|
|
return;
|
|
}
|
|
}
|
|
addParticipant(p);
|
|
}
|
|
|
|
void removeParticipant(int id) {
|
|
for (auto it = m_participants.begin(); it != m_participants.end(); ++it) {
|
|
if (it->id == id) {
|
|
Participant removed = *it;
|
|
m_participants.erase(it);
|
|
emit participantChanged(removed, DataModification::eRemoved);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
signals:
|
|
// Signal für Teilnehmer-Änderungen
|
|
void participantChanged(const Participant& participant, DataModification modificationType);
|
|
|
|
private:
|
|
QList<Participant> m_participants;
|
|
};
|
|
|
|
} // namespace Interface
|
|
|
|
} // namespace ParticipantManagement
|