Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* NotificationManagement - NomNotification Overview Dialog Model
|
||||
*
|
||||
* Created by Mike Lennart Wille, ESZS, 2026-06-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AssetManagement/asm_dtc.h>
|
||||
#include <LtsSession/lts_session.h>
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||
#include <NotificationManagement/logger.h>
|
||||
#include <NotificationManagement/nom_dtc.h>
|
||||
#include <NotificationManagement/nom_ftc.h>
|
||||
#include <OperatorManagement/opm_dtc.h>
|
||||
|
||||
namespace NotificationManagement
|
||||
{
|
||||
|
||||
class NotificationManagementDialogModel final : public LtsWidgets::LtsAbstractTableModel<NotificationManagement::NomNotification>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
Id,
|
||||
Title,
|
||||
Timestamp,
|
||||
ProcessedBy,
|
||||
ProcessTime,
|
||||
Priority,
|
||||
Sender, // Address
|
||||
isRead, // myRecipients
|
||||
Content,
|
||||
|
||||
};
|
||||
|
||||
explicit NotificationManagementDialogModel(QObject *parent);
|
||||
bool initModel(const LtsSession::LtsSessionDataDds *session);
|
||||
|
||||
protected:
|
||||
int getId(const NotificationManagement::NomNotification &data) const override final;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final;
|
||||
|
||||
bool isFiltered(const NotificationManagement::NomNotification &data, DataModification modType) const override;
|
||||
int isDeleted(const NotificationManagement::NomNotification &data) const override;
|
||||
QString getNameByAddressId(int addressId, const std::vector<NotificationManagement::Address> &recipients) const;
|
||||
|
||||
private:
|
||||
int m_exerciseId;
|
||||
int m_workstationId;
|
||||
int m_operatorId;
|
||||
std::shared_ptr<NotificationManagement::Interface::Dtc> m_dtc;
|
||||
std::shared_ptr<NotificationManagement::Interface::Ftc> m_ftc;
|
||||
std::shared_ptr<OperatorManagement::Interface::Dtc> m_dtcOpm;
|
||||
std::shared_ptr<AssetManagement::Interface::Dtc> m_dtcAsm;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
|
||||
friend class NotificationDialogProxyModel;
|
||||
};
|
||||
|
||||
class NotificationDialogProxyModel final : public LtsWidgets::LtsColumnFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
using LtsWidgets::LtsColumnFilterProxyModel::LtsColumnFilterProxyModel;
|
||||
void setSourceModel(QAbstractItemModel *sourceModel) override;
|
||||
|
||||
protected:
|
||||
bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
|
||||
|
||||
private:
|
||||
NotificationManagementDialogModel *m_sourceModel = nullptr;
|
||||
};
|
||||
|
||||
} // namespace NotificationManagement
|
||||
Reference in new issue
Block a user