Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* AesHandler for AdlerJson Plugin
|
||||
* $Id: aes_handler.h 62304 2024-03-21 08:17:45Z ewert_j $
|
||||
* $HeadURL: svn://slssvn/TDS/branches/product/features/ufom/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h $
|
||||
* $Author: ewert_j $
|
||||
* Created by Julius Ewert, ESIM, 2024-03-20
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DDS/Core/function_reply_object.h"
|
||||
#include "logger.h"
|
||||
#include "main_dispatcher.h"
|
||||
#include "telegrams.h"
|
||||
#include <QDateTime>
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <LtsUtilsCore/data_modification_enum.h>
|
||||
#include <LtsUtilsGuiDds/request_helper.h>
|
||||
#include <ParticipantManagement/ppm.hpp>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
|
||||
namespace AdlerJson
|
||||
{
|
||||
|
||||
class MainDispatcher;
|
||||
class AesHandler
|
||||
: public QObject
|
||||
, protected AreaEffectSimulation::Interface::Ftc::AirSupportImpactModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::OffRouteMineModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::EffectClusterModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::TrajectoryAdlerModifyReplyHandler
|
||||
, protected NotificationManagement::Interface::Ftc::CreateNotificationReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AesHandler(std::shared_ptr<TrainingAreaBase::Interface::Fts> ftsTab, QObject *parent = nullptr);
|
||||
|
||||
bool init(MainDispatcher *mainDispatcher);
|
||||
bool sendAesModifyRequest(const QJsonObject &obj);
|
||||
bool sendExplosionArea(const QJsonObject &data);
|
||||
// DDS Overrides
|
||||
void onAirSupportImpactModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override;
|
||||
|
||||
// Internal
|
||||
void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType);
|
||||
void onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType);
|
||||
|
||||
void handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::CreateSingleExplosion &data);
|
||||
void handleEXFire(const Feuerkampfdaten &data, int wsId);
|
||||
void handleEXDontFire(const Feuerkampfdaten &data, int wsId);
|
||||
// Reald Data
|
||||
void sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &data, int participantId, int wirkmittelIndex, int aesId);
|
||||
void handleEffectCluster(const WirkfeldplanungData &data, int wsId);
|
||||
|
||||
//
|
||||
void removeAllPendingEffectCluster(int partyId);
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> getDtc() { return m_dtcAes; };
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> getFtc() { return m_ftcAes; };
|
||||
|
||||
private:
|
||||
AreaEffectSimulation::Area createMinimumRect(int zone, const QVector<QPointF> &points);
|
||||
|
||||
signals:
|
||||
void explosionSingleChanged(const QJsonObject &jsonObj);
|
||||
|
||||
private:
|
||||
QList<qint32> findAllPendingEffectCluster(int partyId);
|
||||
void handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug = false);
|
||||
|
||||
private:
|
||||
MainDispatcher *m_mainDispatcher;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
|
||||
std::shared_ptr<TrainingAreaBase::DdsHandler> m_ddsHandler;
|
||||
|
||||
void onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
LtsUtils::RequestHelper *m_requestHelper;
|
||||
|
||||
QHash<int, AreaEffectSimulation::AesEffectState> m_singleExplosions;
|
||||
|
||||
WirkfeldplanungData m_wirkfeldPlanungsData;
|
||||
QHash<int, QString> m_aesIdToFeuerkampfReferenz; // key = aesId, value = feuerkampfReferenz
|
||||
|
||||
QHash<QString, int> m_feuerkampReferenzAmmoCounter; // key = feuerkampfReferenz, value = AmmoCounter
|
||||
QHash<QString, std::vector<ProjectDataManagement::L27_EffectorId>> m_feuerkampfReferenzWirkmittel; // key = feuerkampfReferenz, value = Kenner
|
||||
QHash<QString, bool> m_feuerkampfReferenzUsedFeuerHalt; // key = feuerkampfReferenz, value = boolean -> if Feuerhalt was activ
|
||||
|
||||
int m_participantId;
|
||||
int m_wirkmittelIndex;
|
||||
int m_aesId;
|
||||
QHash<int, int> aesIdWsId; // key = aesId value = wsId
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace AdlerJson
|
||||
Reference in new issue
Block a user