Qt6-Migration: Type-Struct, DataModification und Signal/Slot Korrekturen
- ppm.hpp: Type-Methoden von id()/typeClass() zu getId()/getTypeClass() umbenannt (Vermeidung von Namenskonflikt mit Member-Variablen) - ppm.hpp: TypeClass::eUndefined zu TypeClass::eUninitialized geändert - ppm.hpp: operator<< für Type-Struct hinzugefügt (für INGLLogger) - ppm_enums.hpp: DataModification, TypeClass, SymbolAppearance, SymbolVisibility Enums - ppm_enums.hpp: operator<< für TypeClass hinzugefügt - exm_dtc.h: #include ppm_enums.hpp für DataModification - exm_dtc.h: DataModification zu ParticipantManagement::DataModification qualifiziert - gna_dtc.h: Signal-Signaturen auf ParticipantManagement::DataModification angepasst - gna_dtc.h: #include ppm.hpp hinzugefügt - gna_nasat_aircraft_part_model.h/.cpp: Namespace-Korrekturen, Member-Zugriffe korrigiert - gna_nasat_aircraft_part_model.h: onTypeChanged-Slot entfernt (im STUB nicht verfügbar) - pdm_to_string.h/.cpp: DDS-spezifischen Code entfernt (nur STUB) - flm_enums.hpp: AlarmConfig, VulnerabilityState Enums hinzugefügt - pws_vnc_handler.h/.cpp: ProjectionWorkstation Namespace korrigiert - mrk_marker.h: timeStamp() Methode hinzugefügt - exm_exercise.h: Syntaxfehler korrigiert - CMakeLists.txt Anpassungen für BUILD_RTI=ON Support Build mit BUILD_RTI=ON erfolgreich abgeschlossen.
This commit is contained in:
19 files changed
+449
-180
No files matched your search
@@ -1,13 +1,73 @@
|
||||
#pragma once
|
||||
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
||||
// Für die Migration erstellen wir minimale Forward-Declarations
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen
|
||||
|
||||
#include "exm_exercise.h"
|
||||
#include "ppm_enums.hpp"
|
||||
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <functional>
|
||||
|
||||
namespace ExerciseManagement
|
||||
{
|
||||
|
||||
namespace Interface
|
||||
{
|
||||
class Dtc;
|
||||
class Ftc;
|
||||
|
||||
// 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
|
||||
Reference in new issue
Block a user