-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.cpp
56 lines (44 loc) · 1.4 KB
/
mainwindow.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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QJsonObject>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
this->savcWidget = new SAVCWidget();
this->savc = new SAVC();
this->cilo = new CILO();
ui->setupUi(this);
this->setWindowTitle("SAVC");
this->resize(600,400);
//configura tela savc
savcWidget->setupUi(this->ui->centralWidget);
//TODO: Fazer Leitura dos dados do simulador
qDebug() << "TODO: Fazer Leitura dos dados do simulador";
//connect
//leitura de pacotes
// connect(receiver->udpSocket, SIGNAL(readyRead()),
// receiver, SLOT(processPendingDatagrams()));
// //atualizacao de dados recebidos
// connect(receiver, SIGNAL(multicastReceivedData(QJsonObject)),
// savcWidget, SLOT(savcUpdateData(QJsonObject)));
// connect(receiver, SIGNAL(multicastReceivedData(QJsonObject)),
// savc, SLOT(atualizaTensao(QJsonObject)));
//escutar goose
this->receiver = new Receiver(this);
this->receiver->setCilo(cilo);
this->receiver->start();
}
MainWindow::~MainWindow()
{
//destroy thread
// this->receiver->quit();
// this->receiver->wait();
this->receiver->terminate();
while(!this->receiver->isFinished());
delete this->savcWidget;
delete this->receiver;
delete this->savc;
delete this->ui;
}