-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstrumentconfig.cpp
More file actions
43 lines (32 loc) · 846 Bytes
/
instrumentconfig.cpp
File metadata and controls
43 lines (32 loc) · 846 Bytes
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
#include <QVariant>
#include "instrumentconfig.h"
InstrumentConfig::InstrumentConfig()
: QObject(nullptr),
Singleton<InstrumentConfig>(*this),
_type(TYPE_LASER) {}
deviceType InstrumentConfig::getType() const {
return _type;
}
int InstrumentConfig::getTypeId() const {
return _itemId;
}
void InstrumentConfig::setType(deviceType type) {
_type = type;
_itemId = type;
}
void InstrumentConfig::setTypeLaser() {
setType(TYPE_LASER);
}
void InstrumentConfig::setTypeShield() {
setType(TYPE_SHIELD);
}
void InstrumentConfig::setTypeDiffractionGrating() {
setType(TYPE_DIFFRACTION_GRATING);
}
void InstrumentConfig::setTypeGeneric() {
setType(TYPE_GENERIC);
QObject* obj = sender();
if (obj && obj->property("id").isValid()) {
_itemId = obj->property("id").toInt();
}
}