/** * @RDE_HEADER@ * Gui Plugin for OnlineReports * $Id$ * $HeadURL$ * $Author$ * Created by Hannes Baeuerle, SLSE, 2017-02-27 */ #include "alm_participant_gui_plugin.h" #include "alm_participant_dialog.h" #include "alm_participant_show_config.h" #include #include #include #include #include #include #include namespace ParticipantAlarms { std::shared_ptr GuiPlugin::createGuiInterface(LtsSession::LtsSession *session) { return std::make_shared(session); } InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session) : GuiPluginBase::Interface(session, AlarmManagement::getLogger("OnlineReports")) { } bool InterfaceImpl::fetchInterfaces() { return m_session->getDtc(m_ppmDtc) && m_session->getDtc(m_aesDtc) && m_session->getDtc(m_almDtc) && m_session->getFtc(m_almFtc) && m_session->getForeignGuiInterface(m_ppmGuiCbxIfc); } void InterfaceImpl::clearInterfaces() { m_ppmDtc = nullptr; m_aesDtc = nullptr; m_almDtc = nullptr; m_almFtc = nullptr; m_ppmGuiCbxIfc = nullptr; } QString InterfaceImpl::menuGroup() const { return tr("Alarm Management"); } QVector InterfaceImpl::getActions() { QVector ret; LtsWidgets::PluginData plData; plData.menuGroup = menuGroup(); plData.menuText = tr("Assign Participant Alarms"); plData.identifier = QLatin1String("almDialog"); plData.operatorRight = OperatorRights::ConfigParticipantDialog; plData.exercisePart = LtsWidgets::ExercisePart::eExecution; plData.layoutArea = LtsWidgets::LayoutArea::eDialogTab; plData.menuIcon = QIcon(QLatin1String("icon:config_player_alarms.svg")); plData.createWidgetFunc = [this](QWidget *) { return LtsWidgets::initDialog(new ParticipantsDialog(menuGroup()), m_session, m_ppmDtc, m_almDtc, m_almFtc, m_ppmGuiCbxIfc); }; ret.append(plData); plData.menuText = tr("Show Config Participant Alarms"); plData.identifier = QLatin1String("almShowConfigAlarm"); plData.operatorRight = OperatorRights::ConfigParticipantDialog; plData.exercisePart = LtsWidgets::ExercisePart::eExecution; plData.layoutArea = LtsWidgets::LayoutArea::eDialogTab; plData.menuIcon = QIcon(QLatin1String("icon:show_player_alarms.svg")); plData.createWidgetFunc = [this](QWidget * parent) { return LtsWidgets::initDialog(new ParticipantShowConfigView(m_session, parent), m_almDtc, m_almFtc, m_ppmDtc, m_aesDtc); }; ret.append(plData); return ret; } } // namespace OnlineReports