-
Notifications
You must be signed in to change notification settings - Fork 2
/
welcom.cpp
89 lines (72 loc) · 2.39 KB
/
welcom.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
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
84
85
86
87
88
89
#include "welcom.h"
#include "ui_welcom.h"
#include <QMessageBox>
Welcom::Welcom(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Welcom)
{
ui->setupUi(this);
mPainter = new iPainter();
mPrinterSettings = new ParentSetting();
IPDialog = new IPinput();
doors = new Door();
myport = new CPSerialPort();
//IP---->DOOR
connect(IPDialog,SIGNAL(Sig_ip(QString)),doors,SLOT( connectServer(QString)));
//This---->DOOR
connect(this,SIGNAL(Sig_ip(QString)),doors,SLOT( connectServer(QString)));
//DOOR------>This
connect(doors,SIGNAL(Sig_connected(QString)),this,SLOT(connectStatus(QString)));
connect(doors,SIGNAL(Sig_msg(QString)),this,SLOT(showMsg(QString)));
//ParentSetting---->DOOR
connect(mPrinterSettings,SIGNAL(Sig_cmds(QString)),doors,SLOT(sendCommand(QString)));
connect(mPrinterSettings,SIGNAL(Sig_printgcode(QString)),doors,SLOT(sendFile(QString)));
//iPainter---->DOOR
connect(mPainter,SIGNAL(Sig_file(QString)),doors,SLOT(sendFile(QString)));
connect(mPainter,SIGNAL(Sig_stop()),mPrinterSettings,SLOT(slotStop()));
connect(mPainter,SIGNAL(Sig_cancle()),mPrinterSettings,SLOT(slotCancle()));
//DOOR-------->iPainter
connect(doors,SIGNAL(Sig_PrintNext()),mPainter,SLOT(PrintNext()));
//IPainter---->CPSerialPort
connect(mPainter,SIGNAL(Sig_toarduino(QString)),myport,SLOT(WritePort(QString)));
//CPSerialPort---->IPainter
connect(myport,SIGNAL(Sig_GetMessage(QString)),mPainter,SLOT(ReadArduino(QString)));
//PSetting--->CPSerial
connect(mPrinterSettings,SIGNAL(Sig_cmds(QString)),myport,SLOT(WritePort(QString)));
this->setWindowTitle(tr("Make-Block"));
// this->setWindowFlags(Qt::FramelessWindowHint);
}
Welcom::~Welcom()
{
delete ui;
}
void Welcom::connectStatus(QString t) //服务器发送过来的连接状态
{
if(t=="Suc")
{
QMessageBox::information(this,tr("Notice"),tr("XY laser connected!"));
}
}
//接收来自orangepi的数据
void Welcom::showMsg(QString t)
{
qDebug()<<"get orange pi data:"<<t;
}
void Welcom::on_ipaint_clicked()
{
mPainter->showFullScreen();
}
void Welcom::on_parentSetting_clicked() //家长设置
{
mPrinterSettings->showFullScreen();
}
void Welcom::on_connectIP_clicked()
{
// IPDialog->show();
myport->show();
// emit Sig_ip("192.168.10.1");
}
void Welcom::on_closeBtn_clicked()
{
this->close();
}