115 lines
4.1 KiB
C++
Executable File
115 lines
4.1 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ParticipantManagement - ParticipantTargetConfigurationDialog (L400)
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Norbert Thoden, SLSE, 2022-05-10
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
//Lts
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
|
|
//ParticipantManagement
|
|
#include <ParticipantManagement/logger.h>
|
|
#include <ParticipantManagement/ppm_dtc.h>
|
|
#include <ParticipantManagement/ppm_ftc.h>
|
|
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
|
|
#include <Plugins/AreaEffectSimulation/aes_data_plugin_interface.h>
|
|
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
#include "participant_shootback_area_model.h"
|
|
|
|
#include <QItemDelegate>
|
|
|
|
namespace Ui {
|
|
class ParticipantTargetConfigurationDialog;
|
|
}
|
|
|
|
namespace ParticipantManagement
|
|
{
|
|
// --------------------------------------------------------
|
|
// ParticipantTargetConfigurationDialog
|
|
// --------------------------------------------------------
|
|
class ParticipantTargetConfigurationDialog final : public LtsWidgets::LtsDialog
|
|
, protected ParticipantManagement::Interface::Ftc::InitParticipantReplyHandler
|
|
, protected ParticipantManagement::Interface::Ftc::ModifyStateReplyHandler
|
|
, protected ParticipantManagement::Interface::Ftc::ModifyTargetInformationReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ParticipantTargetConfigurationDialog(QWidget *parent = nullptr);
|
|
~ParticipantTargetConfigurationDialog();
|
|
|
|
bool init(int participantId,
|
|
const std::shared_ptr<Interface::Dtc> &dtc,
|
|
const std::shared_ptr<Interface::Ftc> &ftc,
|
|
const std::shared_ptr<SituationMap::ForeignGuiInterface> &sitMapGuiIfc);
|
|
|
|
private Q_SLOTS:
|
|
void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &dynData, DataModification modType);
|
|
void onTargetInformationChanged(const TargetInformation &data, DataModification modType);
|
|
void onStatusChanged();
|
|
void onGuiChanged(); // -> update m_targetInformation
|
|
void onDataChanged(); // -> update GUI
|
|
|
|
void onAddBtnClicked();
|
|
void onEditBtnClicked();
|
|
void onRemoveBtnClicked();
|
|
void onShowOnMapChanged(int);
|
|
|
|
// sitMap-related slots:
|
|
void onPolygonData(const QPolygonF &poly);
|
|
|
|
private:
|
|
void retranslate() override;
|
|
bool apply() override final;
|
|
void onInitParticipantReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); }
|
|
void onModifyStateReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); }
|
|
void onModifyTargetInformationReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); }
|
|
|
|
void fillStatusComboBox();
|
|
void fillPrewarningEffectComboBox();
|
|
void fillTakeDownEffectComboBox();
|
|
|
|
void setupConnections();
|
|
void onSelectionChanged();
|
|
void showPreviewObject();
|
|
|
|
int m_participantId{-1};
|
|
TargetInformation m_targetInformation;
|
|
AreaModel m_areaModel;
|
|
|
|
std::shared_ptr<Interface::Dtc> m_dtc;
|
|
std::shared_ptr<Interface::Ftc> m_ftc;
|
|
|
|
LtsUtils::RequestHelper *m_requestHelper{nullptr};
|
|
|
|
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
|
|
bool m_rubberbandEditMode{false};
|
|
QPolygonF m_previewPolygon;
|
|
|
|
Ui::ParticipantTargetConfigurationDialog *m_ui{nullptr};
|
|
LOGGER_T m_logger;
|
|
};
|
|
|
|
class EditNameDelegate : public QItemDelegate
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit EditNameDelegate(QWidget *parent = nullptr);
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|
const QModelIndex &index) const override ;
|
|
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|
const QModelIndex &index) const override;
|
|
private:
|
|
LOGGER_T &m_logger; ///< Interface to the Logging-Facility
|
|
};
|
|
|
|
} // namespace ParticipantManagement
|