Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+72
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for ParticipantManagement - Template Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-10.05
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <Plugins/AdvancedSymbology/Helper/table_model_symbol_renderer.h>
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
class LtsSessionDataDds;
|
||||
}
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
// --------------------------------------------------------
|
||||
// ParticipantTemplateChooserModel
|
||||
// --------------------------------------------------------
|
||||
class ParticipantTemplateChooserModel final : public LtsWidgets::LtsAbstractTableModel<ParticipantManagement::TemplateParticipant>
|
||||
, public AdvancedSymbology::TableModelSymbolRenderer<ParticipantTemplateChooserModel>
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class AdvancedSymbology::TableModelSymbolRenderer<ParticipantTemplateChooserModel>;
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
ColDesignatorIdentifier,
|
||||
ColTypeClass,
|
||||
ColType
|
||||
};
|
||||
|
||||
explicit ParticipantTemplateChooserModel(bool asSupportService, QObject *parent = nullptr);
|
||||
~ParticipantTemplateChooserModel();
|
||||
|
||||
bool initModel(LtsSession::LtsSessionDataDds *session,
|
||||
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc);
|
||||
|
||||
QVariant data(const QModelIndex &, int) const override final;
|
||||
|
||||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
QMimeData *mimeData(const QModelIndexList &indexes) const override;
|
||||
QStringList mimeTypes() const override;
|
||||
Qt::DropActions supportedDragActions() const override { return Qt::CopyAction; }
|
||||
|
||||
protected:
|
||||
int getId(const TemplateParticipant &data) const override
|
||||
{
|
||||
return data.templateId();
|
||||
}
|
||||
|
||||
private slots:
|
||||
void onTemplateChanged(const ParticipantManagement::TemplateParticipant &data,
|
||||
DataModification modType);
|
||||
|
||||
private:
|
||||
bool isFiltered(const TemplateParticipant &data, DataModification modType) const override;
|
||||
|
||||
bool m_asSupportService;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} //namespace ParticipantManagement
|
||||
Reference in new issue
Block a user