-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIndicationController.h
55 lines (41 loc) · 1003 Bytes
/
IndicationController.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
50
51
52
53
54
55
#ifndef INDICATIONCONTROLLER_H
#define INDICATIONCONTROLLER_H
#include <memory>
#include <map>
#include <QColor>
class Diod;
namespace indicationEmulator
{
enum class EventType;
struct States
{
bool mainPower;
bool usbPower;
bool usbDataExchange;
bool activeError;
bool unacknowledgeError;
};
struct Property
{
QColor color;
int enableTime;
int disableTimme;
};
bool operator<(const States& lhs, const States& rhs);
class IndicationController
{
public:
explicit IndicationController(std::shared_ptr<Diod> diod);
void setMainPower(bool value);
void setUsbPower(bool value);
void setUsbDataExchange(bool value);
void setActiveError(bool value);
void setUnacknowledgeError(bool value);
void update();
private:
std::map<EventType, Property> m_properties;
std::shared_ptr<Diod> m_diod;
States m_states;
};
} // indicationEmulator
#endif // INDICATIONCONTROLLER_H