Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.h
T
berrux-dev 598fc2560e Complete Qt6 migration: full clean build green across groups G1-G12 incl. runtime plugin set
new_docker_build.sh gains Group 12 (212 GUI/Data plugins); fixes LtsUtilsGuiDds visibility (LTO-stripped exports), LtsProjectionWorkstation unity name shadow, 6 unity-off dirs (dup file-scope statics, ddsftc INTERFACE sources) and reconfigures BUILD_FILTERMANAGEMENT/BUILD_PLUGINS_SERVICEMONITOR=ON
2026-10-20 09:36:57 +02:00

108 lines
4.8 KiB
C++
Executable File

#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.hpp>
#include <ParticipantManagement/ppm_ftc.h>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
#include <QtCore/QTimer>
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtCore/QUrl>
#include <QtCore/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();
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);
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:
NGL::INGLLogger &m_logger;
MainDispatcher *m_mainDispatcher;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftcPpm;
QHash<int, int> m_participantIdsByEqNo;
QHash<int, int> m_mountedParticipants;
QTimer *m_sendParticipantDataTimer;
QVector<int> m_randomNumbers;
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;
};
}