- 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>
138 lines
4.2 KiB
C++
138 lines
4.2 KiB
C++
#pragma once
|
|
|
|
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
|
// Für die Migration erstellen wir minimale Typ-Definitionen
|
|
|
|
#include "gna_nasat_aircraft.h"
|
|
#include "gna_nasat_aircraft_participant.h"
|
|
#include <ParticipantManagement/ppm_enums.hpp>
|
|
#include <ParticipantManagement/ppm.hpp>
|
|
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QList>
|
|
#include <QtCore/QMap>
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
// Forward declarations
|
|
namespace ExerciseManagement { namespace Interface { class Dtc; } }
|
|
namespace ParticipantManagement { namespace Interface { class Dtc; class ForeignGuiComboboxInterface; } }
|
|
namespace LtsSession { class LtsSession; }
|
|
|
|
namespace GuezNasat
|
|
{
|
|
|
|
// NasatAircraftParticipant und NasatAircraft sind bereits in gna_nasat_aircraft.h definiert
|
|
// Diese Datei enthält nur die Dtc-Klasse
|
|
|
|
namespace Interface
|
|
{
|
|
|
|
// Dtc - Data Transfer Component für GuezNasat
|
|
class Dtc : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
Dtc() = default;
|
|
~Dtc() override = default;
|
|
|
|
// NasatAircraftParticipant-Liste abrufen (Callback-basiert)
|
|
void forEachNasatAircraftParticipant(const std::function<void(const NasatAircraftParticipant&)>& callback) const {
|
|
for (const auto& nap : m_nasatAircraftParticipants) {
|
|
callback(nap);
|
|
}
|
|
}
|
|
|
|
// NasatAircraftParticipant-Liste als QMap (für Model)
|
|
QMap<qint32, NasatAircraftParticipant> nasatAircraftParticipants() const {
|
|
QMap<qint32, NasatAircraftParticipant> result;
|
|
for (const auto& nap : m_nasatAircraftParticipants) {
|
|
result[nap.id()] = nap;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// NasatAircraft-Liste abrufen (Callback-basiert)
|
|
void forEachNasatAircraft(const std::function<void(const NasatAircraft&)>& callback) const {
|
|
for (const auto& na : m_nasatAircrafts) {
|
|
callback(na);
|
|
}
|
|
}
|
|
|
|
// NasatAircraft-Liste als QMap
|
|
QMap<qint32, NasatAircraft> nasatAircrafts() const {
|
|
QMap<qint32, NasatAircraft> result;
|
|
for (const auto& na : m_nasatAircrafts) {
|
|
result[na.id()] = na;
|
|
}
|
|
return result;
|
|
}
|
|
|
|
// Daten hinzufügen/entfernen/ändern
|
|
void addNasatAircraftParticipant(const NasatAircraftParticipant& nap) {
|
|
m_nasatAircraftParticipants.append(nap);
|
|
emit nasatAircraftParticipantChanged(nap, DataModification::eAdded);
|
|
}
|
|
|
|
void updateNasatAircraftParticipant(const NasatAircraftParticipant& nap) {
|
|
for (auto& existing : m_nasatAircraftParticipants) {
|
|
if (existing.id() == nap.id()) {
|
|
existing = nap;
|
|
emit nasatAircraftParticipantChanged(nap, DataModification::eModified);
|
|
return;
|
|
}
|
|
}
|
|
addNasatAircraftParticipant(nap);
|
|
}
|
|
|
|
void removeNasatAircraftParticipant(int id) {
|
|
for (auto it = m_nasatAircraftParticipants.begin(); it != m_nasatAircraftParticipants.end(); ++it) {
|
|
if (it->id() == id) {
|
|
NasatAircraftParticipant removed = *it;
|
|
m_nasatAircraftParticipants.erase(it);
|
|
emit nasatAircraftParticipantChanged(removed, DataModification::eRemoved);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
void addNasatAircraft(const NasatAircraft& na) {
|
|
m_nasatAircrafts.append(na);
|
|
emit nasatAircraftChanged(na, DataModification::eAdded);
|
|
}
|
|
|
|
void updateNasatAircraft(const NasatAircraft& na) {
|
|
for (auto& existing : m_nasatAircrafts) {
|
|
if (existing.id() == na.id()) {
|
|
existing = na;
|
|
emit nasatAircraftChanged(na, DataModification::eModified);
|
|
return;
|
|
}
|
|
}
|
|
addNasatAircraft(na);
|
|
}
|
|
|
|
void removeNasatAircraft(int id) {
|
|
for (auto it = m_nasatAircrafts.begin(); it != m_nasatAircrafts.end(); ++it) {
|
|
if (it->id() == id) {
|
|
NasatAircraft removed = *it;
|
|
m_nasatAircrafts.erase(it);
|
|
emit nasatAircraftChanged(removed, DataModification::eRemoved);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
signals:
|
|
void nasatAircraftParticipantChanged(const NasatAircraftParticipant& participant, DataModification modificationType);
|
|
void nasatAircraftChanged(const NasatAircraft& aircraft, DataModification modificationType);
|
|
|
|
private:
|
|
QList<NasatAircraftParticipant> m_nasatAircraftParticipants;
|
|
QList<NasatAircraft> m_nasatAircrafts;
|
|
};
|
|
|
|
} // namespace Interface
|
|
} // namespace GuezNasat
|