Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for ParticipantManagement - Party Overview Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-11-11
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
// --------------------------------------------------------
|
||||
// PartyModel
|
||||
// --------------------------------------------------------
|
||||
class PartyModel final : public LtsWidgets::LtsAbstractTableModel<ParticipantManagement::Party>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
Id,
|
||||
Name,
|
||||
Color,
|
||||
FadedColor,
|
||||
Role,
|
||||
IsUsedBy,
|
||||
IsSaaConnected,
|
||||
SaaName,
|
||||
SzenarName
|
||||
};
|
||||
|
||||
explicit PartyModel(QObject *parent = nullptr);
|
||||
|
||||
bool initModel(LtsSession::LtsSession *session);
|
||||
|
||||
QVariant data(const QModelIndex &, int) const override;
|
||||
|
||||
protected:
|
||||
bool isFiltered(const Party &data, DataModification modType) const override
|
||||
{
|
||||
//no pool and support
|
||||
if (data.id() <= 1)
|
||||
return true;
|
||||
return LtsWidgets::LtsAbstractTableModel<ParticipantManagement::Party>::isFiltered(data, modType);
|
||||
}
|
||||
private:
|
||||
bool hasParty(const ParticipantManagement::Party &party) const;
|
||||
bool isPartyHidden(const ParticipantManagement::Party &party) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc;
|
||||
int m_operatorId;
|
||||
int m_exerciseId;
|
||||
LtsSession::LtsSession *m_session;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} //namespace ParticipantManagement
|
||||
Reference in new issue
Block a user