-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactuator.cpp
More file actions
executable file
·83 lines (69 loc) · 1.75 KB
/
actuator.cpp
File metadata and controls
executable file
·83 lines (69 loc) · 1.75 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "actuator.h"
#include <QDebug>
Actuator::Actuator() {
}
Actuator::~Actuator() {
}
void Actuator:: setActuatorState(State actuatorState) {
this->actuatorState = actuatorState;
QString str_state = printActuatorState();
QString str_type = printActuatorType();
qDebug() << "ACTUATOR: State of " << str_type << "is set: " << str_state;
}
void Actuator:: setActuatorDuration(unsigned int actuatorDuration) {
this->actuatorDuration = actuatorDuration;
qDebug() << "ACTUATOR: Duration is set: " << this->actuatorDuration;
}
void Actuator:: setActuatorType(ActuatorType actuatorType) {
this->actuatorType = actuatorType;
qDebug() << "ACTUATOR: Type is set: " << this->actuatorType;
}
ActuatorType Actuator::getActuatorType() const {
return this->actuatorType;
}
unsigned int Actuator::getActuatorDuration() const {
return this->actuatorDuration;
}
State Actuator::getActuatorState() const {
return this->actuatorState;
}
QString Actuator::printActuatorState() {
QString str;
switch (actuatorState) {
case (OK):
str = "OK";
return str;
case (UNDEFINED):
str = "UNDEFINED";
return str;
case (ALARM):
str = "ALARM";
return str;
default:
break;
}
return "UNDEFINED";
}
QString Actuator::printActuatorType() {
QString str;
switch (actuatorType) {
case (DC_MOTOR):
str = "DC_MOTOR";
return str;
case (LCD):
str = "LCD";
return str;
case (MILKMAKER):
str = "MILKMAKER";
return str;
case (WATERHEATER):
str = "WATERHEATER";
return str;
case (BREWGROUP):
str = "BREWGROUP";
return str;
default:
break;
}
return "UNDEFINED";
}