-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwidget.cpp
69 lines (58 loc) · 1.63 KB
/
widget.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
#include "widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
estado = false;
ui->setupUi(this);
setWindowTitle("Programación Orientada a Objetos");
// Reporte de estado de la máquina
timer = new QTimer(this);
QObject::connect(timer, SIGNAL(timeout()), this, SLOT(report()));
timer->start(1000);
}
Widget::~Widget(){
delete ui;
}
void Widget::on_ACTIVAR_clicked(){
ui->estado->setText("ENCENDIDO");
this->estado=true;
this->br->turnON();
}
void Widget::on_DESACTIVAR_clicked(){
ui->estado->setText("APAGADO");
this->estado=false;
this->br->turnOFF();
}
void Widget::on_selectMode_clicked(){
ModoOperacion *mode = new ModoOperacion();
mode->setData(this->br);
mode->show();
std::cout << "Select mode" << std::endl;
}
void Widget::on_Archivos_clicked(){
FileManager *file_manager = new FileManager();
file_manager->setData(this->br);
file_manager->show();
std::cout << "Select file" << std::endl;
}
void Widget::on_EXIT_clicked(){
this->hide();
}
void Widget::on_Data_clicked(){
DataList *data = new DataList();
data->setData(this->br);
data->show();
std::cout << "List data" << std::endl;
}
void Widget::report(){
ui->report->setPlainText(this->br->toQString());
}
void Widget::on_askEstado_clicked(){
QString data;
QString estado;
data += ("Estado del robot: " + this->br->getEstado() + "\n");
data += ("Tarea configurada en efector final: " + this->br->get_efTarea() + "\n");
data += ("Duración: " + this->br->get_efDuracion() + "\n");
this->ui->estadoInfo->setPlainText(data);
}