-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqtdeviceinteractor.cpp
More file actions
54 lines (42 loc) · 1.77 KB
/
Copy pathqtdeviceinteractor.cpp
File metadata and controls
54 lines (42 loc) · 1.77 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
#include "qtdeviceinteractor.h"
#include "mainwindow.h"
#include "deviceinteractor.h"
#include "deviceconfiguration.h"
QTDeviceInteractor::QTDeviceInteractor(DeviceInteractor& Interactor, MainWindow& Window, boost::asio::io_service& IOService) :
m_DeviceInteractor(Interactor),
m_IOService(IOService)
{
QObject::connect(&Window, SIGNAL(AddDialogSuccessfull(const char*, const char*, unsigned int)),
this, SLOT(CreateNewTcpDevice(const char*, const char*, unsigned int)));
QObject::connect(&Window, SIGNAL(AddDialogSuccessfull(const DeviceConfiguration&)),
this, SLOT(CreateNewDevice(const DeviceConfiguration&)));
QObject::connect(&Window, SIGNAL(RemoveDevice(const char*)),
this, SLOT(RemoveDevice(const char*)));
QObject::connect(&Window, SIGNAL(StartDevice(const char*)),
this, SLOT(StartDevice(const char*)));
QObject::connect(&Window, SIGNAL(StopDevice(const char*)),
this, SLOT(StopDevice(const char*)));
}
// slots
void QTDeviceInteractor::CreateNewTcpDevice(const char* Name,
const char* Host,
unsigned int Port)
{
m_DeviceInteractor.CreateNewTcpDevice(std::string(Name), std::string(Host), Port, m_IOService);
}
void QTDeviceInteractor::StartDevice(const char* Name)
{
m_DeviceInteractor.StartDevice(std::string(Name));
}
void QTDeviceInteractor::StopDevice(const char* Name)
{
m_DeviceInteractor.StopDevice(std::string(Name));
}
void QTDeviceInteractor::RemoveDevice(const char* Name)
{
m_DeviceInteractor.RemoveDevice(std::string(Name));
}
void QTDeviceInteractor::CreateNewDevice(const DeviceConfiguration& Configuration)
{
m_DeviceInteractor.CreateNewDevice(Configuration, m_IOService);
}