2018-01-27 22:14:00 +08:00
|
|
|
|
#include "mainwindow.h"
|
2017-10-17 21:45:34 +08:00
|
|
|
|
#include "ui_mainwindow.h"
|
2017-11-10 12:07:58 +08:00
|
|
|
|
|
2018-04-23 10:00:09 +08:00
|
|
|
|
|
2017-11-23 19:12:48 +08:00
|
|
|
|
MainWindow::MainWindow ( QWidget* parent ) :
|
|
|
|
|
QMainWindow ( parent ),
|
|
|
|
|
ui ( new Ui::MainWindow )
|
2017-10-17 21:45:34 +08:00
|
|
|
|
{
|
2017-11-23 19:12:48 +08:00
|
|
|
|
ui->setupUi ( this );
|
2018-01-27 22:14:00 +08:00
|
|
|
|
|
2017-10-18 08:05:58 +08:00
|
|
|
|
// serialport example
|
|
|
|
|
// tcpsocket example
|
|
|
|
|
// websocket?
|
|
|
|
|
//
|
2018-04-23 10:00:09 +08:00
|
|
|
|
p = QQtClientConnectionInstance ( this );
|
|
|
|
|
connect ( p, SIGNAL ( signalServerSay ( QString ) ),
|
|
|
|
|
this, SLOT ( on_recv_say_hello ( QString ) ) );
|
2017-10-17 21:45:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MainWindow::~MainWindow()
|
|
|
|
|
{
|
|
|
|
|
delete ui;
|
|
|
|
|
}
|
2018-04-23 10:00:09 +08:00
|
|
|
|
|
|
|
|
|
void MainWindow::on_pushButton_clicked()
|
|
|
|
|
{
|
|
|
|
|
p->sendA1Command ( ui->lineEdit->text() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MainWindow::on_recv_say_hello ( QString a )
|
|
|
|
|
{
|
2018-04-23 13:39:10 +08:00
|
|
|
|
pline() << a;
|
|
|
|
|
//ui->plainTextEdit->appendPlainText ( a );
|
2018-04-23 10:00:09 +08:00
|
|
|
|
}
|