-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventGenerator.cpp
35 lines (28 loc) · 1.13 KB
/
EventGenerator.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
#include "EventGenerator.h"
#include "Handler.h"
#include "Event.h"
EventGenerator::EventGenerator(std::shared_ptr<indicationEmulator::Handler> handler, QObject *parent)
: QObject(parent),
m_handler(std::move(handler))
{
}
void EventGenerator::eventMainPower(bool value)
{
m_handler->handle(std::make_shared<indicationEmulator::Event>(indicationEmulator::EventType::MainPower, value));
}
void EventGenerator::eventUsbPower(bool value)
{
m_handler->handle(std::make_shared<indicationEmulator::Event>(indicationEmulator::EventType::UsbPower, value));
}
void EventGenerator::eventUsbDataExchange(bool value)
{
m_handler->handle(std::make_shared<indicationEmulator::Event>(indicationEmulator::EventType::UsbDataExchange, value));
}
void EventGenerator::eventActiveError(bool value)
{
m_handler->handle(std::make_shared<indicationEmulator::Event>(indicationEmulator::EventType::ActiveError, value));
}
void EventGenerator::eventUnacknowledgeError(bool value)
{
m_handler->handle(std::make_shared<indicationEmulator::Event>(indicationEmulator::EventType::UnacknowledgeError, value));
}