- CMakeLists.txt: Conditional compilation für BUILD_RTI=ON/OFF - lts_session_stub.h/cpp: NEU - STUB-Implementation ohne RTI-Abhängigkeit - lts_session_data_dds_stub.h: Doppeltes Namespace-Closing entfernt - gna_nasat_aircraft.h: participantId zu participantIdValue umbenannt (Konflikt) - gna_dtc.h: Doppeldefinitionen entfernt - gna_nasat_aircraft_participant.h: Doppeldefinitionen entfernt - ppm_enums.hpp: DataModification-Enum im ParticipantManagement-Namespace - ElevationMap-STUB: ArcGIS-Abhängigkeit für BUILD_RTI=OFF gekapselt - Viewer-STUB: Header für BUILD_RTI=OFF Build Build-Validierung: Configure erfolgreich, LtsSession-Fehler behoben
74 lines
1.8 KiB
C++
74 lines
1.8 KiB
C++
#pragma once
|
|
|
|
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
|
// Für die Migration erstellen wir minimale Typ-Definitionen
|
|
|
|
#include "exm_exercise.h"
|
|
#include "ParticipantManagement/ppm_enums.hpp"
|
|
|
|
#include <QObject>
|
|
#include <QList>
|
|
#include <functional>
|
|
|
|
namespace ExerciseManagement
|
|
{
|
|
|
|
namespace Interface
|
|
{
|
|
|
|
// Dtc - Data Transfer Component für Exercise Management
|
|
class Dtc : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Dtc() = default;
|
|
~Dtc() override = default;
|
|
|
|
// Exercise-Liste abrufen (Callback-basiert)
|
|
void exercises(const std::function<void(const Exercise&)>& callback) const {
|
|
for (const auto& ex : m_exercises) {
|
|
callback(ex);
|
|
}
|
|
}
|
|
|
|
// Exercise-Liste als QList
|
|
QList<Exercise> exercisesList() const { return m_exercises; }
|
|
|
|
// Exercise hinzufügen/entfernen/ändern
|
|
void addExercise(const Exercise& ex) {
|
|
m_exercises.append(ex);
|
|
emit exerciseChanged(ex, ParticipantManagement::DataModification::eAdded);
|
|
}
|
|
|
|
void updateExercise(const Exercise& ex) {
|
|
for (auto& existing : m_exercises) {
|
|
if (existing.id == ex.id) {
|
|
existing = ex;
|
|
emit exerciseChanged(ex, ParticipantManagement::DataModification::eModified);
|
|
return;
|
|
}
|
|
}
|
|
addExercise(ex);
|
|
}
|
|
|
|
void removeExercise(int id) {
|
|
for (auto it = m_exercises.begin(); it != m_exercises.end(); ++it) {
|
|
if (it->id == id) {
|
|
Exercise removed = *it;
|
|
m_exercises.erase(it);
|
|
emit exerciseChanged(removed, ParticipantManagement::DataModification::eRemoved);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
signals:
|
|
void exerciseChanged(const Exercise& exercise, ParticipantManagement::DataModification modificationType);
|
|
|
|
private:
|
|
QList<Exercise> m_exercises;
|
|
};
|
|
|
|
} // namespace Interface
|
|
} // namespace ExerciseManagement
|