25 #include <RobotComponents/gui-plugins/MotionPlanning/QtWidgets/ui_MotionPlanningServerTaskList.h>
27 #include <Ice/LocalException.h>
39 connect(ui->pushButtonRefresh, SIGNAL(clicked()),
this, SLOT(
updateList()));
49 const auto&& rowsSelection = ui->tableWidget->selectionModel()->selectedRows();
50 if (rowsSelection.empty())
54 const auto rowIndex = rowsSelection.first().row();
55 return ui->tableWidget->item(rowIndex, 4)->text().toLong();
62 if (!planningServerProxy)
69 const auto data = planningServerProxy->getAllTaskInfo();
70 ui->tableWidget->setRowCount(
data.size());
71 std::size_t rowToSelect = 0;
73 for (std::size_t row = 0; row <
data.size(); ++row)
75 const auto& datum =
data.at(row);
76 ui->tableWidget->setItem(row, 0,
new QTableWidgetItem {QString::fromStdString(datum.taskName)});
77 ui->tableWidget->setItem(row, 1,
new QTableWidgetItem {QString::fromStdString(
toString(datum.status))});
78 ui->tableWidget->setItem(row, 2,
new QTableWidgetItem
80 datum.taskIdent.category.empty() ?
81 QString::fromStdString(datum.taskIdent.name) :
82 QString::fromStdString(datum.taskIdent.category) +
'\n' + QString::fromStdString(datum.taskIdent.name)
84 ui->tableWidget->setItem(row, 3,
new QTableWidgetItem {QString::fromStdString(datum.typeId)});
85 ui->tableWidget->setItem(row, 4,
new QTableWidgetItem {QString::number(datum.internalId)});
86 if (selected && *selected == datum.internalId)
91 ui->tableWidget->selectRow(rowToSelect);
93 catch (Ice::UserException&)
98 catch (Ice::NotRegisteredException&)
103 catch (Ice::ConnectionRefusedException&)
112 ui->tableWidget->setRowCount(0);
117 ui->checkBoxAutoRefresh->setChecked(
enabled);
122 if (ui->checkBoxAutoRefresh->isChecked())