66 lines
1.6 KiB
C++
Executable File
66 lines
1.6 KiB
C++
Executable File
/**
|
|
* Handler ObjectShootbackTargets (L400)
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by N. Thoden, NLE, 06.04.2020
|
|
*/
|
|
#pragma once
|
|
|
|
#include "dds_handler.h"
|
|
#include "logger.h"
|
|
|
|
#include <Core/function_reply_object.h>
|
|
|
|
// Generated
|
|
#include <TargetManagement/tgt.hpp>
|
|
#include <TargetManagement/tgt_db.h>
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace TargetManagement
|
|
{
|
|
class MainHandler;
|
|
|
|
class ObjectShootbackTarget
|
|
{
|
|
public:
|
|
explicit ObjectShootbackTarget(MainHandler *mainHandler);
|
|
~ObjectShootbackTarget();
|
|
|
|
Core::FunctionReplyObject createObject(const ShootbackTarget &data);
|
|
Core::FunctionReplyObject updateObject(const ShootbackTarget &data);
|
|
Core::FunctionReplyObject removeObject();
|
|
|
|
void updateVolatileData(const std::vector<int32_t> &visibleParticipant);
|
|
void updateVolatileData(const Core::GeoPosition &position);
|
|
|
|
|
|
qint32 getId() const { return m_data.id(); }
|
|
QString getName() const { return QString::fromStdString(m_data.name()); }
|
|
qint32 getTargetParticipantId() const { return m_data.targetParticipantId(); }
|
|
const ShootbackTarget &getData() const { return m_data; }
|
|
|
|
bool isValid() const;
|
|
bool isUsed() const;
|
|
Core::FunctionReplyObject setUsed(bool isUsed);
|
|
|
|
// convert methods
|
|
static Database::TgtShootbackTarget toDbData(const ShootbackTarget &ddsData); // dds -> db
|
|
static ShootbackTarget toDdsData(const Database::TgtShootbackTarget &dbData); // db -> dds
|
|
bool isDifferent(const Database::TgtShootbackTarget &dbData);
|
|
|
|
protected:
|
|
void onPublishData();
|
|
|
|
private:
|
|
MainHandler *m_mainHandler;
|
|
ShootbackTarget m_data;
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
}
|