-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmapperdbmodel.h
49 lines (37 loc) · 1.19 KB
/
qmapperdbmodel.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
#ifndef QMAPPERDBMODEL_H
#define QMAPPERDBMODEL_H
#include <QStandardItemModel>
#include <QObject>
#include <QDebug>
// represents the entire state of the mapper network's devices, signals, and maps for drawing
// with the QT framework GUI objects
// Interfaces with:
// git loader
// QSql (is this still necessary?)
// Mapper DB
// dummy test
class QMapperDbModel
{
public:
QMapperDbModel();
//create a bunch of test devices/signals/maps
void LoadFromTest(int testDB = 0);
int getNumSigs() {
return mapperSignals.size();
}
const QStandardItem* getSigItem(int index) {return mapperSignals.at(index);}
const QString getSigName(int idx);
const QString getSigDevName(int idx);
const bool isOutputSig(int idx);
const QVector<int>& getMapSrcs() { return mapperMapsSrc;}
const QVector<int>& getMapDsts() { return mapperMapsDst;}
private:
//TODO: more organized data structures
QVector<QString> mapperDevNames;
QVector<QStandardItem*> mapperSignals;
//QVector<QStandardItem*> mapperMaps;
//probably a pair structure would suffice?
QVector<int> mapperMapsSrc;
QVector<int> mapperMapsDst;
};
#endif // QMAPPERDBMODEL_H