85 lines
2.5 KiB
C++
Executable File
85 lines
2.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* TargetManagement - Target Edit Dialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Norbert Thoden, NLE, 2020-05-29
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
|
|
#include <Services/TargetManagement/tgt_dtc.h>
|
|
#include <Services/TargetManagement/tgt_ftc.h>
|
|
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
|
|
|
#include <TargetManagement/logger.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class AreaEdit;
|
|
}
|
|
|
|
namespace TargetManagement
|
|
{
|
|
class AreaModel;
|
|
|
|
class AreaEdit : public LtsWidgets::LtsDialog,
|
|
protected TargetManagement::Interface::Ftc::ShootbackAreaModifyReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AreaEdit(QWidget *parent = nullptr);
|
|
~AreaEdit();
|
|
|
|
bool init(const std::shared_ptr<TargetManagement::Interface::Dtc> &dtc,
|
|
const std::shared_ptr<TargetManagement::Interface::Ftc> &ftc,
|
|
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMapGuiIfc,
|
|
AreaModel *areaModel,
|
|
const ShootbackArea &area = ShootbackArea());
|
|
|
|
|
|
//virtual functions from TargetManagement::Interface::Ftc::..
|
|
void onShootbackAreaModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); }
|
|
|
|
public Q_SLOTS:
|
|
|
|
private Q_SLOTS:
|
|
void enaDisa();
|
|
void getPosition();
|
|
void onRectData(const QPointF ¢erPoint, double width, double height, const QPolygonF &coordinates);
|
|
|
|
private:
|
|
bool has2DMap();
|
|
void showPreviewObject();
|
|
|
|
void setData(const ShootbackArea &area);
|
|
bool apply() override;
|
|
void retranslate() override;
|
|
|
|
static constexpr double s_minWidth {10};
|
|
static constexpr double s_maxWidth {1000};
|
|
static constexpr double s_stepWidth {5};
|
|
static constexpr double s_minHeight {10};
|
|
static constexpr double s_maxHeight {1000};
|
|
static constexpr double s_stepHeight {5};
|
|
|
|
ShootbackArea m_area;
|
|
QPolygonF m_previewPolygon;
|
|
AreaModel *m_areaModel{nullptr};
|
|
|
|
std::shared_ptr<TargetManagement::Interface::Dtc> m_dtc;
|
|
std::shared_ptr<TargetManagement::Interface::Ftc> m_ftc;
|
|
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
|
|
LtsUtils::RequestHelper *m_requestHelper{nullptr};
|
|
Ui::AreaEdit *m_ui{nullptr};
|
|
LOGGER_T m_logger;
|
|
};
|
|
|
|
} //namespace TargetManagement
|