78 lines
2.4 KiB
C++
Executable File
78 lines
2.4 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* AreaEffectSimulation - Explosion Edit Dialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, SLSE, 2016-07-07
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
|
#include <Plugins/ProjectDataManagement/pdm_gui_plugin_interface.h>
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class BCContaminationEdit;
|
|
}
|
|
|
|
namespace AreaEffectSimulation
|
|
{
|
|
|
|
class BCContaminationEdit final
|
|
: public BaseEdit
|
|
, protected AreaEffectSimulation::Interface::Ftc::BCContaminationModifyReplyHandler
|
|
, protected AreaEffectSimulation::Interface::Ftc::DangerAreaModifyReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit BCContaminationEdit(const QString &menuGroup, bool isChemical, QWidget *parent = nullptr);
|
|
~BCContaminationEdit();
|
|
|
|
QString dialogIdentifier() const override
|
|
{
|
|
if (m_isChemical)
|
|
return m_aesItem.id() <= 0 ? QStringLiteral("AddCContamination") : QStringLiteral("EditCContamination%1").arg(m_aesItem.id());
|
|
return m_aesItem.id() <= 0 ? QStringLiteral("AddBContamination") : QStringLiteral("EditBContamination%1").arg(m_aesItem.id());
|
|
}
|
|
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
|
|
|
|
void onBCContaminationModifyReply(const Core::FunctionReplyObject &replyObject) override final { onAesItemModifyReply(replyObject); }
|
|
void onDangerAreaModifyReply(const Core::FunctionReplyObject &replyObject) override final { onAesItemModifyReply(replyObject); }
|
|
private:
|
|
static double s_minRadius;
|
|
static double s_maxRadius;
|
|
static double s_stepRadius;
|
|
static int s_minDurationHours;
|
|
static int s_maxDurationHours;
|
|
static double s_minAltitude;
|
|
static double s_maxAltitude;
|
|
|
|
void retranslate() override;
|
|
void setData(const BCContamination &contamination, bool copy);
|
|
void enableUiElements(bool enable) override;
|
|
void setPbDangerAreaText();
|
|
|
|
private Q_SLOTS:
|
|
void getPosition();
|
|
void onCircleData(const QPointF &position, double radius);
|
|
bool apply() override;
|
|
void onDangerAreaChanged(const DangerAreaCorrelatedAesItem &data, DataModification modType);
|
|
void onPbDangerAreaClicked();
|
|
void showPreviewObject() override;
|
|
|
|
private:
|
|
bool m_isChemical;
|
|
int m_associatedDangerId{0};
|
|
QSet<int> m_dangerAreaIds;
|
|
QPointF m_previewCircleCenter;
|
|
double m_previewCircleRadius;
|
|
Ui::BCContaminationEdit *m_ui;
|
|
std::shared_ptr<ProjectDataManagement::ForeignGuiInterface> m_pdmGuiIfc;
|
|
};
|
|
|
|
} //namespace AreaEffectSimulation
|