Torc
0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
inputs
torcinput.h
Go to the documentation of this file.
1
#ifndef TORCINPUT_H
2
#define TORCINPUT_H
3
4
// Qt
5
#include <QMutex>
6
#include <QObject>
7
8
// Torc
9
#include "
http/torchttpservice.h
"
10
#include "
torcdevice.h
"
11
12
#define INPUTS_DIRECTORY QStringLiteral("inputs")
13
14
class
TorcInput
:
public
TorcDevice
,
public
TorcHTTPService
15
{
16
Q_OBJECT
17
Q_CLASSINFO(
"Version"
,
"1.0.0"
)
18
Q_PROPERTY(
double
operatingRangeMin
READ
GetOperatingRangeMin
CONSTANT)
19
Q_PROPERTY(
double
operatingRangeMax
READ
GetOperatingRangeMax
CONSTANT)
20
Q_PROPERTY(
bool
outOfRangeLow
READ
GetOutOfRangeLow
NOTIFY
OutOfRangeLowChanged
)
21
Q_PROPERTY(
bool
outOfRangeHigh
READ
GetOutOfRangeHigh
NOTIFY
OutOfRangeHighChanged
)
22
23
public:
24
enum
Type
25
{
26
Unknown
= 0,
27
Temperature
,
28
pH
,
29
Switch
,
30
PWM
,
31
Button
,
32
Started
,
33
Integer
,
34
MaxType
35
};
36
37
Q_ENUM(
Type
)
38
39
public:
40
TorcInput
(
TorcInput
::
Type
Type
,
double
Value,
double
RangeMinimum,
double
RangeMaximum,
41
const QString &ModelId, const QVariantMap &Details);
42
43
44
virtual
TorcInput
::Type
GetType
(
void
) = 0;
45
virtual
void
Start
(
void
) override;
46
QString
GetUIName
(
void
) override;
47
48
protected:
49
virtual ~
TorcInput
() = default;
50
51
signals:
52
void
OutOfRangeLowChanged
(
bool
Value);
53
void
OutOfRangeHighChanged
(
bool
Value);
54
55
public slots:
56
// TorcHTTPService
57
void
SubscriberDeleted
(QObject *Subscriber);
58
59
void
SetValue
(
double
Value) override;
60
void
SetValid
(
bool
Valid) final;
61
62
double
GetOperatingRangeMin
(
void
);
63
double
GetOperatingRangeMax
(
void
);
64
bool
GetOutOfRangeLow
(
void
);
65
bool
GetOutOfRangeHigh
(
void
);
66
67
protected:
68
double
operatingRangeMin
;
69
double
operatingRangeMax
;
70
bool
outOfRangeLow
;
71
bool
outOfRangeHigh
;
72
};
73
74
#endif // TORCINPUT_H
TorcInput::GetOutOfRangeHigh
bool GetOutOfRangeHigh(void)
Definition:
torcinput.cpp:172
TorcInput::outOfRangeLow
bool outOfRangeLow
Definition:
torcinput.h:20
TorcInput::GetOutOfRangeLow
bool GetOutOfRangeLow(void)
Definition:
torcinput.cpp:165
torcdevice.h
TorcInput
Definition:
torcinput.h:14
TorcDevice
Definition:
torcdevice.h:19
TorcInput::GetOperatingRangeMin
double GetOperatingRangeMin(void)
Definition:
torcinput.cpp:153
TorcInput::GetOperatingRangeMax
double GetOperatingRangeMax(void)
Definition:
torcinput.cpp:159
TorcInput::SubscriberDeleted
void SubscriberDeleted(QObject *Subscriber)
Definition:
torcinput.cpp:81
TorcInput::OutOfRangeLowChanged
void OutOfRangeLowChanged(bool Value)
TorcInput::Started
Definition:
torcinput.h:32
TorcInput::SetValid
void SetValid(bool Valid) final
Definition:
torcinput.cpp:143
TorcInput::Unknown
Definition:
torcinput.h:26
TorcHTTPService
Definition:
torchttpservice.h:20
TorcInput::operatingRangeMin
double operatingRangeMin
Definition:
torcinput.h:18
TorcInput::OutOfRangeHighChanged
void OutOfRangeHighChanged(bool Value)
TorcInput::Button
Definition:
torcinput.h:31
TorcInput::Temperature
Definition:
torcinput.h:27
TorcInput::SetValue
void SetValue(double Value) override
Update the inputs value.
Definition:
torcinput.cpp:90
TorcInput::pH
Definition:
torcinput.h:28
TorcInput::Type
Type
Definition:
torcinput.h:24
TorcInput::outOfRangeHigh
bool outOfRangeHigh
Definition:
torcinput.h:21
TorcInput::MaxType
Definition:
torcinput.h:34
TorcInput::PWM
Definition:
torcinput.h:30
TorcInput::GetUIName
QString GetUIName(void) override
Definition:
torcinput.cpp:73
TorcInput::Switch
Definition:
torcinput.h:29
TorcInput::GetType
virtual TorcInput::Type GetType(void)=0
torchttpservice.h
TorcInput::operatingRangeMax
double operatingRangeMax
Definition:
torcinput.h:19
TorcInput::Integer
Definition:
torcinput.h:33
TorcInput::Start
virtual void Start(void) override
Definition:
torcinput.cpp:65
Generated on Sat Jan 5 2019 21:54:03 for Torc by
1.8.11