88 lines
2.2 KiB
C++
Executable File
88 lines
2.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Plugin to watch the currently active Exercise and keep track of the Exc Name, Exc Phase, etc.
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Mike Wille, SLSE, 2017-09-29
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <ExerciseManagement/logger.h>
|
|
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <Common/ProjectConfig/project_defines.h>
|
|
#include <Plugins/ExerciseManagement/exm_data_plugin_interface.h>
|
|
#include <Plugins/ExerciseManagement/exm_gui_plugin_interface.h>
|
|
|
|
|
|
namespace ExerciseManagement
|
|
{
|
|
|
|
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
|
|
{
|
|
Q_PLUGIN_METADATA(IID "gui:3:exm.watch")
|
|
Q_INTERFACES(GuiPluginBase::Plugin)
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit GuiPlugin() = default;
|
|
~GuiPlugin() = default;
|
|
|
|
QString pluginName() override { return QLatin1String("ExerciseManagementWatchGuiPlugin"); }
|
|
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::Replay);
|
|
}
|
|
};
|
|
|
|
|
|
class InterfaceImpl final : public QObject, public GuiPluginBase::Interface
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit InterfaceImpl(LtsSession::LtsSession *session);
|
|
|
|
bool fetchInterfaces() override;
|
|
void clearInterfaces() override;
|
|
QVector<LtsWidgets::PluginData> getActions() override;
|
|
bool availableInPartition(IDL::PartitionType partition) const override
|
|
{
|
|
return (partition == IDL::PartitionType::Exercise) || (partition == IDL::PartitionType::Replay);
|
|
}
|
|
|
|
|
|
private:
|
|
static LtsWidgets::ExcState convertState(ExerciseState state);
|
|
static QColor exerciseStateColor(ExerciseManagement::ExerciseState state);
|
|
QString partitionTypeString() const;
|
|
|
|
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_dtc;
|
|
bool m_isDeleted;
|
|
bool m_previouslyRemoved { false };
|
|
|
|
private slots:
|
|
void slotExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType);
|
|
void slotExercisePhaseChanged(const ExerciseManagement::ExercisePhase &data, DataModification modType);
|
|
void slotSetExerciseData();
|
|
};
|
|
|
|
} // namespace ExerciseManagement
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|