diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp index d8cedad82f0aad884bf46e3e07a841c0f3fe0dad..31b9081cdb4dca70b136930bc4312c3758c31756 100644 --- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.cpp @@ -103,8 +103,8 @@ namespace armarx connect(widget.treeWidgetSkills, &QTreeWidget::currentItemChanged, this, &SkillManagerMonitorWidgetController::skillSelectionChanged); - connect(widget.treeWidgetSkillDetails, &QTreeWidget::itemDoubleClicked, - this, &SkillManagerMonitorWidgetController::onTreeWidgetItemDoubleClicked); +// connect(widget.treeWidgetSkillDetails, &QTreeWidget::itemDoubleClicked, +// this, &SkillManagerMonitorWidgetController::onTreeWidgetItemDoubleClicked); } SkillManagerMonitorWidgetController::~SkillManagerMonitorWidgetController() @@ -115,7 +115,10 @@ namespace armarx void SkillManagerMonitorWidgetController::reconnectToSkillManager() { - getProxy(manager, observerName, 1000); + if (connected) + { + getProxy(manager, observerName, 1000); + } } void @@ -131,11 +134,12 @@ namespace armarx widget.treeWidgetSkillDetails->setEditTriggers(QAbstractItemView::EditTrigger::NoEditTriggers); widget.treeWidgetSkillDetails->setColumnHidden(3, true); - this->reconnectToSkillManager(); + connected = true; } void SkillManagerMonitorWidgetController::onDisconnectComponent() { + connected = false; manager = nullptr; // reset all @@ -453,29 +457,29 @@ namespace armarx // TODO } - void SkillManagerMonitorWidgetController::onTreeWidgetItemDoubleClicked(QTreeWidgetItem* item, int column) - { - if (!item) - { - return; - } - - if (column == 1) - { - if (item->flags() & Qt::ItemIsEditable) // we use the flag to indicate whether the item is editable or not - { - // we assume its aron item - AronTreeWidgetItem* aItem = AronTreeWidgetItem::DynamicCastAndCheck(item); - std::string name = aItem->text(aron_tree_widget::constantes::TREE_WIDGET_ITEM_NAME).toStdString(); - std::string type = aItem->text(aron_tree_widget::constantes::TREE_WIDGET_ITEM_TYPE).toStdString(); - - // why visitor?!?!? - AronTreeWidgetModalCreatorVisitor v(name, aItem, widget.treeWidgetSkillDetails); - aron::type::visit(v, aItem->aronType); - auto modal = v.createdModal; - modal->exec(); - } - } - } +// void SkillManagerMonitorWidgetController::onTreeWidgetItemDoubleClicked(QTreeWidgetItem* item, int column) +// { +// if (!item) +// { +// return; +// } + +// if (column == 1) +// { +// if (item->flags() & Qt::ItemIsEditable) // we use the flag to indicate whether the item is editable or not +// { +// // we assume its aron item +// AronTreeWidgetItem* aItem = AronTreeWidgetItem::DynamicCastAndCheck(item); +// std::string name = aItem->text(aron_tree_widget::constantes::TREE_WIDGET_ITEM_NAME).toStdString(); +// std::string type = aItem->text(aron_tree_widget::constantes::TREE_WIDGET_ITEM_TYPE).toStdString(); + +// // why visitor?!?!? +// AronTreeWidgetModalCreatorVisitor v(name, aItem, widget.treeWidgetSkillDetails); +// aron::type::visit(v, aItem->aronType); +// auto modal = v.createdModal; +// modal->exec(); +// } +// } +// } } // namespace armarx diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.h b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.h index 2302cf45bd2c834134a28c964fb2120fe65cb8bf..d9a9379bdfdea0ee56c9c5f3e601ef68a5ce75b5 100644 --- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.h +++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/SkillManagerMonitorWidgetController.h @@ -124,6 +124,9 @@ namespace armarx // skillExecutions std::vector<std::thread> executions; + + // connected flag + std::atomic_bool connected = false; }; }