forked from jm-szlendak/scada_hmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sensorinterface.cpp
69 lines (54 loc) · 1013 Bytes
/
sensorinterface.cpp
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "sensorinterface.h"
SensorInterface::SensorInterface(QObject *parent) : QObject(parent)
{
}
SensorInterface::~SensorInterface()
{
}
QString SensorInterface::getDeviceName()
{
return name;
}
QString SensorInterface::getDeviceBrief()
{
return factoryData;
}
int SensorInterface::getDeviceState()
{
return (int)deviceState;
}
int SensorInterface::getUUID()
{
return uuid;
}
QString SensorInterface::getMeasurandName()
{
return measurandName;
}
QString SensorInterface::getMeasurandUnit()
{
return measurandUnit;
}
double SensorInterface::getRangeMax()
{
return rangeMax;
}
double SensorInterface::getRangeMin()
{
return rangeMin;
}
double SensorInterface::getCurrentValue()
{
return currentValue;
}
bool SensorInterface::dataReceived(Packet* data)
{
Sensor::dataReceived(data);
emit dataUpdate();
}
void SensorInterface::setDeviceState(bool state)
{
if(state)
this->deviceState = STATE_ON;
else this->deviceState = STATE_OFF;
}