90 lines
2.5 KiB
C++
Executable File
90 lines
2.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Gui Plugin for ObserverController
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Patric Karwat, SLSE, 2018-01-17
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
|
|
#include <Plugins/OcSituationClient/osc_gui_plugin_interface.h>
|
|
#include <TrainingAreaBaseOC/taboc_data_plugin_interface.h>
|
|
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
|
|
|
#include <QSoundEffect>
|
|
|
|
class QNetworkSession;
|
|
namespace LtsNotification
|
|
{
|
|
class LtsNotification;
|
|
}
|
|
|
|
namespace OcSituationClient
|
|
{
|
|
|
|
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
|
{
|
|
Q_PLUGIN_METADATA(IID "gui:3:osc.system")
|
|
Q_INTERFACES(GuiPluginBase::Plugin)
|
|
|
|
Q_OBJECT
|
|
public:
|
|
GuiPlugin() = default;
|
|
~GuiPlugin() = default;
|
|
|
|
QString pluginName() override { return QStringLiteral("ObserverController.System"); }
|
|
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 ForeignGuiInterface, public GuiPluginBase::Interface
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
|
~InterfaceImpl();
|
|
|
|
bool fetchInterfaces() override;
|
|
void clearInterfaces() override;
|
|
QString menuGroup() const override;
|
|
QVector<LtsWidgets::PluginData> getActions() override;
|
|
bool availableInPartition(IDL::PartitionType partition) const override
|
|
{
|
|
return partition == IDL::PartitionType::Global || partition == IDL::PartitionType::Exercise;
|
|
}
|
|
|
|
private slots:
|
|
//void slotConnectionChanged(const OcSituationClient:: &data, DataModification modType);
|
|
void onEnterLeaveAesChanged(const TrainingAreaBaseOC::EnterLeaveAes &data, DataModification modType);
|
|
void onCheckAllEffectAreas();
|
|
|
|
|
|
Q_SIGNALS:
|
|
void updateAesList(const QSet<int> &newList);
|
|
private:
|
|
LtsWidgets::LtsDialog *onShowSelfTest(QWidget *parent);
|
|
LtsWidgets::LtsDialog *onShowSettings(QWidget *parent);
|
|
LtsWidgets::LtsDialog *onShowCloseAes(QWidget *parent = nullptr);
|
|
|
|
std::shared_ptr<TrainingAreaBaseOC::Interface::Dtc> m_tabocDtc;
|
|
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_aesDtc;
|
|
QString m_closeAreaIdentifier;
|
|
QSet<int> m_closeAes;
|
|
QSoundEffect m_enterSound;
|
|
QSoundEffect m_leaveSound;
|
|
QSoundEffect m_nearInSound;
|
|
QSoundEffect m_nearOutSound;
|
|
|
|
};
|
|
|
|
} // namespace OcSituationClient
|