forked from dresden-elektronik/deconz-ota-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
otau_model.h
50 lines (41 loc) · 1.14 KB
/
otau_model.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef OTAU_MODEL_H
#define OTAU_MODEL_H
#include <vector>
#include <QAbstractTableModel>
#include "deconz/types.h"
#include "deconz/aps.h"
struct OtauNode;
/*! \class OtauModel
Model which holds and represents all otau activity of nodes.
*/
class OtauModel : public QAbstractTableModel
{
Q_OBJECT
public:
enum Section
{
SectionAddress = 0,
SectionManufacturer,
SectionImageType,
SectionSoftwareVersion,
SectionProgress,
SectionDuration,
// SectionStatus,
SectionCount
};
explicit OtauModel(QObject *parent = nullptr);
~OtauModel();
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QVariant data(const QModelIndex &index, int role) const;
OtauNode *getNode(const deCONZ::Address &addr, bool create = false);
OtauNode *getNodeAtRow(uint row);
void nodeDataUpdate(OtauNode *node);
std::vector<OtauNode *> &nodes();
signals:
public slots:
private:
std::vector<OtauNode*> m_nodes;
};
#endif // OTAU_MODEL_H