70 lines
2.2 KiB
C++
Executable File
70 lines
2.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Gui Plugin for InfrastructureManagement - IsmComboBox
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2018-01-16
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "ism_combobox.h"
|
|
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
#include <InfrastructureManagement/logger.h>
|
|
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <Plugins/InfrastructureManagement/ism_combobox_gui_plugin_interface.h>
|
|
#include <Plugins/InfrastructureManagement/ism_data_plugin_interface.h>
|
|
|
|
#include <QComboBox>
|
|
|
|
namespace InfrastructureManagement
|
|
{
|
|
|
|
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
|
{
|
|
Q_PLUGIN_METADATA(IID "gui:3:ism.combobox")
|
|
Q_INTERFACES(GuiPluginBase::Plugin)
|
|
|
|
Q_OBJECT
|
|
public:
|
|
GuiPlugin() = default;
|
|
~GuiPlugin() = default;
|
|
|
|
QString pluginName() override { return QStringLiteral("InfrastructureManagement.GuiPlugin.ComboBox"); }
|
|
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
|
|
bool availableInPartition(IDL::PartitionType partition) const override
|
|
{
|
|
return (partition == IDL::PartitionType::Global ||
|
|
partition == IDL::PartitionType::Exercise ||
|
|
partition == IDL::PartitionType::Replay);
|
|
}
|
|
};
|
|
|
|
class InterfaceImpl final : public QObject, public ForeignGuiComboboxInterface, public GuiPluginBase::Interface
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
|
|
|
bool fetchInterfaces() override;
|
|
void clearInterfaces() override;
|
|
QString menuGroup() const override { return QString(); }
|
|
bool availableInPartition(IDL::PartitionType partition) const override { return partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise; }
|
|
|
|
// ForeignDataInterface
|
|
bool fillRadioStationsComboBox(LtsWidgets::LtsComboBox *cbx, int filter) override;
|
|
bool fillApproachingPointsComboBox(LtsWidgets::LtsComboBox *cbx) override;
|
|
bool fillScheduleStatusComboBox(LtsWidgets::LtsComboBox *cbx) override;
|
|
bool fillBridgeStatusComboBox(LtsWidgets::LtsComboBox *cbx) override;
|
|
|
|
private:
|
|
bool fillIsmComboBox(LtsWidgets::LtsComboBox *cbx, IsmComboBoxType type, int filter = -1);
|
|
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_dtc;
|
|
};
|
|
|
|
} // namespace InfrastructureManagement
|