95 lines
2.6 KiB
C++
Executable File
95 lines
2.6 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Target Configuration
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Norbert Thoden, NLE, 2020-06-29
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <TargetManagement/tgt_dtc.h>
|
|
#include <TargetManagement/tgt_ftc.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
#include <TargetManagement/logger.h>
|
|
#include <Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_model.h>
|
|
#include <Plugins/FileManagement/flm_explorer_gui_plugin_interface.h>
|
|
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class AreaDialog;
|
|
}
|
|
|
|
namespace TargetManagement
|
|
{
|
|
|
|
class AreaDialog final : public LtsWidgets::LtsDialog
|
|
, protected TargetManagement::Interface::Ftc::ShootbackAreaModifyReplyHandler
|
|
, protected TargetManagement::Interface::Ftc::ShootbackAreaRemoveReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
using BaseClass = LtsWidgets::LtsDialog;
|
|
|
|
explicit AreaDialog(const QString &menuGroup, LtsSession::LtsSession *session, QWidget *parent = nullptr);
|
|
~AreaDialog();
|
|
|
|
bool init();
|
|
|
|
void retranslate() override;
|
|
|
|
Q_SIGNALS:
|
|
void escapePressed();
|
|
|
|
protected:
|
|
void keyPressEvent(QKeyEvent *event) override final;
|
|
void onShootbackAreaModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
|
void onShootbackAreaRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); }
|
|
|
|
QByteArray toJson() const;
|
|
QVector<ShootbackArea> fromJson(const QByteArray &content);
|
|
|
|
private Q_SLOTS:
|
|
void onEscapePressed();
|
|
void onSelectionChanged();
|
|
void onNewArea();
|
|
void onRemoveArea();
|
|
void onEditArea();
|
|
|
|
void onExportButtonClicked();
|
|
void onImportButtonClicked();
|
|
void onImport();
|
|
|
|
void onAssignTargetButtonClicked();
|
|
|
|
void onMapCenterClicked();
|
|
void onMapZoomToClicked();
|
|
|
|
void onObjectEntered(const QModelIndex &index);
|
|
void onTableViewClicked(const QModelIndex &index);
|
|
|
|
void clearSelectionOfMapObjects();
|
|
|
|
private:
|
|
QPushButton *m_assignTargetBtn{nullptr};
|
|
AreaModel *m_areaModel{nullptr};
|
|
|
|
std::shared_ptr<TargetManagement::Interface::Dtc> m_dtc;
|
|
std::shared_ptr<TargetManagement::Interface::Ftc> m_ftc;
|
|
std::shared_ptr<FileManagement::ForeignGuiInterface> m_flmGui;
|
|
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
|
|
|
|
LtsSession::LtsSession *m_session{nullptr};
|
|
Ui::AreaDialog *m_ui{nullptr};
|
|
QString m_menuGroup;
|
|
LtsUtils::RequestHelper *m_requestHelper{nullptr};
|
|
LOGGER_T m_logger;
|
|
};
|
|
|
|
} // namespace TargetManagement
|