71 lines
1.8 KiB
C++
Executable File
71 lines
1.8 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* GUI Plugin for InfrastructureManagement - IsmComboBox
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2018-01-16
|
|
*/
|
|
|
|
#include "ism_combobox_gui_plugin.h"
|
|
|
|
namespace InfrastructureManagement
|
|
{
|
|
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
|
|
{
|
|
return std::make_shared<InterfaceImpl>(session);
|
|
}
|
|
|
|
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
|
|
: GuiPluginBase::Interface(session, getLogger("Plugins.Gui.IsmCombobox"))
|
|
, m_dtc(nullptr)
|
|
{}
|
|
|
|
bool InterfaceImpl::fetchInterfaces()
|
|
{
|
|
// if (!m_session->getDtc<InfrastructureManagement::DataInterface>(m_dtc))
|
|
// {
|
|
// DEBUG_LOG(m_logger) << "Failed to fetch Dtc InfrastructureManagement interface!";
|
|
// return false;
|
|
// }
|
|
|
|
return true;
|
|
}
|
|
|
|
void InterfaceImpl::clearInterfaces()
|
|
{
|
|
m_dtc = nullptr;
|
|
}
|
|
|
|
bool InterfaceImpl::fillRadioStationsComboBox(LtsWidgets::LtsComboBox *cbx, int filter)
|
|
{
|
|
return fillIsmComboBox(cbx, IsmComboBoxType::CbRadioStations, filter);
|
|
}
|
|
|
|
bool InterfaceImpl::fillApproachingPointsComboBox(LtsWidgets::LtsComboBox *cbx)
|
|
{
|
|
return fillIsmComboBox(cbx, IsmComboBoxType::CbApproachingPoints);
|
|
}
|
|
|
|
bool InterfaceImpl::fillScheduleStatusComboBox(LtsWidgets::LtsComboBox *cbx)
|
|
{
|
|
return fillIsmComboBox(cbx, IsmComboBoxType::CbScheduleStatus);
|
|
}
|
|
|
|
bool InterfaceImpl::fillBridgeStatusComboBox(LtsWidgets::LtsComboBox *cbx)
|
|
{
|
|
return fillIsmComboBox(cbx, IsmComboBoxType::CbBridgeStatus);
|
|
}
|
|
|
|
//private
|
|
|
|
bool InterfaceImpl::fillIsmComboBox(LtsWidgets::LtsComboBox *cbx, IsmComboBoxType type, int filter)
|
|
{
|
|
if (!m_dtc && !m_session->getDtc<InfrastructureManagement::DataInterface>(m_dtc))
|
|
return false;
|
|
|
|
return IsmComboBox::fill(cbx, type, m_session, m_dtc, filter);
|
|
}
|
|
|
|
} // namespace InfrastructureManagement
|