/** * @RDE_HEADER@ * HMI Plugin for AlarmManagement (Interface for access from other Plugins) * $Id$ * $HeadURL$ * $Author$ * Created by Steve Kemayou, SLSE, 2023-05-26 */ #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace Ui { class EmergencyCallDialog; } namespace AlarmManagement { /*! * \brief The UpdateSOSGuard class */ class UpdateSOSGuard { public: explicit UpdateSOSGuard(const std::shared_ptr &sitMapGuiIfc) : m_sitMapGuiIfc(sitMapGuiIfc) {} ~UpdateSOSGuard() { if (m_sitMapGuiIfc) m_sitMapGuiIfc->showExpiredEmergencyCalls(false); } void showExpiredSOS(bool visible) { if (m_sitMapGuiIfc) m_sitMapGuiIfc->showExpiredEmergencyCalls(visible); } private: std::shared_ptr m_sitMapGuiIfc; }; class EmergencyCallModel; class EmergencyCallProxyModel; class EmergencyCallDialog final : public LtsWidgets::LtsDialog , AlarmManagement::Interface::Ftc::EmergencyCallAcknowledgeReplyHandler { Q_OBJECT public: explicit EmergencyCallDialog(QWidget *parent = nullptr); ~EmergencyCallDialog(); bool init(const std::shared_ptr &ftc, const std::shared_ptr &dtc, const std::shared_ptr &sitMapGuiIfc, const std::shared_ptr &opmDtc, LtsSession::LtsSession *session); void retranslate() override; void enaDisa(); AlmEmergencyCall getSelectedSOS(); protected: void onEmergencyCallAcknowledgeReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void setAcknowledgeUi(); private slots: void onEditBtCliked(); void onSetShowExpired(bool show); void onFindEmergencyOnMap(); void onEmergencyIndexDoubleClicked(const QModelIndex &index); signals: void openInfoDlg(int id); private: void sendAcknowledgeEmergency(const QString &comment); void tableColumnOrganiserSetting() override; private: EmergencyCallModel *m_model{nullptr}; EmergencyCallProxyModel *m_proxyModel{nullptr}; std::shared_ptr m_dtc; std::shared_ptr m_ftc; std::shared_ptr m_sitMapGuiIfc; std::shared_ptr m_opmDtc; LtsSession::LtsSession *m_session; Ui::EmergencyCallDialog *m_ui; LtsUtils::RequestHelper *m_requestHelper; LOGGER_T m_logger; friend class UpdateSOSGuard; QSharedPointer m_updateSOSGuard; }; }// namespace EmergencyCallDialog