Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+75
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Handler for aes data to be send to the oc-laptop transparent
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Dassow, NLST, 18-04-2018
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QMap>
|
||||
#include <QSet>
|
||||
#include <functional>
|
||||
|
||||
#include "main_handler.h"
|
||||
#include "position_converter.h"
|
||||
#include "oc_situation.h"
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
namespace OcSituationServer
|
||||
{
|
||||
class HandlerOcAesData : public QObject
|
||||
, protected TrainingAreaBase::Interface::Ftc::SendOcDataReplyHandler
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit HandlerOcAesData(MainHandler *mainHandler,
|
||||
QObject *parent = nullptr);
|
||||
~HandlerOcAesData();
|
||||
|
||||
bool init();
|
||||
int dangerAreaResetCnt() { return m_dangerAreaResetCnt; }
|
||||
int iedResetCnt() { return m_iedResetCnt; }
|
||||
|
||||
void demandAesItems(OcSituation::AesType aesType, int eqNumber);
|
||||
|
||||
void onSendOcDataReply(const Core::FunctionReplyObject &reply);
|
||||
|
||||
private slots:
|
||||
void onDangerAreaChanged(const AreaEffectSimulation::DangerArea &data, DataModification mod);
|
||||
void onIedChanged(const GuezIedManagement::Ied &data, DataModification mod);
|
||||
void onIedPositionChanged(const GuezIedManagement::IedPosition &data, DataModification mod);
|
||||
void onCollectionTimeOutDemandDangerAreas();
|
||||
void onCollectionTimeOutDemandIeds();
|
||||
void sendIedPositions();
|
||||
|
||||
private:
|
||||
void collectionTimeout(OcSituation::AesType type, const std::function<void (int)> &sendFunction);
|
||||
void sendDangerAreasToTab(int eqNumber);
|
||||
void sendIedsToTab(int eqNumber);
|
||||
void incrementResetCnt(OcSituation::AesType aesType);
|
||||
void setResetCnt(OcSituation::AesType aesType, int resetCnt);
|
||||
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_aesDtc;
|
||||
std::shared_ptr<GuezIedManagement::Interface::Dtc> m_gimDtc;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Ftc> m_tabFtc;
|
||||
|
||||
std::shared_ptr<DatabaseInterface> m_dbHandler;
|
||||
std::shared_ptr<PositionConverter> m_positionConverter;
|
||||
|
||||
// add new reset counter also in oss_predefined_data.sql !!
|
||||
int m_dangerAreaResetCnt;
|
||||
int m_iedResetCnt;
|
||||
|
||||
QMap<OcSituation::AesType, QTimer *> m_collectionTimer;
|
||||
QMap<OcSituation::AesType, QSet<int>> m_demandingEquipments;
|
||||
|
||||
QMap<int, GuezIedManagement::IedPosition> m_iedPositionsToBeSend;
|
||||
QTimer *m_iedPositionCycleTimer;
|
||||
|
||||
LOGGER_T &m_logger;
|
||||
};
|
||||
} // namespace OcSituationServer
|
||||
Reference in new issue
Block a user