-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcipclient.cpp
More file actions
40 lines (35 loc) · 1.42 KB
/
cipclient.cpp
File metadata and controls
40 lines (35 loc) · 1.42 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
#include "cipclient.h"
#include "cipchannelmaster.h"
#include "cipchannelevent.h"
#include "cloudwaredialog.h"
#include "cip_protocol.h"
#include "cipchannelevent.h"
CipClient::CipClient(QString ip, quint16 port)
{
this->ip = ip;
this->port = port;
this->channel_master = new CipChannelMaster(this->ip, this->port);
this->channel_event = new CipChannelEvent(this->ip, this->port);
this->channel_display = new CipChannelDisplay(this->ip, this->port);
this->session = "hello";
}
int CipClient::run()
{
this->channel_master->cipclient = this;
this->channel_master->run();
sleep(1);
QObject::connect(this->channel_event, SIGNAL(windowCreate(cip_event_window_create_t*)),
this->mainwindow, SLOT(windowCreate(cip_event_window_create_t*)));
QObject::connect(this->channel_event, SIGNAL(windowDestroy(cip_event_window_destroy_t*)),
this->mainwindow, SLOT(windowDestroy(cip_event_window_destroy_t*)));
QObject::connect(this->channel_event, SIGNAL(windowShow(cip_event_window_show_t*)),
this->mainwindow, SLOT(windowShow(cip_event_window_show_t*)));
QObject::connect(this->channel_event, SIGNAL(windowHide(cip_event_window_hide_t*)),
this->mainwindow, SLOT(windowHide(cip_event_window_hide_t*)));
return 0;
}
void CipClient::initOtherChannels()
{
this->channel_event->run();
this->channel_display->run();
}