Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alterações na Interface #28

Open
wants to merge 12 commits into
base: IronCup2018
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Config/Gandalf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
67 84 155
100 241 255
6
83 116 169
148 213 255
1
Goalkeeper

6 changes: 3 additions & 3 deletions Config/Leona
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
0 79 209
186 174 255
7
141 32 197
255 255 255
2
Goalkeeper

4 changes: 2 additions & 2 deletions Config/Presto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
37 118 0
37 118 225
69 230 255
8
3
Goalkeeper

4 changes: 4 additions & 0 deletions Config/T2
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
109 130 42
142 255 255
=======
102 125 0
>>>>>>> origin/IronCup2018
128 255 255
7 changes: 7 additions & 0 deletions Config/cam_calib.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
brightness 152
contrast 255
saturation 255
gain 50
white_balance_temperature 4313
sharpness 255
exposure_absolute 117
36 changes: 18 additions & 18 deletions Config/map
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
272 11
467 9
489 29
494 135
526 134
531 255
499 256
504 365
483 389
280 394
71 402
48 379
47 267
12 266
15 142
49 142
50 33
74 13
336 26
570 28
589 50
585 180
619 183
611 315
579 317
576 444
559 461
331 456
104 455
83 439
87 311
50 308
50 172
86 171
83 131
82 40
12,362 changes: 6,309 additions & 6,053 deletions Makefile

Large diffs are not rendered by default.

Binary file modified Rinobot_System
Binary file not shown.
12 changes: 6 additions & 6 deletions Rinobot_System.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ SOURCES += main.cpp\
setcolorrange.cpp \
serial.cpp \
settingsdialog.cpp \
soccer_window.cpp \
fuzzy.cpp \
navigation.cpp \
game_functions.cpp \
video4linuxconfig.cpp \
drawobjects.cpp \
mover.cpp
mover.cpp \
informationwindow.cpp
mover.cpp

HEADERS += mainwindow.h \
Expand All @@ -39,23 +39,23 @@ HEADERS += mainwindow.h \
configrobots.h \
setcolorrange.h \
settingsdialog.h \
soccer_window.h \
fuzzy.h \
serial.h \
navigation.h \
game_functions.h \
video4linuxconfig.h \
drawobjects.h \
mover.h
mover.h \
informationwindow.h
mover.h

FORMS += mainwindow.ui \
setparameters.ui \
configrobots.ui \
setcolorrange.ui \
settingsdialog.ui \
soccer_window.ui \
video4linuxconfig.ui
video4linuxconfig.ui \
informationwindow.ui

INCLUDEPATH += "/usr/local/include/opencv2"
LIBS += `pkg-config --cflags --libs opencv`
Expand Down
Binary file removed configrobots.o
Binary file not shown.
Binary file removed drawobjects.o
Binary file not shown.
Binary file removed fuzzy.o
Binary file not shown.
Binary file removed game_functions.o
Binary file not shown.
Binary file added gandalf.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hueBar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
222 changes: 222 additions & 0 deletions informationwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
#include "informationwindow.h"
#include "ui_informationwindow.h"

InformationWindow::InformationWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::InformationWindow)
{
ui->setupUi(this);
//pegando as imagens e passando para os labels, para adicionar as fotinhas
QPixmap gandalf("/home/bruno/Downloads/gandalf.jpg");
QPixmap leona("/home/bruno/Downloads/leona.jpg");
QPixmap presto("/home/bruno/Downloads/presto.jpg");
ui->imgGandalflbl->setPixmap(gandalf);
ui->imgGandalflbl->setScaledContents(true);
ui->imgLeonalbl->setPixmap(leona);
ui->imgLeonalbl->setScaledContents(true);
ui->imgPrestolbl->setPixmap(presto);
ui->imgPrestolbl->setScaledContents(true);

ui->imgGandalflbl_2->setPixmap(gandalf);
ui->imgGandalflbl_2->setScaledContents(true);
ui->imgLeonalbl_2->setPixmap(leona);
ui->imgLeonalbl_2->setScaledContents(true);
ui->imgPrestolbl_2->setPixmap(presto);
ui->imgPrestolbl_2->setScaledContents(true);

updateData();
}

InformationWindow::~InformationWindow()
{
delete ui;
}

void InformationWindow::closeEvent(QCloseEvent *event){
emit close();
}

void InformationWindow::on_valueFilterchangebtn_clicked()
{
if(ui->filterspb->value() <= 0)
{
QMessageBox msgBox;
msgBox.setText("Invalid");
msgBox.exec();
}
else
{
ui->frequencyFilterlbl->setText("Frequency: " + QString::number(ui->filterspb->value()));
}
}

void InformationWindow::on_startFilterbtn_clicked()
{
// vector<int> flagChop = data.eye->get_();
// if(flagChop == 0) //se a flag estiver falsa (off), vira true (on)
// {
// eye->set_LPF_flag(1);
// ui->startFilterbtn->setStyleSheet("background-color: green");
// ui->startFilterbtn->setText("On");
// ui->frequencyFilterlbl->setVisible(true);
// ui->filterspb->setVisible(true);
// ui->valueFilterchangebtn->setVisible(true);
// }else{
// eye->set_LPF_flag(0);
// ui->startFilterbtn->setText("Off");
// ui->startFilterbtn->setStyleSheet("background-color: red");
// ui->frequencyFilterlbl->setVisible(false);
// ui->filterspb->setVisible(false);
// ui->valueFilterchangebtn->setVisible(false);
// }

}

