Commit 50417e15 authored by roangel's avatar roangel
Browse files

Kind of solved the problem, need to test it more. Commented out the...

Kind of solved the problem, need to test it more. Commented out the on_tabWidget_current_changed. Need to check if we need it for something
parent 7a8d0f72
......@@ -85,7 +85,8 @@ void MainGUIWindow::doNumCrazyFlyZonesChanged(int n)
// int found_index = getTabIndexFromName(qstr);
// if(found_index != -1)
// {
// ui->tabWidget->removeTab(found_index);
// ui->tabWidget->widget(found_index)->deleteLater();
// // ui->tabWidget->removeTab(found_index);
// }
// // now unlink it from table also:
......@@ -106,14 +107,16 @@ void MainGUIWindow::doNumCrazyFlyZonesChanged(int n)
// connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int)));
// }
for(int index = 0; index < ui->tabWidget->count(); index++)
{
// ui->tabWidget->removeTab(index);
ui->tabWidget->widget(index)->deleteLater();
}
// for(int index = 0; index < ui->tabWidget->count(); index++)
// {
// // ui->tabWidget->removeTab(index);
// ui->tabWidget->widget(index)->deleteLater();
// }
// // unlink all?
// // cf_linker->clear_all_links();
// unlink all?
// cf_linker->clear_all_links();
ui->tabWidget->clear();
for(int i = 0; i < scene->crazyfly_zones.size(); i++)
{
......@@ -121,13 +124,23 @@ void MainGUIWindow::doNumCrazyFlyZonesChanged(int n)
QString qstr = "CrazyFly ";
int CF_index = scene->crazyfly_zones[i]->getIndex();
qstr.append(QString::number(CF_index + 1));
crazyFlyZoneTab* widget = new crazyFlyZoneTab(CF_index);
ui->tabWidget->insertTab(CF_index + 1, widget, qstr);
// ui->tabWidget->addTab(widget, qstr);
crazyFlyZoneTab* widget = new crazyFlyZoneTab(i);
// ui->tabWidget->insertTab(i, widget, qstr);
ui->tabWidget->addTab(widget, qstr);
ROS_INFO("Added tab");
connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int)));
}
// for(int i = 0; i < n; i++)
// {
// QString qstr = "Crazyfly ";
// qstr.append(QString::number(i+1));
// crazyFlyZoneTab* widget = new crazyFlyZoneTab(i);
// ui->tabWidget->insertTab(i, widget, qstr);
// connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int)));
// }
updateComboBoxesCFZones();
}
......@@ -512,12 +525,12 @@ void MainGUIWindow::on_checkBox_crazyfly_zones_toggled(bool checked)
void MainGUIWindow::on_tabWidget_currentChanged(int index)
{
// this index is tab index. Need to go to cf index
QString name = ui->tabWidget->tabText(index);
#ifdef CATKIN_MAKE
int cf_index = cf_linker->getCFZoneIndexFromName(name);
scene->setSelectedCrazyFlyZone(cf_index);
#endif
// // this index is tab index. Need to go to cf index
// QString name = ui->tabWidget->tabText(index);
// #ifdef CATKIN_MAKE
// int cf_index = cf_linker->getCFZoneIndexFromName(name);
// scene->setSelectedCrazyFlyZone(cf_index);
// #endif
}
void MainGUIWindow::centerViewIndex(int index)
......
1,CF2,123,0,-0.46,0.12,-0.2,1.22,1.61,2
2,CF3,1233,1,0.34,-2.25,-0.2,2.12,-1.11,2
2,CF1,123,0,0.66,0.11,-0.2,3.46,1.76,2
1,CF2,1234,1,0.78,-2.09,-0.2,3.38,-0.45,2
5,CF3,12346,2,3.94,-1.07,-0.2,5.33,0.81,2
Supports Markdown
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