/** * @RDE_HEADER@ * GUI Plugin for ResourceManangement * $Id$ * $HeadURL$ * $Author$ * * Created by Mike Wille, SLSE, 2016-11-02 */ #pragma once #include // TODO: forward decls ? #include #include #include #include /* // TODO: forward decls ? #include #include */ namespace LtsUtils { class RequestHelper; } namespace LtsNotification { class LtsNotification; } namespace InfrastructureManagement { class GuiPlugin final : public QObject, public GuiPluginBase::Plugin { Q_PLUGIN_METADATA(IID "gui:3:ism.res") Q_INTERFACES(GuiPluginBase::Plugin) Q_OBJECT public: explicit GuiPlugin() = default; ~GuiPlugin() = default; QString pluginName() override { return ForeignResourceManagementGuiInterface::pluginName(); } std::shared_ptr createGuiInterface(LtsSession::LtsSession *session) override; bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Exercise || partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Replay; } }; class MountingPointSelector; class InterfaceImpl final : public QObject , public ForeignResourceManagementGuiInterface , public GuiPluginBase::Interface , protected InfrastructureManagement::Interface::Ftc::MainScheduleModifyReplyHandler { Q_OBJECT public: explicit InterfaceImpl(LtsSession::LtsSession *session); QString menuGroup() const override { return tr("Resource Management"); } bool fetchInterfaces() override; void clearInterfaces() override; QVector getActions() override; // be able to show plan chooser int executionPriority() const override { return 9999; } void executePayload(LtsWidgets::LtsBackgroundWidget *mainBackground) override; void setPlanId(const int planId) override final; int getPlanId() const override final; bool isInSelectionMode() const override final; void setSelector(MountingPointSelector *selector) override final; void addToSelection(int32_t mountingPointId) override final; void addToSelection(const QVector &simIds) override final; void showMountingPointInfoWindows(const QVector &entityIds, bool force = false) override final; private: // methods LtsWidgets::LtsDialog *slotShowPlanDialog(QWidget *parent); LtsWidgets::LtsDialog *slotShowOverviewDialog(QWidget *parent); LtsWidgets::LtsDialog *slotShowAssetListDialog(QWidget *parent); LtsWidgets::LtsDialog *slotShowMountingPointListDialog(QWidget *parent); LtsWidgets::LtsDialog *slotShowApproachingPointsDialog(QWidget *parent); // LtsWidgets::LtsDialog *slotShowPlanTimeLineDialog(QWidget *parent); LtsWidgets::LtsDialog *slotAddPlanDialog(QWidget *parent); LtsWidgets::LtsDialog *slotShowMntpCompletenessCheckDialog(QWidget *parent); void onMainScheduleModifyReply(const Core::FunctionReplyObject &replyObject) override final; private: // attributes // std::shared_ptr m_dtc; // std::shared_ptr m_ftc; // std::shared_ptr m_ismIfc; std::shared_ptr m_avmIfc; std::shared_ptr m_sitmapGuiIfc; int m_planId; LtsUtils::RequestHelper *m_requestHelper{nullptr}; MountingPointSelector *m_mountingPointSelector{nullptr}; LtsNotification::LtsNotification *m_notiResourceManagerMode{nullptr}; signals: void signalSuccess(); private slots: void slotOnSessionReady(); void slotOnMapReady(); void slotSelectPlan(int planId); void slotNewPlan(); void onResourceManagerModeChanged(SituationMap::ResourceManagerMode newMode); }; } // namespace InfrastructureManagement