Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/include/AdlerJson/ppm_handler.h
T
torstenandCopilot b774f4035c Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-19 06:06:24 +02:00

112 lines
5.1 KiB
C++
Executable File

/**
* @RDE_HEADER@
* PpmHandler for AdlerJson Plugin
* $Id: ppm_handler.h 62899 2024-05-29 11:08:50Z ewert_j $
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.h $
* $Author: ewert_j $
* Created by Julius Ewert, ESIM, 2024-03-20
*/
#pragma once
#include "Core/core.hpp"
#include "main_dispatcher.h"
#include "logger.h"
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h>
#include <LtsUtilsCore/data_modification_enum.h>
#include <QTimer>
#include <QObject>
#include <QHash>
#include <QUrl>
#include <QDateTime>
#include <telegrams.h>
namespace AdlerJson
{
class MainDispatcher;
class PpmHandler
: public QObject
, protected ParticipantManagement::Interface::Ftc::ModifyParticipantDataReplyHandler
, protected ParticipantManagement::Interface::Ftc::ModifyPartyDataReplyHandler
{
Q_OBJECT
public:
explicit PpmHandler(QObject *parent = nullptr);
bool init(MainDispatcher* mainDispatcher);
void getParticipants();
bool isEqNumberInExercise(const int equipmentNumber) const;
std::shared_ptr<ParticipantManagement::Interface::Dtc> getDtc() { return m_dtcPpm; }
std::shared_ptr<ParticipantManagement::Interface::Ftc> getFtc() { return m_ftcPpm; }
void onCreateParticipant();
// ModifyParticipantDataRequestHandler interface
void onModifyParticipantDataReply(const Core::FunctionReply &reply);
void onModifyPartyDataReply(const Core::FunctionReply &reply);
void modifyPartyAdlerProperties(const int wsId, const int assetId, const int partyId, const QString &saaName, const QString &szenarName,
const ParticipantManagement::ConnectState &connectState, const bool isVerbund);
//parse functions that trigger other services
void parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId);
void parseSQWS(const Waffensystemdaten &exSQWS, const int wsId);
void parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId);
void removeAllSAAParticipants(const int partyId);
ParticipantManagement::Participant findParticipantByInternalName(const QString &internalName, const int partyId, const bool isVerbund);
signals:
void participantChanged(const QJsonObject &jsonObj);
void participantUnmount(const QJsonObject &jsonObj);
void participantMount(const QJsonObject &jsonObj);
private slots:
void onPartyChanged(const ParticipantManagement::Party &data, DataModification modType);
void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType);
void onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType);
void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
void onSendParticipantDataTimeout();
private:
void handleParticipantPositionChangedExternal(const ParticipantManagement::ParticipantPosition &position);
void handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position);
void sendParticipantMount(const ParticipantManagement::Participant &part, const ParticipantManagement::Participant &partToBeMounted);
void sendParticipantUnmount(const ParticipantManagement::Participant &participant);
void sendParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &position);
void onModifyParticipantDataReply(const Core::FunctionReplyObject &reply) override;
void onModifyPartyDataReply(const Core::FunctionReplyObject &reply) override;
QList<ParticipantManagement::Participant> findAllSAAParticipants(const int partyId);
ParticipantManagement::ParticipantData findParticipantDataByInternalName(int &randomNumberInOut, const QString &internalName, const bool isVerbund);
ParticipantManagement::ParticipantData findRootUnit(const int partyId);
void sendPositionFromTempMap(int rndNmbr, const int partyId, const bool isVerbund);
void sendChargesFromTempMap(const int rndNmbr, const int partyId, const bool isVerbund);
void sendReadyMessageFromTempMap(int rndNmbr, const int partyId, const bool isVerbund);
int convertStatus_L28(const ProjectDataManagement::L28_Status &status);
QVector<AdlerJson::Geschoss> sumUpAnzahlForSameGeschoss(const QVector<AdlerJson::Geschoss> &geschosse) const;
private:
MainDispatcher *m_mainDispatcher;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftcPpm;
QHash<int, int> m_participantIdsByEqNo; // eqNo, partId
QHash<int, int> m_mountedParticipants;// participantId of passanger, participantId of Vehicle
QTimer *m_sendParticipantDataTimer;
QVector<int> m_randomNumbers;
//maps
QMap<ProjectDataManagement::L19_Oi, KoordinateMitHoehe> m_mapLocationToPosition;
QMap<int, QMap<QString,KoordinateMitHoehe>> m_tempPositionMap;
QMap<int, QVector<QString>> m_tempinternalNameMap;
QMap<int, QMap<QString,QVector<Geschoss>>> m_tempChargesMap;
QMap<int, std::vector<ParticipantManagement::ParticipantData>> m_tempPartDataList;
QMap<int, QMap<QString,ProjectDataManagement::L28_Status>> m_tempReadyMessage;
};
} // namespace AdlerJson