38 connect(widget.btnRequest, SIGNAL(clicked()),
this, SLOT(on_btnRequest_clicked()), Qt::UniqueConnection);
39 connect(widget.btnRelease, SIGNAL(clicked()),
this, SLOT(on_btnRelease_clicked()), Qt::UniqueConnection);
70 getProxy(omo,
"ObjectMemoryObserver");
73 on_toolButtonRefresh_clicked();
85 auto entities = prior->getObjectClassesSegment()->getAllEntities();
86 QString oldSelection = widget.comboBoxAvailableObjectClasses->currentText();
87 widget.comboBoxAvailableObjectClasses->clear();
89 for (memoryx::EntityBasePtr base : entities)
92 auto var = entity->getAttributeValue(
"recognitionMethod");
93 if (var && !var->getString().empty() && var->getString() !=
"<none>")
95 objects << (QString::fromStdString(entity->getName()));
99 widget.comboBoxAvailableObjectClasses->addItems(objects);
100 int index = widget.comboBoxAvailableObjectClasses->findText(oldSelection);
103 widget.comboBoxAvailableObjectClasses->setCurrentIndex(
index);
110 channels = omo->getAvailableChannels(
false);
112 widget.comboBoxRequestedObjectClasses->clear();
113 for (
auto& channel : channels)
115 if (channel.first.find(
"_query_") != std::string::npos)
117 widget.comboBoxRequestedObjectClasses->addItem(QString::fromStdString(channel.first));
124 void armarx::ObjectLocalizationRequesterWidgetController::on_toolButtonRefresh_clicked()
127 updateAvailableChannels();
128 updateAvailableObjects();
131 void armarx::ObjectLocalizationRequesterWidgetController::on_btnRequest_clicked()
134 if (!widget.comboBoxAvailableObjectClasses->currentText().isEmpty())
136 omo->requestObjectClassRepeated(widget.comboBoxAvailableObjectClasses->currentText().toStdString(),
137 widget.spinBoxInterval->value(), widget.spinBoxPriority->value());
139 updateAvailableChannels();
142 void armarx::ObjectLocalizationRequesterWidgetController::on_btnRelease_clicked()
145 auto channelName = channels[widget.comboBoxRequestedObjectClasses->currentText().toStdString()].name;
146 if (!channelName.empty())
149 omo->releaseObjectClass(ref);
151 updateAvailableChannels();
158 if (parent != customToolbar->parent())
160 customToolbar->setParent(parent);
163 return customToolbar;
166 customToolbar =
new QToolBar(parent);
167 customToolbar->setIconSize(QSize(16, 16));
168 customToolbar->addAction(QIcon(
"://icons/view-refresh-7.png"),
"Refresh",
this, SLOT(on_toolButtonRefresh_clicked()));
170 return customToolbar;