Commit e896331d authored by roangel's avatar roangel
Browse files

added table, added linker. Need to rework a bit the linker, and to fill the...

added table, added linker. Need to rework a bit the linker, and to fill the table with the linker. Also, unlink
parent 06ea75ec
......@@ -105,6 +105,9 @@ private slots:
void on_checkBox_vicon_crazyflies_toggled(bool checked);
void on_scaleSpinBox_valueChanged(double arg1);
void on_refresh_cfs_button_clicked();
void on_refresh_student_ids_button_clicked();
private:
......
......@@ -10,6 +10,7 @@
#include <QString>
#include <QMetaType>
#include <QDir>
#include <regex>
#ifdef CATKIN_MAKE
#include "d_fall_pps/UnlabeledMarker.h"
......@@ -92,6 +93,30 @@ void MainGUIWindow::_init()
ui->graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
ui->graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
// initialize table_links
ui->table_links->setColumnCount(3);
QStringList horizontal_header;
horizontal_header << "Student ID" << "CrazyFly" << "CrazyFly Zone";
ui->table_links->setHorizontalHeaderLabels(horizontal_header);
QFont fnt;
fnt.setPointSize(7);
ui->table_links->horizontalHeader()->setFont(fnt);
ui->table_links->horizontalHeader()->setDefaultSectionSize(90);
ui->table_links->verticalHeader()->setDefaultSectionSize(90);
const int rowCount = ui->table_links->rowCount();
const int columnCount = ui->table_links->columnCount();
for(int i = 0; i < rowCount; ++i)
{
for(int j = 0; j < columnCount; ++j)
{
QTableWidgetItem* selectedItem = ui->table_links->item(i, j);
selectedItem->setFont(fnt);
}
}
// scene
scene = new myGraphicsScene(ui->frame_drawing);
......@@ -442,3 +467,51 @@ void MainGUIWindow::on_scaleSpinBox_valueChanged(double arg1)
}
#endif
}
void MainGUIWindow::on_refresh_cfs_button_clicked()
{
#ifdef CATKIN_MAKE
ui->comboBoxCFs->clear();
for(int i = 0; i < crazyflies_vector.size(); i++)
{
QString qstr = QString::fromStdString(crazyflies_vector[i]->getName());
ui->comboBoxCFs->addItem(qstr);
}
#endif
}
void MainGUIWindow::on_refresh_student_ids_button_clicked()
{
#ifdef CATKIN_MAKE
ui->list_discovered_student_ids->clear();
// \/(\d)\/PPSClient
ros::V_string v_str;
ros::master::getNodes(v_str);
for(int i = 0; i < v_str.size(); i++)
{
std::string s = v_str[i];
std::smatch m;
std::regex e ("\\/(\\d)\\/PPSClient");
// std::regex e("\\/PPSClien(.)");
// while(std::regex_search(s, m, e))
// {
// for (int i = 0; i < m.size(); i++)
// {
// ROS_INFO("FOUND: %s", m[i].str().c_str());
// // std::cout << "FOUND" << m[i] << "\n";
// }
// s = m.suffix().str();
// }
if(std::regex_search(s, m, e))
{
// ROS_INFO("===============================================FOUND: %s", m[1].str().c_str()); // one because we are interested ONLY in the first match
std::string found_string = m[1].str();
ui->list_discovered_student_ids->addItem(found_string.c_str());
}
}
#endif
}
......@@ -46,6 +46,12 @@
</item>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Creation Modes</string>
</property>
......@@ -179,28 +185,16 @@
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QDoubleSpinBox" name="scaleSpinBox">
<property name="font">
<font>
<pointsize>7</pointsize>
</font>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label">
<widget class="QDoubleSpinBox" name="scaleSpinBox">
<property name="font">
<font>
<pointsize>7</pointsize>
</font>
</property>
<property name="text">
<string>Scale:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<item row="1" column="1">
<widget class="QCheckBox" name="checkBox_vicon_highlight_markers">
<property name="font">
<font>
......@@ -265,32 +259,98 @@
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="1">
<widget class="QPushButton" name="pushButton">
<widget class="QSpinBox" name="spinBox_student_ids">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>20</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QListWidget" name="list_discovered_student_ids">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Link!</string>
<string>Choose Student ID:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="7" column="1">
<widget class="QComboBox" name="comboBoxCFs"/>
</item>
<item row="3" column="1">
<item row="9" column="1">
<widget class="QComboBox" name="comboBoxCFZones"/>
</item>
<item row="0" column="1">
<item row="5" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Choose CF to link:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="8" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Choose CF Zone to link:</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QPushButton" name="refresh_cfs_button">
<property name="text">
<string>Refresh CFs</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="refresh_student_ids_button">
<property name="text">
<string>Refresh IDs</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QPushButton" name="link_button">
<property name="text">
<string>Link!</string>
</property>
</widget>
</item>
<item row="10" column="1" colspan="2">
<widget class="QTableWidget" name="table_links">
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="rowCount">
<number>0</number>
</property>
<property name="columnCount">
<number>0</number>
</property>
<attribute name="horizontalHeaderVisible">
<bool>true</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
</widget>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment