/** * @RDE_HEADER@ * AreaEffectSimulation - MineArea Edit Dialog * $Id$ * $HeadURL$ * $Author$ * * Created by Mike Wille, SLSE, 2016-09-26 */ #pragma once #include #include #include namespace Ui { class MineAreaEdit; } namespace AreaEffectSimulation { class MineAreaEdit final : public BaseEdit , protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyReplyHandler , protected AreaEffectSimulation::Interface::Ftc::MineResetReplyHandler { Q_OBJECT public: explicit MineAreaEdit(const QString &menuGroup, QWidget *parent = nullptr); ~MineAreaEdit(); QString dialogIdentifier() const override { return m_aesItem.id() <= 0 ? QStringLiteral("AddMineArea") : QStringLiteral("EditMineArea%1").arg(m_aesItem.id()); } bool init(int aesItemId, bool copy, LtsSession::LtsSession *session); void onMineAreaModifyReply(const Core::FunctionReplyObject &replyObject) override final { onAesItemModifyReply(replyObject); } void onMineResetReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: std::vector coordWidgets() const override; void retranslate() override; static constexpr double s_minWidth = 1; static constexpr double s_maxWidth = 250; static constexpr double s_stepWidth = 1; static constexpr double s_minDensity = 0.1; static constexpr double s_maxDensity = 0.9; static constexpr double s_stepDensity = 0.1; static constexpr double s_maxLength = 2500; static constexpr int s_maxSegments = 10; static constexpr int s_maxDurationHours = 96; void setData(const MineArea &data, bool copy); void enableUiElements(bool enable) override; double getMaxLength() const override { return s_maxLength; } private slots: void getPosition(); void onMapRecData(const double width, const QVector &polygon, const QPolygonF &bufferOutlinePolygon); void onPolygonData(const QPolygonF &polygon); bool onResetDusMines(); bool apply() override final; void onLayingProcedureChanged(); void showPreviewObject() override; void onChargeTypeChanged(int index); private: std::shared_ptr m_pdmGuiIfc; std::shared_ptr m_pdmDtc; std::shared_ptr m_aesDtc; Ui::MineAreaEdit *m_ui; QMap m_coordMap; QPolygonF m_previewPolygon; int m_segments; }; } //namespace AreaEffectSimulation