111 lines
4.7 KiB
C++
Executable File
111 lines
4.7 KiB
C++
Executable File
/**
|
|
* Handler for AES data received from SFM
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Philipp Dassow, NLST, 2018-04-11
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <LtsCoordTrans/lts_coord_trans.h>
|
|
|
|
#include <AreaEffectSimulation/aes_dtc.h>
|
|
#include <AreaEffectSimulation/aes_ftc.h>
|
|
#include <ProjectDataManagement/pdm_dtc.h>
|
|
|
|
#include "oc_telegrams.h"
|
|
#include "dds_handler.h"
|
|
#include "logger.h"
|
|
|
|
namespace TrainingAreaBaseOC
|
|
{
|
|
class HandlerAesData
|
|
: protected AreaEffectSimulation::Interface::Ftc::BCContaminationModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionAreaModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionSingleModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::FunctionalAreaModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::NContaminationModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyFromCtaDataReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::BCContaminationRemoveReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionAreaRemoveReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionSingleRemoveReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::FunctionalAreaRemoveReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::NContaminationRemoveReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::MineAreaRemoveReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionAreaPauseResumeReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterOcModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::ExplosionClusterRemoveReplyHandler
|
|
{
|
|
public:
|
|
explicit HandlerAesData(const std::shared_ptr<DdsHandler> &dds,
|
|
const std::shared_ptr<AreaEffectSimulation::Interface::Dtc> &aesDtc,
|
|
const std::shared_ptr<AreaEffectSimulation::Interface::Ftc> &aesFtc,
|
|
const std::shared_ptr<ProjectDataManagement::Interface::Dtc> &pdmDtc);
|
|
|
|
bool init();
|
|
void setUse2BytesForSingleFireDiameter(bool bUse) { m_use2BytesForSingleFireDiameter = bUse; }
|
|
|
|
void process(const QByteArray &data, int multiplexer);
|
|
|
|
void specificsExercise(const OcTelegrams::SpecificsExercise &data);
|
|
|
|
void onMineAreaModifyFromCtaDataReply(const Core::FunctionReplyObject &reply);
|
|
void onNContaminationModifyReply(const Core::FunctionReplyObject &reply);
|
|
void onFunctionalAreaModifyReply(const Core::FunctionReplyObject &reply);
|
|
void onExplosionSingleModifyReply(const Core::FunctionReplyObject &reply);
|
|
void onExplosionAreaModifyReply(const Core::FunctionReplyObject &reply);
|
|
void onBCContaminationModifyReply(const Core::FunctionReplyObject &reply);
|
|
void onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &reply);
|
|
|
|
void onMineAreaRemoveReply(const Core::FunctionReplyObject &reply);
|
|
void onNContaminationRemoveReply(const Core::FunctionReplyObject &reply);
|
|
void onFunctionalAreaRemoveReply(const Core::FunctionReplyObject &reply);
|
|
void onExplosionSingleRemoveReply(const Core::FunctionReplyObject &reply);
|
|
void onExplosionAreaRemoveReply(const Core::FunctionReplyObject &reply);
|
|
void onBCContaminationRemoveReply(const Core::FunctionReplyObject &reply);
|
|
void onExplosionClusterRemoveReply(const Core::FunctionReplyObject &reply);
|
|
|
|
void onExplosionAreaPauseResumeReply(const Core::FunctionReplyObject &reply);
|
|
|
|
private:
|
|
void bcContaminations(const QByteArray &data);
|
|
void explosionAreas(const QByteArray &data);
|
|
void explosionSingles(const QByteArray &data);
|
|
void functionalAreas(const QByteArray &data);
|
|
void nContaminations(const QByteArray &data);
|
|
void mineAreas(const QByteArray &data);
|
|
void explosionAreasPause(const QByteArray &data);
|
|
void explosionAreasResume(const QByteArray &data);
|
|
|
|
int chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass gearClass, int chargeTasCodeIndirect);
|
|
|
|
Core::GeoPosition2D relativeToGeoPosition(int x, int y) const;
|
|
|
|
enum
|
|
{
|
|
MineArea = 1,
|
|
ExplosionArea = 2,
|
|
ExplosionSingle = 3,
|
|
NContamination = 4,
|
|
BcContamination = 5,
|
|
FunctionalArea = 6,
|
|
ExplosionAreaStop = 7,
|
|
ExplosionAreaContinue = 8
|
|
};
|
|
|
|
std::shared_ptr<DdsHandler> m_dds;
|
|
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_aesDtc;
|
|
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_aesFtc;
|
|
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
|
|
|
|
LtsCoordTrans::UtmCoordinate m_utmCoord; // for position translation to relative
|
|
|
|
bool m_use2BytesForSingleFireDiameter = true;
|
|
|
|
LOGGER_T &m_logger;
|
|
};
|
|
} // namespace TrainingAreaBaseOC
|