Files
qt5-legatus-legacy/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_gui_plugin.h
T
2026-08-13 18:33:10 +02:00

122 lines
4.9 KiB
C++
Executable File

/**
*@RDE_HEADER@
* Gui Plugin for ParticipantManagement - ParticipantInfo
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Ehrlicher, SLSE, 2016-02-29
*/
#pragma once
#include <ParticipantManagement/logger.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <LtsSession/lts_session.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_participant_info_gui_plugin_interface.h>
#include <Plugins/OcSituationClient/osc_participant_info_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
#include <Plugins/ProjectDataManagement/pdm_data_plugin_interface.h>
#include <Plugins/ProjectDataManagement/pdm_gui_plugin_interface.h>
#include <Plugins/AdvancedSymbology/asb_data_plugin_interface.h>
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
#include <FilterManagement/flt_participant_plugin_interface.h>
#include <FilterManagement/flt_symbol_appearance_settings.h>
#include "participant_search_widget.h"
namespace LtsNotification
{
class LtsNotification;
}
class QShortcut;
namespace ParticipantManagement
{
class ParticipantSearchModal;
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
{
Q_PLUGIN_METADATA(IID "gui:3:ppm.participantinfo")
Q_INTERFACES(GuiPluginBase::Plugin)
Q_OBJECT
public:
GuiPlugin() = default;
~GuiPlugin() = default;
QString pluginName() override { return QStringLiteral("ParticipantManagement.GuiPlugin.ParticipantInfo"); }
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 ForeignParticipantInfoGuiInterface, public GuiPluginBase::Interface
{
Q_OBJECT
public:
explicit InterfaceImpl(LtsSession::LtsSession *session);
QVector<LtsWidgets::PluginData> getActions() override;
bool fetchInterfaces() override;
void clearInterfaces() override;
QString menuGroup() const override;
bool availableInPartition(IDL::PartitionType partition) const override
{ return partition == IDL::PartitionType::Exercise ||
partition == IDL::PartitionType::Replay; }
// ForeignDataInterface
void showParticipantInfoWindow(const QVector<int> &entityIds) override;
void showParticipantInfoWindow(int entityId, bool hideSituationMapRelatedButtons = false) override;
void showBiteWindow(const QJsonObject &detailData) override;
void showHitLineInfoWindow(const QVector<int> &hitLineIds) override;
void showHitLineInfoWindow(int hitLineId) override;
static const QString s_participantInfoScheme;
public slots:
void onNewFollowEquipment(const int equipmentNumber, const int participantId);
void onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType);
void onUnitPositionChanged(const ParticipantManagement::UnitPosition &data, DataModification modType);
private slots:
void onShowSearchParticipant();
private:
LtsWidgets::LtsDialog *onShowParticipantInfoTableDialog(QWidget *parent);
LtsWidgets::LtsDialog *onShowParticipantConfigDialog(bool isMessage, QWidget *parent);
LtsWidgets::LtsDialog *onShowParticipantSearchDialog(QWidget *parent);
LtsWidgets::LtsDialog *onShowParticipantFollowDialog(QWidget *parent);
bool eventFilter(QObject *obj, QEvent *event) override; // show participant info dialog on clicked link
// bool event(QEvent *event) override; // show participant info dialog on clicked link
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
std::shared_ptr<ProjectDataManagement::ForeignGuiInterface> m_pdmGuiIfc;
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitmapGuIfc;
std::shared_ptr<AdvancedSymbology::ForeignDataInterface> m_asbIfc;
std::shared_ptr<ParticipantManagement::ForeignParticipantInfoGuiInterface> m_ppmGuiIfc;
std::shared_ptr<OcSituationClient::ForeignParticipantInfoGuiInterface> m_ppmOcGuiIfc;
std::shared_ptr<SituationMap::ForeignGuiInterface> m_sitMapGuiIfc;
std::shared_ptr<FilterManagement::SymbolAppearanceSettings> m_symbolAppearanceSettings;
std::shared_ptr<FilterManagement::ForeignFltParticipantGuiInterface> m_fltParticipantIfc;
QShortcut *m_scSearchParticipant = nullptr;
QPointer<ParticipantSearchModal> m_participantShowModalPtr;
LtsNotification::LtsNotification *m_noti = nullptr;
int m_followEquipmentNumber = 0;
int m_followParticipantId = 0;
LtsNotification::LtsNotification *m_notiSearchParticipant = nullptr;
ParticipantSearchWidget *m_participantSearchWidget = nullptr;
};
} // namespace ParticipantManagement