-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathtempmodel.h
36 lines (27 loc) · 825 Bytes
/
tempmodel.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
#ifndef TEMPMODEL_H
#define TEMPMODEL_H
#include <QAbstractTableModel>
class NodeNames;
class TempModel : public QAbstractTableModel
{
Q_OBJECT
public:
TempModel(QObject *parent);
int rowCount(const QModelIndex &parent = QModelIndex()) const ;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
void setNodeNameHelper(NodeNames *n);
public slots:
void newData(quint32 id0, quint32 id1, quint32 zone, float temp);
private:
struct record_t {
quint32 id1;
quint32 id2;
quint32 zone;
float temp;
};
NodeNames *nn;
QMap<QString, record_t> temperatureMap;
};
#endif // TEMPMODEL_H