Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+66
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* SaaDialogModel
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <SAAs/Common/logger.h>
|
||||
#include <SAAs/Common/saa_utils.h>
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
|
||||
namespace SAAInterfaceAdapterAdler
|
||||
{
|
||||
|
||||
using namespace SAAUtils;
|
||||
|
||||
class SaaDialogModel final : public LtsWidgets::LtsAbstractTableModel<AssetManagement::Asset>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SaaDialogModel(QObject *parent = nullptr);
|
||||
~SaaDialogModel();
|
||||
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final;
|
||||
|
||||
bool initModel(LtsSession::LtsSession *session);
|
||||
enum Columns
|
||||
{
|
||||
Id,
|
||||
Name,
|
||||
Connected,
|
||||
IsUseByParty
|
||||
};
|
||||
|
||||
/// Ping saas handling
|
||||
|
||||
void pingAllSaa();
|
||||
void saaConnected(int assetId, bool state);
|
||||
protected:
|
||||
void stopPing();
|
||||
void updateView();
|
||||
void onPartyDataChanged(const ParticipantManagement::Party &data, DataModification modType);
|
||||
|
||||
void getPartyWithAssetId(int assetId, ParticipantManagement::Party &party)const;
|
||||
private:
|
||||
bool isFiltered(const AssetManagement::Asset &data, DataModification modType) const override;
|
||||
void slotAssetChanged(const AssetManagement::Asset &data, DataModification modType);
|
||||
|
||||
private:
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
|
||||
std::shared_ptr<AssetManagement::Interface::Dtc> m_asmDtc;
|
||||
QHash<int/*assetId*/, PingItem> m_saaPingItems;
|
||||
LtsSession::LtsSession *m_session{nullptr};
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
|
||||
} // namespace InfrastructureManagement
|
||||
Reference in new issue
Block a user