Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+96
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* @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 <AlarmManagement/alm_data_plugin_interface.h>
|
||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||
#include <ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
||||
#include <AlarmManagement/alm_operator_rights.h>
|
||||
#include <AlarmManagement/logger.h>
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
|
||||
namespace ParticipantAlarms
|
||||
{
|
||||
|
||||
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
|
||||
{
|
||||
return std::make_shared<InterfaceImpl>(session);
|
||||
}
|
||||
|
||||
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
|
||||
: GuiPluginBase::Interface(session, AlarmManagement::getLogger("OnlineReports"))
|
||||
{
|
||||
}
|
||||
|
||||
bool InterfaceImpl::fetchInterfaces()
|
||||
{
|
||||
return m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) &&
|
||||
m_session->getDtc<AreaEffectSimulation::DataInterface>(m_aesDtc) &&
|
||||
m_session->getDtc<AlarmManagement::DataInterface>(m_almDtc) &&
|
||||
m_session->getFtc<AlarmManagement::DataInterface>(m_almFtc) &&
|
||||
m_session->getForeignGuiInterface<ParticipantManagement::ForeignGuiComboboxInterface>(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<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
||||
{
|
||||
QVector<LtsWidgets::PluginData> 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
|
||||
Reference in new issue
Block a user