Files
qt5-legatus-legacy/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_management_gui_plugin.h
T
2026-08-13 18:33:10 +02:00

92 lines
3.2 KiB
C++
Executable File

/**
*@RDE_HEADER@
* Gui Plugin for SituationReplayManagement - Replay Management
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2016-07-19
*/
#pragma once
#include <LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/SituationReplayManagement/srm_data_plugin_interface.h>
#include <Plugins/SituationReplayManagement/srm_gui_plugin_interface.h>
#include <Plugins/FilterManagement/flt_participant_plugin_interface.h>
#include <Plugins/FilterManagement/flt_aes_plugin_interface.h>
#include <Plugins/FilterManagement/flt_data_plugin_interface.h>
#include <Services/SituationReplayManagement/logger.h>
namespace SituationReplayManagement
{
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
{
Q_PLUGIN_METADATA(IID "gui:3:srm")
Q_INTERFACES(GuiPluginBase::Plugin)
Q_OBJECT
public:
GuiPlugin() = default;
~GuiPlugin() = default;
QString pluginName() override { return QStringLiteral("SituationReplayManagement"); }
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
bool availableInPartition(IDL::PartitionType partition) const override
{
return partition == IDL::PartitionType::Exercise || partition == IDL::PartitionType::Global;
}
};
class InterfaceImpl final : public QObject, public GuiPluginBase::Interface
, protected SituationReplayManagement::Interface::Ftc::ReplayPartitionCreateReplyHandler
, private FilterManagement::Interface::Ftc::AesFilterUpdateReplyHandler
, private FilterManagement::Interface::Ftc::SymbolAppearanceUpdateReplyHandler
{
Q_OBJECT
public:
explicit InterfaceImpl(LtsSession::LtsSession *session);
~InterfaceImpl();
QVector<LtsWidgets::PluginData> getActions() override;
QString menuGroup() const override;
bool fetchInterfaces() override;
void clearInterfaces() override;
bool availableInPartition(IDL::PartitionType partition) const override
{
return partition == IDL::PartitionType::Exercise || partition == IDL::PartitionType::Global;
}
private:
void startReplay();
void startReplayApp(const Core::ReplayPartition &data);
void startReplayAppInternal();
private:
void onReplayPartitionCreateReply(const Core::FunctionReplyObject &reply) override { m_requestHelper->requestReply(reply); }
void onAesFilterUpdateReply(const Core::FunctionReplyObject &replyObject) override;
void onSymbolAppearanceUpdateReply(const Core::FunctionReplyObject &replyObject) override;
bool transferFilter(const Core::ReplayPartition &data);
private:
std::shared_ptr<Core::Interface::Dtc> m_coreDtc;
std::shared_ptr<SituationReplayManagement::ForeignDataInterface> m_sitRepIfc;
std::shared_ptr<FilterManagement::ForeignFltParticipantGuiInterface> m_fltParticipantIfc;
std::shared_ptr<FilterManagement::ForeignAesGuiInterface> m_fltAesIfc;
std::shared_ptr<FilterManagement::Interface::Ftc> m_fltFtc;
LtsUtils::RequestHelper *m_requestHelper;
int m_replayPartitionId;
bool m_aesTransfered = false;
bool m_symbolAppearanceTransfered = false;
Core::ReplayPartition m_data;
};
} // namespace SituationReplayManagement