Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* Handler for all oc situation data at the client
|
||||
* $Id: handler_oc_situation_data.h 57655 2022-07-20 11:38:28Z karwat $
|
||||
* $HeadURL: svn://192.168.133.21/TDS/branches/product/features/3dws_devel/Lts/Services/OcSituationClient/handler_oc_situation_data.h $
|
||||
* $Author: karwat $
|
||||
* Created by Philipp Dassow, NLST, 01-03-2018
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QHash>
|
||||
#include <QSet>
|
||||
|
||||
#include <OcSituationServer/oc_situation.h>
|
||||
#include <AreaEffectSimulation/aes_ftc.h>
|
||||
#include <AreaEffectSimulation/aes_dtc.h>
|
||||
#include <TrainingAreaBaseOC/taboc_dts.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace OcSituationClient
|
||||
{
|
||||
|
||||
class HandlerOcCentralAesData
|
||||
: public QObject
|
||||
, protected AreaEffectSimulation::Interface::Ftc::NContaminationModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::BCContaminationModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::ExplosionAreaModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::ExplosionSingleModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::FunctionalAreaModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::BoobyTrapModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::OffRouteMineModifyReplyHandler
|
||||
, protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterOcModifyReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HandlerOcCentralAesData(const std::shared_ptr<AreaEffectSimulation::Interface::Dtc> &aesDtc,
|
||||
const std::shared_ptr<AreaEffectSimulation::Interface::Ftc> &aesFtc,
|
||||
const std::shared_ptr<TrainingAreaBaseOC::Interface::Dts> &tabocDts,
|
||||
QObject *parent);
|
||||
~HandlerOcCentralAesData();
|
||||
|
||||
bool init();
|
||||
|
||||
void process(const QByteArray &data, bool bIsInitial);
|
||||
void removeAllCentralAesItems();
|
||||
|
||||
bool withCompression() const { return m_bWithCompression; }
|
||||
void setWithCompression(bool bOn) { m_bWithCompression = bOn; }
|
||||
bool withVBGTime() const { return m_bWithVBGTime; }
|
||||
void setWithVBGTime(bool bOn) { m_bWithVBGTime = bOn; }
|
||||
|
||||
private Q_SLOTS:
|
||||
void onNContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType);
|
||||
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType);
|
||||
void onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType);
|
||||
void onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType);
|
||||
void onMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType);
|
||||
void onFunctionalAreaChanged(const AreaEffectSimulation::FunctionalArea &data, DataModification modType);
|
||||
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType);
|
||||
void onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine &data, DataModification modType);
|
||||
void onExplosionClusterChanged(const AreaEffectSimulation::ExplosionCluster &data, DataModification modType);
|
||||
|
||||
private:
|
||||
template <typename T>
|
||||
void onAesItemChanged(const T &aesItem, DataModification modType, AreaEffectSimulation::AesType aesType);
|
||||
|
||||
template <typename T>
|
||||
void checkId(T &aesItem) const;
|
||||
|
||||
void tryRemoveAesItem(qint32 aesItemId, AreaEffectSimulation::AesType aesType);
|
||||
|
||||
void removeAesItem(qint32 aesItemId,
|
||||
int64_t (AreaEffectSimulation::Interface::Ftc::*removeFunction)(const Core::RemoveElementRequest &, const std::function<void (const Core::FunctionReplyObject &)> &));
|
||||
|
||||
void onOffRouteMineModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onBoobyTrapModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onFunctionalAreaModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onMineAreaModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onExplosionSingleModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onExplosionAreaModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onBCContaminationModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onNContaminationModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &reply) override final;
|
||||
|
||||
void onReply(const Core::FunctionReplyObject &reply) const;
|
||||
private:
|
||||
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_aesDtc;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_aesFtc;
|
||||
std::shared_ptr<TrainingAreaBaseOC::Interface::Dts> m_tabocDts;
|
||||
|
||||
// aes item id, paired to AesType
|
||||
QHash<int32_t, AreaEffectSimulation::AesType> m_allCentralAesItems;
|
||||
|
||||
// options, must be in sync with oss
|
||||
bool m_bWithCompression = true;
|
||||
bool m_bWithVBGTime = true;
|
||||
|
||||
LOGGER_T &m_logger;
|
||||
};
|
||||
|
||||
} // namespace OcSituationClient
|
||||
Reference in new issue
Block a user