Main Page
Namespaces
Classes
Files
File List
File Members
igvc
src
dashboard
mainwindow.cpp
Go to the documentation of this file.
1
#include "
mainwindow.h
"
2
#include "ui_mainwindow.h"
3
4
MainWindow::MainWindow
(
int
argc,
char
**argv) :
5
QMainWindow(0),
6
ui(new Ui::
MainWindow
),
7
node(argc, argv)
8
{
9
ui
->setupUi(
this
);
10
11
connect(&
node
, SIGNAL(newVelocityData(
float
)),
this
, SLOT(
onNewVelocity
(
float
)));
12
connect(&
node
, SIGNAL(newNodesList(QStringList)),
this
, SLOT(
onNewNodesList
(QStringList)));
13
14
if
(
node
.
init
())
15
std::cout <<
"ROS node initialized."
<< std::endl;
16
else
17
std::cerr <<
"ROS node failed to initialize."
<< std::endl;
18
}
19
20
MainWindow::~MainWindow
()
21
{
22
delete
ui
;
23
}
24
25
void
MainWindow::onNewVelocity
(
float
velocity)
26
{
27
ui
->widget->setValue(velocity);
28
}
29
30
void
MainWindow::onNewNodesList
(QStringList nodes)
31
{
32
ui
->listWidget->clear();
33
for
(
auto
node
: nodes)
34
ui
->listWidget->addItem(
node
);
35
}
QNode::init
bool init()
Definition:
qnode.cpp:23
MainWindow::MainWindow
MainWindow(int argc, char **argv)
Definition:
mainwindow.cpp:4
MainWindow::ui
Ui::MainWindow * ui
Definition:
mainwindow.h:24
MainWindow::node
QNode node
Definition:
mainwindow.h:26
mainwindow.h
MainWindow::onNewNodesList
void onNewNodesList(QStringList nodes)
Definition:
mainwindow.cpp:30
MainWindow::onNewVelocity
void onNewVelocity(float velocity)
Definition:
mainwindow.cpp:25
MainWindow::~MainWindow
~MainWindow()
Definition:
mainwindow.cpp:20
MainWindow
Definition:
mainwindow.h:11
igvc
Author(s): Matthew Barulic
, Al Chaussee
autogenerated on Sun May 10 2015 16:18:45