Merge feature/qt6-migration-basis-modules-services into feature/qt6-migration-basis-modules
Resolves 17 conflicts against legacy Qt5 semantics; validates with BUILD_RTI=ON BUILD_GRANTLEE=ON.
This commit is contained in:
1200 files changed
+20421
-18259
No files matched your search
+182
@@ -0,0 +1,182 @@
|
||||
#pragma once
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen
|
||||
|
||||
#include "ppm_enums.hpp"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
|
||||
// Type - Struct mit id und typeClass (nicht nur Alias!)
|
||||
struct Type {
|
||||
int id = 0;
|
||||
TypeClass typeClass = TypeClass::eUninitialized;
|
||||
|
||||
// Helper methods für Kompatibilität (andere Namen als Member!)
|
||||
int getId() const { return id; }
|
||||
TypeClass getTypeClass() const { return typeClass; }
|
||||
};
|
||||
|
||||
// Participant - Basisdaten eines Teilnehmers
|
||||
struct Participant {
|
||||
int m_id = 0;
|
||||
QString internalName;
|
||||
QString externalName;
|
||||
int typeId = 0;
|
||||
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;
|
||||
|
||||
// Optional fields (für DDS-Kompatibilität)
|
||||
std::optional<int> equipmentNumber;
|
||||
QString m_designator;
|
||||
QString m_tacticalIdentifier;
|
||||
|
||||
// Helper methods
|
||||
QString name() const { return internalName; }
|
||||
QString designator() const { return m_designator; }
|
||||
QString tacticalIdentifier() const { return m_tacticalIdentifier; }
|
||||
std::optional<int> getEquipmentNumber() const { return equipmentNumber; }
|
||||
int id() const { return m_id; }
|
||||
};
|
||||
|
||||
// Party - Gruppe/Organisation von Teilnehmern
|
||||
struct Party {
|
||||
int id = 0;
|
||||
QString name;
|
||||
QString shortName;
|
||||
int color() const { return 0xFF000000; } // Default schwarz als QRgb
|
||||
};
|
||||
|
||||
// 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
|
||||
{
|
||||
|
||||
// Using-Declaration für DataModification aus Parent-Namespace
|
||||
using ParticipantManagement::DataModification;
|
||||
|
||||
// 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.m_id == p.m_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->m_id == id) {
|
||||
Participant removed = *it;
|
||||
m_participants.erase(it);
|
||||
emit participantChanged(removed, DataModification::eRemoved);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hierarchy-Methoden (STUB)
|
||||
QString hierarchyFromParticipant(int participantId) const {
|
||||
Q_UNUSED(participantId);
|
||||
return QString();
|
||||
}
|
||||
|
||||
// Party-Methoden (STUB)
|
||||
Party party(int partyId) const {
|
||||
Q_UNUSED(partyId);
|
||||
return Party();
|
||||
}
|
||||
|
||||
signals:
|
||||
// Signal für Teilnehmer-Änderungen
|
||||
void participantChanged(const Participant& participant, DataModification modificationType);
|
||||
|
||||
private:
|
||||
QList<Participant> m_participants;
|
||||
QMap<int, QString> m_hierarchies;
|
||||
QMap<int, Party> m_parties;
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
|
||||
// Stream operator for logging
|
||||
inline std::ostream& operator<<(std::ostream& os, const Type& t) {
|
||||
os << "Type(id=" << t.id << ", typeClass=" << t.typeClass << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const Participant& p) {
|
||||
os << "Participant(id=" << p.m_id << ", name=" << p.name().toStdString() << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Stub header for CODEGEN_DATABASE generated code (BUILD_RTI=OFF)
|
||||
* This file is generated by CODEGEN_DATABASE macro when BUILD_RTI=ON
|
||||
* For BUILD_RTI=OFF builds, this stub provides the minimal interface
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace Database
|
||||
{
|
||||
// Stub struct for EquipmentExerciseMapping
|
||||
struct EquipmentExerciseMapping
|
||||
{
|
||||
int equipmentId = 0;
|
||||
int exerciseId = 0;
|
||||
};
|
||||
} // namespace Database
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
|
||||
/**
|
||||
* @brief Base class for database interface implementation
|
||||
*
|
||||
* This class is normally generated by CODEGEN_DATABASE macro.
|
||||
* This stub provides minimal interface for BUILD_RTI=OFF builds.
|
||||
*/
|
||||
class DatabaseInterfaceImpl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DatabaseInterfaceImpl(QObject *parent = nullptr) : QObject(parent) {}
|
||||
virtual ~DatabaseInterfaceImpl() = default;
|
||||
|
||||
// Virtual methods that can be overridden by custom implementations
|
||||
virtual bool removeEquipmentExerciseMapping(const Database::EquipmentExerciseMapping &equipmentExerciseMapping) = 0;
|
||||
};
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
// DDS-Stub-Header für ParticipantManagement FTC (Filter Topic Client)
|
||||
// Generiert für Qt6-Migration ohne RTI DDS
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <Core/core_types.h>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
namespace Interface
|
||||
{
|
||||
|
||||
class Ftc
|
||||
{
|
||||
public:
|
||||
class ModifyTypeReplyHandler
|
||||
{
|
||||
public:
|
||||
virtual ~ModifyTypeReplyHandler() = default;
|
||||
virtual void onModifyTypeReply(const Core::FunctionReplyObject &replyObject) = 0;
|
||||
};
|
||||
|
||||
Ftc() = default;
|
||||
virtual ~Ftc() = default;
|
||||
|
||||
virtual std::map<int32_t, Type> getTypes() const
|
||||
{
|
||||
return std::map<int32_t, Type>();
|
||||
}
|
||||
|
||||
virtual Type type(int32_t typeId) const
|
||||
{
|
||||
Type t;
|
||||
t.id = typeId;
|
||||
return t;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
} // namespace ParticipantManagement
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
// Translation Helper für ParticipantManagement Module
|
||||
// Wrapper für QObject::tr() in nicht-QObject Klassen
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include "ppmcommon_export.h"
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
|
||||
PPMCOMMON_EXPORT QString tr(const char *sourceText, const char *comment = nullptr, int n = -1);
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <ostream>
|
||||
#include "ppm_enums.hpp"
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
|
||||
// STUB: Type - wird durch echten DDS-Typ ersetzt
|
||||
struct Type
|
||||
{
|
||||
int id = 0;
|
||||
QString name;
|
||||
TypeClass typeClass = TypeClass::Unknown;
|
||||
// Weitere Felder werden bei Bedarf ergänzt
|
||||
};
|
||||
|
||||
// STUB: Participant - wird durch echten DDS-Typ ersetzt
|
||||
struct Participant
|
||||
{
|
||||
int id = 0;
|
||||
QString name;
|
||||
QString callsign;
|
||||
Type type;
|
||||
// Weitere Felder werden bei Bedarf ergänzt
|
||||
};
|
||||
|
||||
// Stream-Operator für Logger-Unterstützung
|
||||
inline std::ostream& operator<<(std::ostream& os, const Participant& participant)
|
||||
{
|
||||
os << "Participant(id=" << participant.id << ", name=" << participant.name.toStdString()
|
||||
<< ", callsign=" << participant.callsign.toStdString() << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
Reference in new issue
Block a user