void InformationWindow::on_velocityMaxGandalfbtn_clicked()
{
if(ui->velocityMaxGandalfspb->value() <= 0)
{
QMessageBox msgBox;
msgBox.setText("Invalid");
msgBox.exec();
}
else
{
ui->velocityMaxGandalflbl->setText("Speed Máx: " + QString::number(ui->velocityMaxGandalfspb->value()));
}
}

void InformationWindow::on_velocityMaxLeonabtn_clicked()
{
if(ui->velocityMaxLeonaspb->value() <= 0)
{
QMessageBox msgBox;
msgBox.setText("Invalid");
msgBox.exec();
}
else
{
ui->velocityMaxLeonalbl->setText("Speed Máx: " + QString::number(ui->velocityMaxLeonaspb->value()));
}

}

void InformationWindow::on_velocityMaxPrestobtn_clicked()
{
if(ui->velocityMaxPrestospb->value() <= 0)
{
QMessageBox msgBox;
msgBox.setText("Invalid");
msgBox.exec();
}
else
{
ui->velocityMaxPrestolbl->setText("Speed Máx: " + QString::number(ui->velocityMaxPrestospb->value()));
}

}

void InformationWindow::on_pidbtn_clicked()
{
if(ui->pidspb->value() <= 0)
{
QMessageBox msgBox;
msgBox.setText("Invalid");
msgBox.exec();
}
else
{
ui->pidlbl->setText("PID: " + QString::number(ui->pidspb->value()));
}

}

void InformationWindow::on_strategybtn_clicked()
{
/* string strategy = ui->strategy_options->currentText().toUtf8().constData();

cout << strategy << endl;

char num_strategy;

if(strategy == "Test")
num_strategy = 0;
else if (strategy == "Strategy 1")
num_strategy = 1;
else if (strategy == "Strategy 2")
num_strategy = 2;

fuzzy->set_strategy(num_strategy);
*/
switch(ui->strategycbx->currentIndex())
{
case 0:
ui->currentStrategylbl->setText("Current: 2");
break;
case 1:
ui->currentStrategylbl->setText("Current: 1");
break;
case 2:
ui->currentStrategylbl->setText("Current: Text");
break;
}

}

void InformationWindow::updateData(InfoParameters data){
this->data = data;
updateData();
}

void InformationWindow::updateData(){
//informações das variaveis, receberam os gets para depois manipular as variaveis e exibir as informações
QString channel, velocity, velocityMax, posicao;

//manipulating gandalf
channel = "Canal: " + QString::number(data.robots[GANDALF].channel);
ui->channelGandalflbl->setText(channel);
velocity = "Speed: (" + QString::number(data.robots[GANDALF].vel_strategy.first) + " , " + QString::number(data.robots[GANDALF].vel_strategy.second) + ")";
ui->velocityGandalflbl->setText(velocity);
velocityMax = "Speed Máx: " + QString::number(data.robots[GANDALF].vel_max);
ui->velocityMaxGandalflbl->setText(velocityMax);

//manipulating leona
channel = "Canal: " + QString::number(data.robots[LEONA].channel);
ui->channelLeonalbl->setText(channel);
velocity = "Speed: (" + QString::number(data.robots[LEONA].vel_strategy.first) + " , " + QString::number(data.robots[LEONA].vel_strategy.second) + ")";
ui->velocityLeonalbl->setText(velocity);
velocityMax = "Speed Máx: " + QString::number(data.robots[LEONA].vel_max);
ui->velocityMaxLeonalbl->setText(velocityMax);

//manipulating presto
channel = "Canal: " + QString::number(data.robots[PRESTO].channel);
ui->channelPrestolbl->setText(channel);
velocity = "Speed: (" + QString::number(data.robots[PRESTO].vel_strategy.first) + " , " + QString::number(data.robots[PRESTO].vel_strategy.second) + ")";
ui->velocityPrestolbl->setText(velocity);
velocityMax = "Speed Máx: " + QString::number(data.robots[PRESTO].vel_max);
ui->velocityMaxPrestolbl->setText(velocityMax);

//manipulating gandalf
posicao = "Posição: (" + QString::number(data.robots[GANDALF].x) + " , " + QString::number(data.robots[GANDALF].y) + ")";
ui->positionGandalflbl->setText(posicao);
velocity = "Speed: (" + QString::number(data.robots[GANDALF].vel_vision.first) + " , " + QString::number(data.robots[GANDALF].vel_vision.second) + ")";
ui->velocityGandalflbl_2->setText(velocity);

//manipulating leona
posicao = "Posição: (" + QString::number(data.robots[LEONA].x) + " , " + QString::number(data.robots[LEONA].y) + ")";
ui->positionLeonalbl->setText(posicao);
velocity = "Speed: (" + QString::number(data.robots[LEONA].vel_vision.first) + " , " + QString::number(data.robots[LEONA].vel_vision.second) + ")";
ui->velocityLeonalbl_2->setText(velocity);

//manipulating presto
posicao = "Posição: (" + QString::number(data.robots[PRESTO].x) + " , " + QString::number(data.robots[PRESTO].y) + ")";
ui->positionPrestolbl->setText(posicao);
velocity = "Speed: (" + QString::number(data.robots[PRESTO].vel_vision.first) + " , " + QString::number(data.robots[PRESTO].vel_vision.second) + ")";
ui->velocityPrestolbl_2->setText(velocity);

//manipulating ball
posicao = "Posição: (" + QString::number(data.ball.x) + " , " + QString::number(data.ball.y) + ")";
ui->positionBalllbl->setText(posicao);
velocity = "Speed: (" + QString::number(data.ball.vel_vision.first) + " , " + QString::number(data.ball.vel_vision.second) + ")";
ui->velocityBalllbl->setText(velocity);
}
Loading