/** * @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 GuiPlugin::createGuiInterface(LtsSession::LtsSession *session) { return std::make_shared(session); } InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session) : GuiPluginBase::Interface(session, getLogger("Plugins.Gui.IsmCombobox")) , m_dtc(nullptr) {} bool InterfaceImpl::fetchInterfaces() { // if (!m_session->getDtc(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(m_dtc)) return false; return IsmComboBox::fill(cbx, type, m_session, m_dtc, filter); } } // namespace InfrastructureManagement