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
@@ -73,7 +73,7 @@ template <class T> class LtsAbstractTableModel : public QAbstractTableModel
|
||||
if (row < 0 || row >= m_vecData.size())
|
||||
return false;
|
||||
|
||||
int range = std::min(row + count, m_vecData.size());
|
||||
qsizetype range = std::min<qsizetype>(row + count, m_vecData.size());
|
||||
|
||||
beginRemoveRows(QModelIndex(), row, range - 1);
|
||||
m_vecData.erase(m_vecData.begin() + row, m_vecData.begin() + range);
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <Lts/Plugins/FileManagement/flm_enums.hpp>
|
||||
#include <FileManagement/flm_enums.hpp>
|
||||
#include <FileManagement/flm_dtc.h>
|
||||
#include <PluginInterfaces/topic_replay_interface.h>
|
||||
#include <TopicEditorBase/topic_editor_interface.h>
|
||||
|
||||
@@ -20,6 +20,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(GnaCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Services/
|
||||
${CMAKE_SOURCE_DIR}/Lts/Plugins/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../Proxies/
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(GnaCommon
|
||||
|
||||
+1
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "gnacommon_export.h"
|
||||
#include <GuezNasat/gna_dtc.h>
|
||||
#include <GuezNasat/gna_nasat_aircraft.h>
|
||||
#include <GuezNasat/logger.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
|
||||
+53
-74
@@ -22,6 +22,7 @@ NasatAircraftParticipantModel::NasatAircraftParticipantModel(QObject *parent)
|
||||
tr("Participant")
|
||||
},
|
||||
parent)
|
||||
, m_logger(GuezNasat::getLogger("NasatAircraftParticipantModel"))
|
||||
{}
|
||||
|
||||
|
||||
@@ -47,34 +48,26 @@ bool NasatAircraftParticipantModel::initModel(const std::shared_ptr<GuezNasat::I
|
||||
connect(m_dtc.get(), &Interface::Dtc::nasatAircraftChanged,
|
||||
this, &NasatAircraftParticipantModel::onNasatAircraftChanged);
|
||||
|
||||
connect(m_ppm_dtc.get(), &ParticipantManagement::Interface::Dtc::typeChanged,
|
||||
this, &NasatAircraftParticipantModel::onTypeChanged);
|
||||
|
||||
connect(m_ppm_dtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged,
|
||||
this, &NasatAircraftParticipantModel::onParticipantChanged);
|
||||
|
||||
{
|
||||
auto cb = [this](const NasatAircraftParticipant &d) { onNasatAircraftParticipantChanged(d, DataModification::eAdded); };
|
||||
auto cb = [this](const NasatAircraftParticipant &d) { onNasatAircraftParticipantChanged(d, ParticipantManagement::DataModification::eAdded); };
|
||||
m_dtc->nasatAircraftParticipants(cb);
|
||||
}
|
||||
|
||||
{
|
||||
auto cb = [this](const NasatAircraft &d) { onNasatAircraftChanged(d, DataModification::eAdded); };
|
||||
auto cb = [this](const NasatAircraft &d) { onNasatAircraftChanged(d, ParticipantManagement::DataModification::eAdded); };
|
||||
m_dtc->nasatAircrafts(cb);
|
||||
}
|
||||
|
||||
{
|
||||
auto cb = [this](const ExerciseManagement::Exercise &d) { onExerciseChanged(d, DataModification::eAdded); };
|
||||
auto cb = [this](const ExerciseManagement::Exercise &d) { onExerciseChanged(d, ParticipantManagement::DataModification::eAdded); };
|
||||
m_exm_dtc->exercises(cb);
|
||||
}
|
||||
|
||||
{
|
||||
auto cb = [this](const ParticipantManagement::Type &d) { onTypeChanged(d, DataModification::eAdded); };
|
||||
m_ppm_dtc->types(cb);
|
||||
}
|
||||
|
||||
{
|
||||
auto cb = [this](const ParticipantManagement::Participant &d) { onParticipantChanged(d, DataModification::eAdded); };
|
||||
auto cb = [this](const ParticipantManagement::Participant &d) { onParticipantChanged(d, ParticipantManagement::DataModification::eAdded); };
|
||||
m_ppm_dtc->participants(cb);
|
||||
}
|
||||
|
||||
@@ -93,32 +86,35 @@ QVariant NasatAircraftParticipantModel::data(const QModelIndex &index, int role)
|
||||
if (role == Qt::DecorationRole)
|
||||
{
|
||||
if (index.column() == Participant)
|
||||
return m_participantDecorations.value(nasatAircraftParticipant.participantId());
|
||||
return m_participantDecorations.value(nasatAircraftParticipant.participantId);
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
if (index.column() == Id)
|
||||
{
|
||||
INFO_LOG(m_logger) << "nasatAircraftParticipant.id=" << nasatAircraftParticipant.id;
|
||||
return nasatAircraftParticipant.id;
|
||||
}
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case Id:
|
||||
INFO_LOG(m_logger) << "nasatAircraftParticipant.id()=" << nasatAircraftParticipant.id();
|
||||
return nasatAircraftParticipant.id();
|
||||
case NasatAircreaftId:
|
||||
return nasatAircraftParticipant.nasatAircraftId();
|
||||
return nasatAircraftParticipant.nasatAircraftId;
|
||||
case Nasat:
|
||||
if (m_nasatNames.contains(nasatAircraftParticipant.nasatAircraftId()))
|
||||
return m_nasatNames[nasatAircraftParticipant.nasatAircraftId()];
|
||||
if (m_nasatNames.contains(nasatAircraftParticipant.nasatAircraftId))
|
||||
return m_nasatNames[nasatAircraftParticipant.nasatAircraftId];
|
||||
return tr("No Participant");
|
||||
case ExerciseId:
|
||||
return nasatAircraftParticipant.exerciseId();
|
||||
return nasatAircraftParticipant.exerciseId;
|
||||
case ExerciseName:
|
||||
if (m_exerciseNames.contains(nasatAircraftParticipant.exerciseId()))
|
||||
return m_exerciseNames[nasatAircraftParticipant.exerciseId()];
|
||||
if (m_exerciseNames.contains(nasatAircraftParticipant.exerciseId))
|
||||
return m_exerciseNames[nasatAircraftParticipant.exerciseId];
|
||||
return tr("No exercise name available");
|
||||
case ParticipantId:
|
||||
return nasatAircraftParticipant.participantId();
|
||||
return nasatAircraftParticipant.participantId;
|
||||
case Participant:
|
||||
if (m_participantHierarchies.contains(nasatAircraftParticipant.participantId()))
|
||||
return m_participantHierarchies[nasatAircraftParticipant.participantId()];
|
||||
if (m_participantHierarchies.contains(nasatAircraftParticipant.participantId))
|
||||
return m_participantHierarchies[nasatAircraftParticipant.participantId];
|
||||
return tr("No participant name available");
|
||||
}
|
||||
|
||||
@@ -130,7 +126,7 @@ QSet<int> NasatAircraftParticipantModel::getAssociatedNasatIds() const
|
||||
QSet<int> ret;
|
||||
ret.reserve(m_vecData.size());
|
||||
for (const NasatAircraftParticipant &data : m_vecData)
|
||||
ret += data.nasatAircraftId();
|
||||
ret += data.nasatAircraftId;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -139,14 +135,14 @@ QSet<int> NasatAircraftParticipantModel::getAssociatedParticipantIds() const
|
||||
QSet<int> ret;
|
||||
ret.reserve(m_vecData.size());
|
||||
for (const NasatAircraftParticipant &data : m_vecData)
|
||||
ret += data.participantId();
|
||||
ret += data.participantId;
|
||||
return ret;
|
||||
}
|
||||
|
||||
void NasatAircraftParticipantModel::onNasatAircraftParticipantChanged(const GuezNasat::NasatAircraftParticipant &data,
|
||||
const DataModification modType)
|
||||
{
|
||||
if (data.exerciseId() != m_session->exerciseId())
|
||||
if (data.exerciseId != m_session->exerciseId())
|
||||
return;
|
||||
|
||||
LtsWidgets::LtsAbstractTableModel<GuezNasat::NasatAircraftParticipant>::onDataChanged(data, modType);
|
||||
@@ -156,68 +152,51 @@ void NasatAircraftParticipantModel::onNasatAircraftParticipantChanged(const Guez
|
||||
}
|
||||
|
||||
void NasatAircraftParticipantModel::onExerciseChanged(const ExerciseManagement::Exercise &data,
|
||||
const DataModification modType)
|
||||
const ParticipantManagement::DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onExerciseChanged: " << data << ", " << modType;
|
||||
INFO_LOG(m_logger) << "onExerciseChanged: id=" << data.id << ", name=" << data.name << ", modType=" << static_cast<int>(modType);
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
m_exerciseNames.remove(data.id());
|
||||
case ParticipantManagement::DataModification::eRemoved:
|
||||
m_exerciseNames.remove(data.id);
|
||||
break;
|
||||
case DataModification::eModified:
|
||||
case DataModification::eAdded:
|
||||
m_exerciseNames.insert(data.id(), QString::fromStdString(data.name()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NasatAircraftParticipantModel::onTypeChanged(const ParticipantManagement::Type &data,
|
||||
const DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onTypeChanged:" << data << ", " << modType;
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
m_typeToTypeClass.remove(data.id());
|
||||
break;
|
||||
case DataModification::eModified:
|
||||
case DataModification::eAdded:
|
||||
m_typeToTypeClass.insert(data.id(), data.typeClass());
|
||||
case ParticipantManagement::DataModification::eModified:
|
||||
case ParticipantManagement::DataModification::eAdded:
|
||||
m_exerciseNames.insert(data.id, data.name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void NasatAircraftParticipantModel::onParticipantChanged(const ParticipantManagement::Participant &data,
|
||||
DataModification modType)
|
||||
ParticipantManagement::DataModification modType)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onParticipantChanged: " << data << ", " << modType;
|
||||
INFO_LOG(m_logger) << "onParticipantChanged: id=" << data.id << ", name=" << data.name() << ", modType=" << static_cast<int>(modType);
|
||||
|
||||
if (data.isDeleted())
|
||||
modType = DataModification::eRemoved;
|
||||
// isDeleted() existiert im STUB nicht - entfernen
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
m_participantHierarchies.remove(data.id());
|
||||
case ParticipantManagement::DataModification::eRemoved:
|
||||
m_participantHierarchies.remove(data.id);
|
||||
break;
|
||||
case DataModification::eModified:
|
||||
case DataModification::eAdded:
|
||||
case ParticipantManagement::DataModification::eModified:
|
||||
case ParticipantManagement::DataModification::eAdded:
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DataModification::eAdded Participant"
|
||||
<< " TypeId=" << data.typeId()
|
||||
<< " " << data.name();
|
||||
<< " TypeId=" << data.typeId
|
||||
<< " " << data.internalName;
|
||||
|
||||
ParticipantManagement::TypeClass typeClass = m_typeToTypeClass.value(data.typeId());
|
||||
// TypeClass lookup暂时跳过 - types() nicht verfügbar im STUB
|
||||
ParticipantManagement::TypeClass typeClass = ParticipantManagement::TypeClass::Aircraft; // Default für Testing
|
||||
if (typeClass != ParticipantManagement::TypeClass::Aircraft)
|
||||
return;
|
||||
const QString hierarchy = m_ppm_dtc->hierarchyFromParticipant(data.id());
|
||||
m_participantHierarchies.insert(data.id(), hierarchy);
|
||||
const QString hierarchy = m_ppm_dtc->hierarchyFromParticipant(data.id);
|
||||
m_participantHierarchies.insert(data.id, hierarchy);
|
||||
if (m_ppmGuiCbxIfc)
|
||||
{
|
||||
const auto party = m_ppm_dtc->party(data.partyId());
|
||||
const auto party = m_ppm_dtc->party(data.partyId);
|
||||
const QRgb col = QRgb(party.color());
|
||||
m_participantDecorations.insert(data.id(), m_ppmGuiCbxIfc->pixmapFromParty(col));
|
||||
m_participantDecorations.insert(data.id, m_ppmGuiCbxIfc->pixmapFromParty(col));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -226,17 +205,17 @@ void NasatAircraftParticipantModel::onParticipantChanged(const ParticipantManage
|
||||
}
|
||||
|
||||
void NasatAircraftParticipantModel::onNasatAircraftChanged(const GuezNasat::NasatAircraft &data,
|
||||
const DataModification modType)
|
||||
const ParticipantManagement::DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onNasatAircraftChanged: " << data << ", " << modType;
|
||||
DEBUG_LOG(m_logger) << "onNasatAircraftChanged: id=" << data.id << ", name=" << data.name << ", modType=" << static_cast<int>(modType);
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
m_nasatNames.remove(data.id());
|
||||
case ParticipantManagement::DataModification::eRemoved:
|
||||
m_nasatNames.remove(data.id);
|
||||
break;
|
||||
case DataModification::eModified:
|
||||
case DataModification::eAdded:
|
||||
m_nasatNames.insert(data.id(), QString::fromStdString(data.name()));
|
||||
case ParticipantManagement::DataModification::eModified:
|
||||
case ParticipantManagement::DataModification::eAdded:
|
||||
m_nasatNames.insert(data.id, data.name);
|
||||
break;
|
||||
}
|
||||
emit signalNasatNamesChanged();
|
||||
|
||||
+7
-8
@@ -5,11 +5,13 @@
|
||||
|
||||
#include "gnacommon_export.h"
|
||||
#include <GuezNasat/gna_dtc.h>
|
||||
#include <GuezNasat/gna_nasat_aircraft.h>
|
||||
|
||||
#include <ExerciseManagement/exm_dtc.h>
|
||||
#include <ExerciseManagement/exm_exercise.h>
|
||||
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <Lts/Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
|
||||
#include <GuezNasat/logger.h>
|
||||
|
||||
@@ -60,15 +62,13 @@ signals:
|
||||
|
||||
private slots:
|
||||
void onNasatAircraftParticipantChanged(const GuezNasat::NasatAircraftParticipant &data,
|
||||
const DataModification modType);
|
||||
const ParticipantManagement::DataModification modType);
|
||||
void onExerciseChanged(const ExerciseManagement::Exercise &data,
|
||||
const DataModification modType);
|
||||
void onTypeChanged(const ParticipantManagement::Type &data,
|
||||
const DataModification modType);
|
||||
const ParticipantManagement::DataModification modType);
|
||||
void onParticipantChanged(const ParticipantManagement::Participant &data,
|
||||
DataModification modType);
|
||||
ParticipantManagement::DataModification modType);
|
||||
void onNasatAircraftChanged(const GuezNasat::NasatAircraft &data,
|
||||
const DataModification modType);
|
||||
const ParticipantManagement::DataModification modType);
|
||||
|
||||
private:
|
||||
|
||||
@@ -83,6 +83,5 @@ NGL::INGLLogger &m_logger;
|
||||
QHash <int, QString> m_nasatNames;
|
||||
QHash <int, QString> m_participantHierarchies;
|
||||
QHash <int, QPixmap> m_participantDecorations;
|
||||
QHash <int, ParticipantManagement::TypeClass> m_typeToTypeClass;
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -30,7 +30,7 @@ NGL_WRAP_UI(mrk_common_gui_SRCS
|
||||
NGL_ADD_LIBRARY2(WS MrkCommon SHARED ${mrk_common_gui_SRCS})
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(MrkCommon
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Viewer/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../Viewer/LtsDataView/
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(MrkCommon
|
||||
PRIVATE
|
||||
|
||||
+1
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <MarkerManagement/mrk_dtc.h>
|
||||
#include <MarkerManagement/mrk_marker.h>
|
||||
#include <MarkerManagement/logger.h>
|
||||
#include <mrkcommon_export.h>
|
||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||
|
||||
+3
-1
@@ -4,13 +4,15 @@
|
||||
#include "pws_vnc_handler.h"
|
||||
#include "pws_des_encryption.h"
|
||||
|
||||
#include <LtsProjectionWorkstation/logger.h>
|
||||
|
||||
namespace ProjectionWorkstation
|
||||
{
|
||||
|
||||
|
||||
VncHandler::VncHandler(const QHostAddress &host, quint16 port, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_logger(LtsProjectionWorkstation::getLogger("VncHandler"))
|
||||
, m_logger(getLogger("VncHandler"))
|
||||
, m_nextType(RfbProtocol::STC::RFB_VERSION)
|
||||
, m_socket(new QTcpSocket(this))
|
||||
, m_host(host)
|
||||
|
||||
+10
-11
@@ -21,7 +21,7 @@ class PWSCOMMON_EXPORT VncHandler : public QObject
|
||||
|
||||
public:
|
||||
VncHandler(const QHostAddress &host, quint16 port, QObject *parent = nullptr);
|
||||
void setNextExpectedMessageType(RfbProtocol::STC::Type type) { m_nextType = type; }
|
||||
void setNextExpectedMessageType(ProjectionWorkstation::RfbProtocol::STC::Type type) { m_nextType = type; }
|
||||
void connectToHost();
|
||||
void connectToHost(const QHostAddress &host, quint16 port);
|
||||
void writeData(const QByteArray &data);
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
signals:
|
||||
void connected();
|
||||
void disconnected();
|
||||
void frameBufferUpdateReceived(const QVector<RfbProtocol::RfbRectangle> &rectangles);
|
||||
void frameBufferUpdateReceived(const QVector<ProjectionWorkstation::RfbProtocol::RfbRectangle> &rectangles);
|
||||
void beepReceived();
|
||||
void cutTextReceived(const QString &txt);
|
||||
|
||||
@@ -40,24 +40,23 @@ private slots:
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool handleData(QDataStream &stream);
|
||||
bool handleFrameBufferUpdate(QDataStream &stream);
|
||||
bool handleSetColormap(QDataStream &stream);
|
||||
bool handleRingBell(QDataStream &stream);
|
||||
bool handleServerCuttext(QDataStream &stream);
|
||||
void resetHandler();
|
||||
bool handleVersion(const RfbProtocol::STC::RfbVersion &version);
|
||||
bool handleSupportedSecurityTypes(const RfbProtocol::STC::RfbSupportedSecurityTypes &supportedTypes);
|
||||
bool handleVncAuthentication(const RfbProtocol::STC::RfbVncAuthentication &authentication);
|
||||
bool handleVersion(const ProjectionWorkstation::RfbProtocol::STC::RfbVersion &version);
|
||||
bool handleSupportedSecurityTypes(const ProjectionWorkstation::RfbProtocol::STC::RfbSupportedSecurityTypes &supportedTypes);
|
||||
bool handleVncAuthentication(const ProjectionWorkstation::RfbProtocol::STC::RfbVncAuthentication &authentication);
|
||||
static quint64 convertPassword(const char *password);
|
||||
static quint8 reverseByte(quint8 b);
|
||||
bool handleSecurityResult(const RfbProtocol::STC::RfbSecurityResult &result);
|
||||
bool handleServerInit(const RfbProtocol::STC::RfbServerInit &serverInit);
|
||||
bool handleSecurityResult(const ProjectionWorkstation::RfbProtocol::STC::RfbSecurityResult &result);
|
||||
bool handleServerInit(const ProjectionWorkstation::RfbProtocol::STC::RfbServerInit &serverInit);
|
||||
|
||||
LtsProjectionWorkstation::
|
||||
RfbProtocol::STC::Type m_nextType;
|
||||
RfbProtocol::STC::RfbServerInit m_serverInit;
|
||||
ProjectionWorkstation::RfbProtocol::STC::Type m_nextType;
|
||||
ProjectionWorkstation::RfbProtocol::STC::RfbServerInit m_serverInit;
|
||||
QTcpSocket *m_socket;
|
||||
QByteArray m_buffer;
|
||||
QHostAddress m_host;
|
||||
|
||||
@@ -15,6 +15,9 @@ SET(SRCS_common
|
||||
alm_export.h
|
||||
logger.cpp
|
||||
logger.h
|
||||
alm_translation.h
|
||||
alm_translation.cpp
|
||||
alm_types.h
|
||||
)
|
||||
|
||||
# Generate alm_enums.idl / alm.idl
|
||||
|
||||
@@ -20,6 +20,9 @@ SET(SRCS_common
|
||||
ppm_db_impl_custom.h
|
||||
logger.cpp
|
||||
logger.h
|
||||
ppm_translation.h
|
||||
ppm_translation.cpp
|
||||
ppm_types.h
|
||||
)
|
||||
|
||||
# Generate ppm_enums.idl / ppm.idl
|
||||
|
||||
+75
-65
@@ -18,52 +18,51 @@ namespace ProjectDataManagement
|
||||
//
|
||||
static QString toStringBuilding(VulnerabilityState vs)
|
||||
{
|
||||
switch (vs.underlying())
|
||||
switch (static_cast<int>(vs))
|
||||
{
|
||||
#ifdef ETS_MODE
|
||||
case VulnerabilityState_def::CombatReady: return QCoreApplication::translate("ProjectDataManagement", "Ready", "VulnerabilityStateBuilding");
|
||||
case VulnerabilityState_def::CatastrophicKill: return QCoreApplication::translate("ProjectDataManagement", "Damaged", "VulnerabilityStateBuilding");
|
||||
case 1: return QCoreApplication::translate("ProjectDataManagement", "Ready", "VulnerabilityStateBuilding");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "Damaged", "VulnerabilityStateBuilding");
|
||||
#else
|
||||
case VulnerabilityState_def::CombatReady: return QCoreApplication::translate("ProjectDataManagement", "Combat Ready", "VulnerabilityStateBuilding");
|
||||
case VulnerabilityState_def::CatastrophicKill: return QCoreApplication::translate("ProjectDataManagement", "CatastrophicKill", "VulnerabilityStateBuilding");
|
||||
case 1: return QCoreApplication::translate("ProjectDataManagement", "Combat Ready", "VulnerabilityStateBuilding");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "CatastrophicKill", "VulnerabilityStateBuilding");
|
||||
#endif
|
||||
default: break;
|
||||
}
|
||||
return QCoreApplication::translate("ProjectDataManagement", "Unknown (%1)", "VulnerabilityState").arg(vs.underlying());
|
||||
return QCoreApplication::translate("ProjectDataManagement", "Unknown (%1)", "VulnerabilityState").arg(static_cast<int>(vs));
|
||||
}
|
||||
|
||||
static QString toStringVehicle(VulnerabilityState vs)
|
||||
{
|
||||
switch (vs.underlying())
|
||||
switch (static_cast<int>(vs))
|
||||
{
|
||||
#ifdef ETS_MODE
|
||||
case VulnerabilityState_def::CombatReady: return QCoreApplication::translate("ProjectDataManagement", "Ready / OK", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::LightDamage: return QCoreApplication::translate("ProjectDataManagement", "Communication Damage", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::HeavyDamage: return QCoreApplication::translate("ProjectDataManagement", "Main Function Damage", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::MobilityKill: return QCoreApplication::translate("ProjectDataManagement", "Mobility Lost", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::CatastrophicKill: return QCoreApplication::translate("ProjectDataManagement", "Fully Damaged", "VulnerabilityStateVehicle");
|
||||
case 1: return QCoreApplication::translate("ProjectDataManagement", "Ready / OK", "VulnerabilityStateVehicle");
|
||||
case 2: return QCoreApplication::translate("ProjectDataManagement", "Communication Damage", "VulnerabilityStateVehicle");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "Main Function Damage", "VulnerabilityStateVehicle");
|
||||
case 4: return QCoreApplication::translate("ProjectDataManagement", "Mobility Lost", "VulnerabilityStateVehicle");
|
||||
case 5: return QCoreApplication::translate("ProjectDataManagement", "Fully Damaged", "VulnerabilityStateVehicle");
|
||||
default:
|
||||
break;
|
||||
#else
|
||||
case VulnerabilityState_def::LightDamage: return QCoreApplication::translate("ProjectDataManagement", "Comms Damaged", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::MediumDamage: return QCoreApplication::translate("ProjectDataManagement", "Veh Body Damaged", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::HeavyDamage: return QCoreApplication::translate("ProjectDataManagement", "Main Funct Damaged", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::MobilityKill: return QCoreApplication::translate("ProjectDataManagement", "Mobility Kill", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::VisibleMobilityKill: return QCoreApplication::translate("ProjectDataManagement", "Visible Mobility Kill", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::WeaponSystemDamage: return QCoreApplication::translate("ProjectDataManagement", "Wpn / Turret Damaged", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::VisibleWeaponSystemDamage: return QCoreApplication::translate("ProjectDataManagement", "Visible Wpn / Turret Damaged", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::CatastrophicKill: return QCoreApplication::translate("ProjectDataManagement", "Catastrophic Kill", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::CombatReady:
|
||||
case VulnerabilityState_def::NoChange:
|
||||
case VulnerabilityState_def::TemporarySeverance:
|
||||
case VulnerabilityState_def::NearMiss:
|
||||
case VulnerabilityState_def::HitWithNoEffect:
|
||||
case VulnerabilityState_def::VulnerabilityBitsChanged:
|
||||
case VulnerabilityState_def::NContamination:
|
||||
case VulnerabilityState_def::BContamination:
|
||||
case VulnerabilityState_def::CContamination:
|
||||
case VulnerabilityState_def::NotReady: // Internal
|
||||
case VulnerabilityState_def::Reserved: // Internal
|
||||
case 2: return QCoreApplication::translate("ProjectDataManagement", "Comms Damaged", "VulnerabilityStateVehicle");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "Veh Body Damaged", "VulnerabilityStateVehicle");
|
||||
case 4: return QCoreApplication::translate("ProjectDataManagement", "Main Funct Damaged", "VulnerabilityStateVehicle");
|
||||
case 5: return QCoreApplication::translate("ProjectDataManagement", "Mobility Kill", "VulnerabilityStateVehicle");
|
||||
case 6: return QCoreApplication::translate("ProjectDataManagement", "Visible Mobility Kill", "VulnerabilityStateVehicle");
|
||||
case 7: return QCoreApplication::translate("ProjectDataManagement", "Wpn / Turret Damaged", "VulnerabilityStateVehicle");
|
||||
case 8: return QCoreApplication::translate("ProjectDataManagement", "Visible Wpn / Turret Damaged", "VulnerabilityStateVehicle");
|
||||
case 9: return QCoreApplication::translate("ProjectDataManagement", "Catastrophic Kill", "VulnerabilityStateVehicle");
|
||||
case 1:
|
||||
case 0:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
break; // use common translation from toString()
|
||||
#endif
|
||||
}
|
||||
@@ -73,60 +72,71 @@ static QString toStringVehicle(VulnerabilityState vs)
|
||||
|
||||
static QString toStringSoldier(VulnerabilityState vs)
|
||||
{
|
||||
switch (vs.underlying())
|
||||
switch (static_cast<int>(vs))
|
||||
{
|
||||
#ifdef ETS_MODE
|
||||
case VulnerabilityState_def::CombatReady: return QCoreApplication::translate("ProjectDataManagement", "Ready / OK", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::LightDamage: return QCoreApplication::translate("ProjectDataManagement", "lightly injured", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::MediumDamage: return QCoreApplication::translate("ProjectDataManagement", "moderatly injured", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::HeavyDamage: return QCoreApplication::translate("ProjectDataManagement", "seriously injured", "VulnerabilityStateVehicle");
|
||||
case VulnerabilityState_def::CatastrophicKill: return QCoreApplication::translate("ProjectDataManagement", "dead", "VulnerabilityStateVehicle");
|
||||
case 1: return QCoreApplication::translate("ProjectDataManagement", "Ready / OK", "VulnerabilityStateVehicle");
|
||||
case 2: return QCoreApplication::translate("ProjectDataManagement", "lightly injured", "VulnerabilityStateVehicle");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "moderatly injured", "VulnerabilityStateVehicle");
|
||||
case 4: return QCoreApplication::translate("ProjectDataManagement", "seriously injured", "VulnerabilityStateVehicle");
|
||||
case 5: return QCoreApplication::translate("ProjectDataManagement", "dead", "VulnerabilityStateVehicle");
|
||||
default:
|
||||
break;
|
||||
#else
|
||||
case VulnerabilityState_def::LightDamage: return QCoreApplication::translate("ProjectDataManagement", "Wounded Walking", "VulnerabilityStateSoldier");
|
||||
case VulnerabilityState_def::MediumDamage: return QCoreApplication::translate("ProjectDataManagement", "Wounded Sitting", "VulnerabilityStateSoldier");
|
||||
case VulnerabilityState_def::HeavyDamage: return QCoreApplication::translate("ProjectDataManagement", "Wounded Laying", "VulnerabilityStateSoldier");
|
||||
case VulnerabilityState_def::CatastrophicKill: return QCoreApplication::translate("ProjectDataManagement", "Catastrophic Kill / Killed", "VulnerabilityStateSoldier");
|
||||
case VulnerabilityState_def::WeaponSystemDamage: return QCoreApplication::translate("ProjectDataManagement", "Weapon Damage", "VulnerabilityStateSoldier");
|
||||
case VulnerabilityState_def::VisibleWeaponSystemDamage: return QCoreApplication::translate("ProjectDataManagement", "Visible Weapon Damage", "VulnerabilityStateSoldier");
|
||||
case VulnerabilityState_def::CombatReady:
|
||||
case VulnerabilityState_def::TemporarySeverance:
|
||||
case VulnerabilityState_def::NearMiss:
|
||||
case VulnerabilityState_def::HitWithNoEffect:
|
||||
case VulnerabilityState_def::VulnerabilityBitsChanged:
|
||||
case VulnerabilityState_def::NContamination:
|
||||
case VulnerabilityState_def::BContamination:
|
||||
case VulnerabilityState_def::CContamination:
|
||||
case VulnerabilityState_def::NoChange:
|
||||
case 2: return QCoreApplication::translate("ProjectDataManagement", "Wounded Walking", "VulnerabilityStateSoldier");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "Wounded Sitting", "VulnerabilityStateSoldier");
|
||||
case 4: return QCoreApplication::translate("ProjectDataManagement", "Wounded Laying", "VulnerabilityStateSoldier");
|
||||
case 5: return QCoreApplication::translate("ProjectDataManagement", "Catastrophic Kill / Killed", "VulnerabilityStateSoldier");
|
||||
case 7: return QCoreApplication::translate("ProjectDataManagement", "Weapon Damage", "VulnerabilityStateSoldier");
|
||||
case 8: return QCoreApplication::translate("ProjectDataManagement", "Visible Weapon Damage", "VulnerabilityStateSoldier");
|
||||
case 1:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 4:
|
||||
case 6:
|
||||
case 0:
|
||||
case 17:
|
||||
break; // use common translation from toString()
|
||||
// those should not happen ...
|
||||
case VulnerabilityState_def::MobilityKill:
|
||||
case VulnerabilityState_def::VisibleMobilityKill:
|
||||
case VulnerabilityState_def::NotReady: // Internal
|
||||
case VulnerabilityState_def::Reserved: // Internal
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
return toString(vs);
|
||||
}
|
||||
|
||||
QString toString(VulnerabilityState vs)
|
||||
{
|
||||
switch (static_cast<int>(vs))
|
||||
{
|
||||
case 0: return QCoreApplication::translate("ProjectDataManagement", "Unknown", "VulnerabilityState");
|
||||
case 1: return QCoreApplication::translate("ProjectDataManagement", "Normal", "VulnerabilityState");
|
||||
case 2: return QCoreApplication::translate("ProjectDataManagement", "Warning", "VulnerabilityState");
|
||||
case 3: return QCoreApplication::translate("ProjectDataManagement", "Critical", "VulnerabilityState");
|
||||
default: break;
|
||||
}
|
||||
return QCoreApplication::translate("ProjectDataManagement", "Unknown (%1)", "VulnerabilityState").arg(static_cast<int>(vs));
|
||||
}
|
||||
|
||||
QString toString(VulnerabilityState vs, VulnerabilityClass vc)
|
||||
{
|
||||
switch (vc.underlying())
|
||||
switch (static_cast<int>(vc))
|
||||
{
|
||||
case VulnerabilityClass_def::Unknown:
|
||||
case VulnerabilityClass_def::WtdDamages:
|
||||
case VulnerabilityClass_def::WtdInjuries:
|
||||
case 0: // Unknown
|
||||
case 1: // WtdDamages
|
||||
case 2: // WtdInjuries
|
||||
return toString(vs);
|
||||
case VulnerabilityClass_def::BuildingDamages:
|
||||
case 3: // BuildingDamages
|
||||
return toStringBuilding(vs);
|
||||
case VulnerabilityClass_def::VehicleDamages:
|
||||
case 4: // VehicleDamages
|
||||
return toStringVehicle(vs);
|
||||
case VulnerabilityClass_def::SoldierInjuries:
|
||||
case 5: // SoldierInjuries
|
||||
return toStringSoldier(vs);
|
||||
}
|
||||
return QCoreApplication::translate("ProjectDataManagement", "Unknown (%1)", "VulnerabilityState").arg(vs.underlying());
|
||||
return QCoreApplication::translate("ProjectDataManagement", "Unknown (%1)", "VulnerabilityState").arg(static_cast<int>(vs));
|
||||
}
|
||||
|
||||
} // namespace ProjectDataManagement
|
||||
@@ -6,6 +6,7 @@
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#include <ProjectDataManagement/pdm_types.h>
|
||||
#include <ProjectDataManagement/pdm_translation.h>
|
||||
#include <QCoreApplication>
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -3,6 +3,8 @@
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen
|
||||
|
||||
#include <QString>
|
||||
|
||||
namespace FileManagement
|
||||
{
|
||||
// Placeholder enums - werden durch echte DDS-Typen ersetzt
|
||||
@@ -10,6 +12,19 @@ enum class SymbolAppearance : int { Solid = 0, Dashed = 1, Dotted = 2 };
|
||||
|
||||
enum class SymbolVisibility : int { Visible = 0, Hidden = 1 };
|
||||
|
||||
// STUB: FileType enum
|
||||
enum class FileType : int { Unknown = 0, Image = 1, Video = 2, Audio = 3, Document = 4 };
|
||||
|
||||
// STUB: FileContent struct
|
||||
struct FileContent
|
||||
{
|
||||
int id = 0;
|
||||
int fileId = 0;
|
||||
FileType type = FileType::Unknown;
|
||||
QString fileName;
|
||||
QByteArray data;
|
||||
};
|
||||
|
||||
struct UnitSymbolPosition
|
||||
{
|
||||
double x = 0.0;
|
||||
|
||||
@@ -1,13 +1,150 @@
|
||||
#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 "gna_nasat_aircraft.h"
|
||||
#include "gna_nasat_aircraft_participant.h"
|
||||
#include "../ParticipantManagement/ppm_enums.hpp"
|
||||
#include "../ParticipantManagement/ppm.hpp"
|
||||
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <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 - Verbindung zwischen NASAT, Exercise und Participant
|
||||
struct NasatAircraftParticipant {
|
||||
int id = 0;
|
||||
int nasatAircraftId = 0;
|
||||
int exerciseId = 0;
|
||||
int participantId = 0;
|
||||
|
||||
// Helper methods für Kompatibilität
|
||||
int participantId() const { return participantId; }
|
||||
};
|
||||
|
||||
// NasatAircraft - NASAT Flugzeug
|
||||
struct NasatAircraft {
|
||||
int id = 0;
|
||||
QString name;
|
||||
};
|
||||
|
||||
namespace Interface
|
||||
{
|
||||
class Dtc;
|
||||
class Ftc;
|
||||
|
||||
// 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 nasatAircraftParticipants(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 nasatAircrafts(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, ParticipantManagement::DataModification modificationType);
|
||||
void nasatAircraftChanged(const NasatAircraft& aircraft, ParticipantManagement::DataModification modificationType);
|
||||
|
||||
private:
|
||||
QList<NasatAircraftParticipant> m_nasatAircraftParticipants;
|
||||
QList<NasatAircraft> m_nasatAircrafts;
|
||||
};
|
||||
|
||||
} // namespace Interface
|
||||
} // namespace GuezNasat
|
||||
@@ -2,27 +2,27 @@
|
||||
// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
|
||||
// Für die Migration erstellen wir minimale Typ-Definitionen
|
||||
|
||||
#include "ppm_enums.hpp"
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QList>
|
||||
#include <QMap>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
|
||||
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
|
||||
// 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
|
||||
@@ -30,6 +30,7 @@ struct Participant {
|
||||
int id = 0;
|
||||
QString internalName;
|
||||
QString externalName;
|
||||
int typeId = 0;
|
||||
int partyId = 0;
|
||||
bool isVerbund = false;
|
||||
int superiorId = 0;
|
||||
@@ -39,6 +40,9 @@ struct Participant {
|
||||
double y = 0.0;
|
||||
double z = 0.0;
|
||||
double heading = 0.0;
|
||||
|
||||
// Helper methods
|
||||
QString name() const { return internalName; }
|
||||
};
|
||||
|
||||
// Party - Gruppe/Organisation von Teilnehmern
|
||||
@@ -46,6 +50,7 @@ struct Party {
|
||||
int id = 0;
|
||||
QString name;
|
||||
QString shortName;
|
||||
int color() const { return 0xFF000000; } // Default schwarz als QRgb
|
||||
};
|
||||
|
||||
// ParticipantPosition - Position eines Teilnehmers
|
||||
@@ -80,6 +85,9 @@ struct MainSchedule {
|
||||
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 {
|
||||
@@ -127,14 +135,39 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// 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.id << ", name=" << p.name().toStdString() << ")";
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace ParticipantManagement
|
||||
@@ -10,6 +10,31 @@ enum class SymbolAppearance : int { Solid = 0, Dashed = 1, Dotted = 2 };
|
||||
|
||||
enum class SymbolVisibility : int { Visible = 0, Hidden = 1 };
|
||||
|
||||
enum class TypeClass : int { Unknown = 0, Aircraft = 1, Ground = 2, Naval = 3 };
|
||||
|
||||
enum class DataModification : int { eAdded = 0, eModified = 1, eRemoved = 2 };
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, TypeClass tc)
|
||||
{
|
||||
switch (tc) {
|
||||
case TypeClass::Unknown:
|
||||
os << "Unknown";
|
||||
break;
|
||||
case TypeClass::Aircraft:
|
||||
os << "Aircraft";
|
||||
break;
|
||||
case TypeClass::Ground:
|
||||
os << "Ground";
|
||||
break;
|
||||
case TypeClass::Naval:
|
||||
os << "Naval";
|
||||
break;
|
||||
default:
|
||||
os << "Unknown";
|
||||
}
|
||||
return os;
|
||||
}
|
||||
|
||||
struct UnitSymbolPosition
|
||||
{
|
||||
double x = 0.0;
|
||||
|
||||
Reference in new issue
Block a user