SkillDashboardWidgetController.cpp
Go to the documentation of this file.
2
3#include <cmath>
4#include <fstream>
5#include <iostream>
6#include <string>
7
8#include <QDateTime>
9#include <QDebug>
10#include <QHBoxLayout>
11#include <QLabel>
12#include <QLineEdit>
13#include <QMessageBox>
14#include <QPalette>
15#include <QPushButton>
16#include <QString>
17#include <QStringList>
18#include <QTimer>
19#include <QToolButton>
20#include <Qt>
21#include <QtConcurrent/QtConcurrent>
22#include <QtGlobal>
23#include <QtWidgets/QSlider>
24#include <QtWidgets/QTableWidgetItem>
25
32
36
37#include "EllipsisPushButton.h"
38#include <nlohmann/json.hpp>
39
40namespace armarx
41{
46
48 DEFAULT_SETTINGS_PLUGIN_NAME("SkillDashboardGuiPlugin"),
49 DEFAULT_SETTINGS_CUSTOM_TEXT("custom text")
50 {
51 // init gui
52 ARMARX_INFO << "Setup UI";
53 ui.setupUi(getWidget());
54 this->shortcutLayout = new QVBoxLayout();
55 this->dialog = new SkillDashboardConfigWindow();
56 this->editModeAction = new QAction("Edit Mode", this);
57 this->editModeAction->setCheckable(true);
58 this->editModeAction->setToolTip("If toggled the shortcut config buttons and the reload, "
59 "add and export button will be shown.");
60
61 this->recoverButtons = new QToolButton();
62 QIcon iconRecover = getWidget()->style()->standardIcon(QStyle::SP_BrowserReload);
63 this->recoverButtons->setIcon(iconRecover);
64 this->recoverButtons->setToolTip("Recover all buttons");
65
66 this->errorMessageArea = new MessageWidget(true, getWidget());
67 ui.messageArea->layout()->addWidget(this->errorMessageArea);
68
69 ui.shortcutListWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
70 ui.shortcutListWidget->setDragDropMode(QAbstractItemView::InternalMove);
71 ui.shortcutListWidget->setDefaultDropAction(Qt::MoveAction);
72 ui.shortcutListWidget->setSelectionMode(QAbstractItemView::SingleSelection);
73 ui.shortcutListWidget->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
74 ui.shortcutListWidget->setStyleSheet(R"(
75 QListWidget {
76 background: transparent;
77 border: none;
78 }
79 QListWidget::item {
80 margin: 0px;
81 padding: 0px;
82 }
83)");
84
85 qRegisterMetaType<skills::core::dto::Execution::Status>(
86 "skills::core::dto::Execution::Status");
87
88 connect(this->editModeAction, SIGNAL(toggled(bool)), this, SLOT(editMode(bool)));
89 connect(this->recoverButtons,
90 &QToolButton::clicked,
91 this,
92 &SkillDashboardWidget::enableBlockedButtons);
93 connect(ui.addFromClipboardButton,
94 &QPushButton::clicked,
95 this,
96 &SkillDashboardWidget::addFromClipboard);
97 connect(
98 ui.addButton, &QPushButton::clicked, this, [this]() { openConfigWindow("", "", ""); });
99 connect(ui.reloadButton, &QPushButton::clicked, this, &SkillDashboardWidget::loadButtons);
100 connect(
101 this, &SkillDashboardWidget::loadButtonInit, this, &SkillDashboardWidget::loadButtons);
102 connect(ui.exportButton, &QPushButton::clicked, this, &SkillDashboardWidget::exportButtons);
103 connect(ui.importButton, &QPushButton::clicked, this, &SkillDashboardWidget::importButtons);
104
105 connect(this,
107 this,
108 &SkillDashboardWidget::activateButton);
109
110
111 connect(this->dialog,
113 this,
114 &SkillDashboardWidget::onShortcutNameChanged);
115 connect(ui.stopAllButton, &QPushButton::clicked, this, &SkillDashboardWidget::stopAll);
116 connect(this, &SkillDashboardWidget::loadPathInfo, this, &SkillDashboardWidget::loadPath);
117
118 this->editModeAction->toggle();
119
120 ARMARX_INFO << "Done: Setup UI";
121 }
122
123 void
125 {
127
128 usingProxy(skillDashboardProxyName);
129
130 if (not this->skillManagerOberserverName.empty())
131 {
132 usingProxy(this->skillManagerOberserverName);
133 }
134 else
135 {
136 ARMARX_IMPORTANT << "empty";
137 }
138 }
139
140 void
142 {
144 this->connected.store(true);
145 getProxy(this->dashboardPrx, skillDashboardProxyName);
146 getProxy(this->managerPrx, this->skillManagerOberserverName);
147 ARMARX_INFO << "Starting thread that queries the SkillsMemory if skills are running in the "
148 "dashboard.";
149 this->exampleTask = std::thread([&] { exampleThreadMethod(); });
150 emit loadButtonInit();
151 emit loadPathInfo();
152 }
153
154 void
155 SkillDashboardWidget::updateShortcutListHeight()
156 {
157 int rows = ui.shortcutListWidget->count();
158 if (rows == 0)
159 {
160 ui.shortcutListWidget->setMinimumHeight(0);
161 return;
162 }
163
164 int rowHeight = ui.shortcutListWidget->sizeHintForRow(0);
165 int frame = ui.shortcutListWidget->frameWidth() * 2;
166 ui.shortcutListWidget->setMinimumHeight(rows * rowHeight + frame);
167 }
168
169 std::string
170 errorStatustoString(skills::core::dto::Execution::Status s)
171 {
172 switch (s)
173 {
174 case skills::core::dto::Execution::Status::Failed:
175 return "Failed";
176 case skills::core::dto::Execution::Status::Succeeded:
177 return "Succeeded";
178 case skills::core::dto::Execution::Status::Aborted:
179 return "Aborted";
180 default:
181 return "Other";
182 }
183 return "Unknown";
184 }
185
186 void
187 SkillDashboardWidget::saveShortcutOrder()
188 {
189 std::vector<std::string> order;
190
191 for (int i = 0; i < ui.shortcutListWidget->count(); ++i)
192 {
193 QListWidgetItem* item = ui.shortcutListWidget->item(i);
194 QString name = item->data(Qt::UserRole).toString();
195 order.push_back(name.toStdString());
196 }
197
198 try
199 {
200 dashboardPrx->saveShortcutOrder(order);
201 }
202 catch (Ice::Exception const&)
203 {
204 ARMARX_WARNING << "Could not save shortcut order";
205 }
206 }
207
208 void
209 SkillDashboardWidget::loadPath()
210 {
211 std::vector<std::string> pathSegments;
212 try
213 {
214 pathSegments = dashboardPrx->getPathStructure();
215 }
216 catch (Ice::Exception const&)
217 {
218 ARMARX_WARNING << "Could not request path";
219 }
220 if (pathSegments.size() == 3)
221 {
222 ui.packageEdit->setText(QString::fromStdString(pathSegments[0]));
223 ui.folderEdit->setText(QString::fromStdString(pathSegments[1]));
224 ui.fileNameEdit->setText(QString::fromStdString(pathSegments[2]));
225 }
226 }
227
228 void
229 SkillDashboardWidget::activateButton(const std::string& name,
230 skills::core::dto::Execution::Status status)
231 {
232 auto* btn = this->shortcutButtons.at(name);
233 btn->setDisabled(false);
234 if (status != skills::core::dto::Execution::Status::Succeeded)
235 {
236 btn->finishProgress(true);
237 std::string text = "Shortcut '" + name + "' terminated with status '" +
239 QString timestamp = QDateTime::currentDateTime().toString("HH:mm:ss");
240 QString messageWithTimestamp =
241 QString("[%1] %2").arg(timestamp, QString::fromStdString(text));
242 this->errorMessageArea->newErrorMessage(messageWithTimestamp);
243 }
244 btn->finishProgress(false);
245 }
246
247 void
248 SkillDashboardWidget::addFromClipboard()
249 {
250 QClipboard* clipboard = QApplication::clipboard();
251 auto clipboardText = clipboard->text().toStdString();
252 nlohmann::json j;
253 try
254 {
255 j = nlohmann::json::parse(clipboardText);
256 }
257 catch (const nlohmann::json::parse_error& e)
258 {
259 ARMARX_ERROR << "JSON Parse Error: " << e.what() << "\n";
260 }
261
262 auto shortcutImport = j["shortcuts"][0];
263 auto skillArgs = shortcutImport["skill_args"].dump(2);
264 auto skillId = shortcutImport["skill_id"];
265 this->openConfigWindow("", skillId, skillArgs);
266 }
267
268 void
269 SkillDashboardWidget::stopAll()
270 {
271 QtConcurrent::run(
272 [this]
273 {
274 try
275 {
276 auto results = managerPrx->abortAllSkills();
277 for (auto& r : results)
278 ARMARX_IMPORTANT << r.success;
279 }
280 catch (Ice::Exception const&)
281 {
282 ARMARX_WARNING << "Could not send stop all request.";
283 }
284 });
285 this->enableBlockedButtons();
286 }
287
288 void
289 SkillDashboardWidget::exampleThreadMethod()
290 {
291 while (this->connected.load())
292 {
293 if (not this->runningSkills.empty())
294 {
295 for (auto it = this->runningSkills.cbegin(); it != this->runningSkills.cend();)
296 {
297 skills::core::dto::Execution::Status status =
298 skills::core::dto::Execution::Status::Succeeded;
299
300 try
301 {
302 IceUtil::Optional<skills::manager::dto::SkillStatusUpdate> update =
303 this->managerPrx->getSkillExecutionStatus(it->second);
304 if (update)
305 {
306 status = update->status;
307 }
308 }
309 catch (Ice::Exception const&)
310 {
311 ARMARX_WARNING << "Could not get skill status." << deactivateSpam(10);
312 }
313
314 if (status == skills::core::dto::Execution::Status::Succeeded ||
315 status == skills::core::dto::Execution::Status::Failed ||
316 status == skills::core::dto::Execution::Status::Aborted)
317 {
318 ARMARX_INFO << "Finished skill " << it->first;
319 emit skillFinished(it->first, status);
320 it = this->runningSkills.erase(it);
321 }
322 else
323 {
324 ++it;
325 }
326 }
327 ARMARX_INFO << deactivateSpam(10) << "Waiting for skills to finish..";
328 }
330 }
331 }
332
333 void
334 SkillDashboardWidget::onShortcutNameChanged()
335 {
336
337 if ((this->shortcutButtons.find(this->dialog->getShortcutName().toStdString()) !=
338 this->shortcutButtons.end()) and
339 (this->dialog->getShortcutName().toStdString() != this->currentShortcutName))
340 {
341 this->dialog->setInfoText(
342 "A shortcut with this name already exists! The old one will be overwritten.");
344 << "A shortcut with this name already exists! The old one will be overwritten!";
345 }
346 else
347 {
348 this->dialog->setInfoText("");
349 }
350 }
351
352 void
353 SkillDashboardWidget::openConfigWindow(const std::string& name,
354 const std::string& id,
355 const std::string& args)
356 {
357
358 this->dialog->setShortcutName(name);
359 this->dialog->setSkillId(id);
360 this->dialog->setSkillConfig(args);
361
362
363 if (this->dialog->exec() == QDialog::Accepted)
364 {
365 try
366 {
367 SkillShortcut newShortcut{
368 .shortcutName = this->dialog->getShortcutName().toStdString(),
369 .skillId = this->dialog->getSkillId().toStdString(),
370 .skillArgs = this->dialog->getSkillConfig().toStdString()};
371 this->dashboardPrx->addNewShortcut(newShortcut);
372 }
373 catch (Ice::Exception const&)
374 {
375 ARMARX_WARNING << "Could not send new Shortcut." << deactivateSpam(10);
376 }
377 loadButtons();
378 }
379 }
380
381 void
382 SkillDashboardWidget::exportButtons()
383 {
384 saveShortcutOrder();
385 std::string packageName = ui.packageEdit->text().toStdString();
386 std::string folderName = ui.folderEdit->text().toStdString();
387 if (ui.fileNameEdit->text().count(' ') == ui.fileNameEdit->text().length())
388 {
389 ARMARX_ERROR << "please enter a file name!";
390 return;
391 }
392 std::string fileName = ui.fileNameEdit->text().toStdString();
393 try
394 {
395 this->dashboardPrx->exportShortcuts(packageName, folderName, fileName);
396 }
397 catch (Ice::Exception const&)
398 {
399 ARMARX_WARNING << "Could not send export task." << deactivateSpam(10);
400 }
401
402 std::string coloredPath = "<span style='color:red;'>" + packageName + "/" + folderName +
403 "/" + fileName + "</span>";
404 std::string propertyPath = "Insert " + coloredPath +
405 " into the property 'ArmarX.SkillDashboard.ShortcutPath' of the "
406 "SkillDashboard component.";
407
408
409 ui.exportPath->setFullText(QString::fromStdString(propertyPath));
410 ui.exportPath->setTextInteractionFlags(Qt::TextSelectableByMouse);
411 }
412
413 void
414 SkillDashboardWidget::importButtons()
415 {
416 bool success = false;
417 std::string packageName = ui.packageEdit->text().toStdString();
418 std::string folderName = ui.folderEdit->text().toStdString();
419 if (ui.fileNameEdit->text().count(' ') == ui.fileNameEdit->text().length())
420 {
421 ARMARX_ERROR << "please enter a file name!";
422 return;
423 }
424 std::string fileName = ui.fileNameEdit->text().toStdString();
425 try
426 {
427 success = this->dashboardPrx->importShortcuts(packageName, folderName, fileName);
428 }
429 catch (Ice::Exception const&)
430 {
431 ARMARX_WARNING << "Could not send import task." << deactivateSpam(10);
432 }
433 if (success)
434 {
435 this->loadButtons();
436 }
437 }
438
439 void
440 SkillDashboardWidget::loadButtons()
441 {
442 this->shortcutButtons.clear();
443 this->configButtons.clear();
444 this->deleteButtons.clear();
445 ui.shortcutListWidget->clear();
446
447 std::vector<SkillShortcut> shortcuts;
448 try
449 {
450 shortcuts = this->dashboardPrx->getShortcuts();
451 }
452 catch (Ice::Exception const&)
453 {
454 ARMARX_WARNING << "Could not fetch default states." << deactivateSpam(10);
455 }
456
457
458 for (const auto& shortcut : shortcuts)
459 {
460 auto* mainButton =
461 new EllipsisPushButton(QString::fromStdString(shortcut.shortcutName));
462 mainButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
463 mainButton->setToolTip(QString("Execute"));
464
465 QToolButton* editButton = new QToolButton();
466 editButton->setIcon(
467 getWidget()->style()->standardIcon(QStyle::SP_FileDialogContentsView));
468 editButton->setToolTip(QString("Edit"));
469
470 QToolButton* deleteButton = new QToolButton();
471 deleteButton->setIcon(getWidget()->style()->standardIcon(QStyle::SP_TrashIcon));
472 deleteButton->setToolTip(QString("Delete"));
473
474 QWidget* rowWidget = new QWidget();
475 QHBoxLayout* layout = new QHBoxLayout(rowWidget);
476 layout->setContentsMargins(0, 0, 0, 0);
477 layout->setSpacing(2);
478 layout->addWidget(mainButton);
479 layout->addWidget(editButton);
480 layout->addWidget(deleteButton);
481
482 QListWidgetItem* item = new QListWidgetItem(ui.shortcutListWidget);
483 item->setSizeHint(rowWidget->sizeHint());
484 item->setData(Qt::UserRole, QString::fromStdString(shortcut.shortcutName));
485 ui.shortcutListWidget->addItem(item);
486 ui.shortcutListWidget->setItemWidget(item, rowWidget);
487
488 this->shortcutButtons[shortcut.shortcutName] = mainButton;
489 this->configButtons[shortcut.shortcutName] = editButton;
490 this->deleteButtons[shortcut.shortcutName] = deleteButton;
491
492 connect(mainButton,
493 &QPushButton::clicked,
494 this,
495 [this, name = shortcut.shortcutName] { executeSkill(name); });
496 connect(editButton,
497 &QToolButton::clicked,
498 this,
499 [this, name = shortcut.shortcutName] { editShortcut(name); });
500 connect(deleteButton,
501 &QToolButton::clicked,
502 this,
503 [this, name = shortcut.shortcutName] { deleteShortcut(name); });
504 }
505 updateShortcutListHeight();
506 }
507
508 void
509 SkillDashboardWidget::executeSkill(const std::string& name)
510 {
511 ARMARX_INFO << "About to execute skill with shortcut name `" << name
512 << "` from skill dashboard.";
513
514 SkillShortcut shortcut;
515 try
516 {
517 shortcut = this->dashboardPrx->getShortcut(name);
518 }
519 catch (Ice::Exception const&)
520 {
521 ARMARX_WARNING << "Could not fetch shortcut." << deactivateSpam(10);
522 std::string text = "Shortcut '" + name + "': Could not fetch shortcut.";
523 QString timestamp = QDateTime::currentDateTime().toString("HH:mm:ss");
524 QString messageWithTimestamp =
525 QString("[%1] %2").arg(timestamp, QString::fromStdString(text));
526 this->errorMessageArea->newErrorMessage(messageWithTimestamp);
527 }
528
529 size_t pos = shortcut.skillId.find('/');
530 std::string provider = "";
531 std::string nameSkill = "";
532 nlohmann::json json = nlohmann::json::parse(shortcut.skillArgs);
535 aron::data::dto::DictPtr paramterDto = data->toAronDictDTO();
536
537 if (pos != std::string::npos)
538 {
539 provider = shortcut.skillId.substr(0, pos);
540 nameSkill = shortcut.skillId.substr(pos + 1);
541 skills::manager::dto::ProviderID providerId{.providerName = provider};
542
543 skills::manager::dto::SkillID skillId{.providerId = providerId, .skillName = nameSkill};
544
545 char hostname[HOST_NAME_MAX];
546 gethostname(hostname, HOST_NAME_MAX);
547
548 skills::manager::dto::SkillExecutionRequest request{
549 .skillId = skillId,
550 .executorName = "Skills.Dashboard GUI (hostname: " + std::string(hostname) + ")",
551 .parameters = paramterDto,
552 };
553
554
555 try
556 {
557 ARMARX_IMPORTANT << "Executing skill with shortcut name `" << shortcut.shortcutName
558 << "` from skill dashboard.";
559 armarx::core::time::Duration skillTimeout =
561
562 IceUtil::Optional<armarx::skills::manager::dto::SkillDescription> optDto =
563 managerPrx->getSkillDescription(skillId);
564
565 if (optDto)
566 {
567 const auto& dto = *optDto;
568 skillTimeout =
569 armarx::core::time::Duration::MicroSeconds(dto.timeout.microSeconds);
570 }
571 else
572 {
573 ARMARX_WARNING << "SkillDescription not found";
574 }
575 skills::manager::dto::SkillExecutionID executionId =
576 this->managerPrx->executeSkillAsync(request);
577 this->runningSkills[shortcut.shortcutName] = executionId;
578 auto* btn = this->shortcutButtons.at(shortcut.shortcutName);
579 btn->setDisabled(true);
580 btn->startTimeout(skillTimeout.toSeconds());
581 }
582 catch (Ice::Exception const&)
583 {
584 ARMARX_WARNING << "Could not send execute request." << deactivateSpam(10);
585 std::string text = "Shortcut '" + name + "': Could not send execute request.";
586 QString timestamp = QDateTime::currentDateTime().toString("HH:mm:ss");
587 QString messageWithTimestamp =
588 QString("[%1] %2").arg(timestamp, QString::fromStdString(text));
589 this->errorMessageArea->newErrorMessage(messageWithTimestamp);
590 }
591 }
592 else
593 {
594 ARMARX_IMPORTANT << "Invalid SkillID";
595 }
596 }
597
598 void
599 SkillDashboardWidget::editShortcut(const std::string& name)
600 {
601 this->currentShortcutName = name;
602
603 SkillShortcut shortcut;
604 try
605 {
606 shortcut = this->dashboardPrx->getShortcut(name);
607 }
608 catch (Ice::Exception const&)
609 {
610 ARMARX_WARNING << "Could not fetch shortcut." << deactivateSpam(10);
611 }
612 openConfigWindow(shortcut.shortcutName, shortcut.skillId, shortcut.skillArgs);
613 this->currentShortcutName = "not set";
614 }
615
616 void
617 SkillDashboardWidget::deleteShortcut(const std::string& name)
618 {
619 ARMARX_INFO << "delete shortcut: " << name;
620 try
621 {
622 this->dashboardPrx->deleteShortcut(name);
623 //this->shortcutButtons.erase(this->shortcutButtons.find(name));
624 }
625 catch (Ice::Exception const&)
626 {
627 ARMARX_WARNING << "Could not delete shortcut." << deactivateSpam(10);
628 }
629 loadButtons();
630 }
631
632 void
633 SkillDashboardWidget::clearLayout(QLayout* layout)
634 {
635 if (!layout)
636 return;
637
638 while (QLayoutItem* item = layout->takeAt(0))
639 {
640 if (QWidget* widget = item->widget())
641 {
642 widget->deleteLater();
643 }
644 else if (QLayout* subLayout = item->layout())
645 {
646 clearLayout(subLayout);
647 }
648 delete item;
649 }
650 }
651
652 QPointer<QWidget>
654 {
655 if (customToolbar)
656 {
657 if (parent != customToolbar->parent())
658 {
659 customToolbar->setParent(parent);
660 }
661
662 return customToolbar.data();
663 }
664
665 customToolbar = new QToolBar(parent);
666 customToolbar->setIconSize(QSize(16, 16));
667 customToolbar->addAction(editModeAction);
668 customToolbar->addWidget(this->recoverButtons);
669
670 return customToolbar.data();
671 }
672
673 void
674 SkillDashboardWidget::editMode(bool edit)
675 {
676 if (edit)
677 {
678 for (const auto& button : this->deleteButtons)
679 {
680 button.second->setVisible(true);
681 }
682 for (const auto& button : this->configButtons)
683 {
684 button.second->setVisible(true);
685 }
686 ui.addButton->setVisible(true);
687 ui.reloadButton->setVisible(true);
688 ui.exportButton->setVisible(true);
689 ui.importButton->setVisible(true);
690 ui.exportConfiguration->setVisible(true);
691 ui.addFromClipboardButton->setVisible(true);
692 ui.shortcutListWidget->setDragDropMode(QAbstractItemView::InternalMove);
693 }
694 else
695 {
696 for (const auto& button : this->deleteButtons)
697 {
698 button.second->setVisible(false);
699 }
700 for (const auto& button : this->configButtons)
701 {
702 button.second->setVisible(false);
703 }
704 ui.addButton->setVisible(false);
705 ui.reloadButton->setVisible(false);
706 ui.exportButton->setVisible(false);
707 ui.importButton->setVisible(false);
708 ui.exportConfiguration->setVisible(false);
709 ui.addFromClipboardButton->setVisible(false);
710 ui.shortcutListWidget->setDragDropMode(QAbstractItemView::NoDragDrop);
711 }
712 }
713
714 void
715 SkillDashboardWidget::enableBlockedButtons()
716 {
717 for (auto& shortCutB : this->shortcutButtons)
718 {
719 shortCutB.second->setDisabled(false);
720 }
721 }
722
723 void
725 {
726 this->connected.store(false);
727 ARMARX_INFO << "Stopping thread which queries skill memory ...";
728 this->exampleTask.join();
729 ARMARX_INFO << "Stopped!";
730 }
731
732 void
736
737 QPointer<QDialog>
739 {
741
742 if (not m_config_dialog)
743 {
744 m_config_dialog = new armarx::SimpleConfigDialog{parent};
745 m_config_dialog->addProxyFinder<SkillDashboardInterfacePrx>(
746 {"SkillDashboard", "Skill Dashboard", "*SkillDashboard"});
747 m_config_dialog->addProxyFinder<skills::manager::dti::SkillManagerInterfacePrx>(
748 "SkillMemory", "", "*SkillMemory");
749 }
750 return qobject_cast<QDialog*>(m_config_dialog);
751 }
752
753 void
755 {
757 this->skillDashboardProxyName =
758 settings
759 ->value("skillDashboardProxyName", QString::fromStdString(skillDashboardProxyName))
760 .toString()
761 .toStdString();
762 this->skillManagerOberserverName =
763 settings->value("SkillMemory", "SkillMemory").toString().toStdString();
764 }
765
766 void
768 {
770 settings->setValue("skillDashboardProxyName",
771 QString::fromStdString(skillDashboardProxyName));
772 settings->setValue("SkillMemory", QString::fromStdString(this->skillManagerOberserverName));
773 }
774
775 void
777 {
779 if (m_config_dialog)
780 {
781 this->skillDashboardProxyName = m_config_dialog->getProxyName("SkillDashboard");
782 this->skillManagerOberserverName = m_config_dialog->getProxyName("SkillMemory");
783 }
784 }
785
786
787} // namespace armarx
std::string timestamp()
uint8_t data[1]
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
Definition Logging.cpp:75
std::enable_if<!HasGetWidgetName< ArmarXWidgetType >::value >::type addWidget()
virtual QPointer< QWidget > getWidget()
getWidget returns a pointer to the a widget of this controller.
static Duration SecondsDouble(double seconds)
Constructs a duration in seconds.
Definition Duration.cpp:78
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Ice::ObjectPrx getProxy(long timeoutMs=0, bool waitForScheduler=true) const
Returns the proxy of this object (optionally it waits for the proxy)
A config-dialog containing one (or multiple) proxy finders.
void addProxyFinder(const std::vector< EntryData > &entryData)
void onInitComponent() override
Pure virtual hook for the subclass.
QPointer< QWidget > getCustomTitlebarWidget(QWidget *parent) override
getTitleToolbar returns a pointer to the a toolbar widget of this controller.
void onDisconnectComponent() override
Hook for subclass.
void loadSettings(QSettings *settings) override
Implement to load the settings that are part of the GUI configuration.
void saveSettings(QSettings *settings) override
Implement to save the settings as part of the GUI configuration.
void onConnectComponent() override
Pure virtual hook for the subclass.
void configured() override
This function must be implemented by the user, if he supplies a config dialog.
void skillFinished(const std::string &name, skills::core::dto::Execution::Status status)
void onExitComponent() override
Hook for subclass.
QPointer< QDialog > getConfigDialog(QWidget *parent) override
getConfigDialog returns a pointer to the a configuration widget of this controller.
static data::DictPtr ConvertFromNlohmannJSONObject(const nlohmann::json &, const armarx::aron::Path &p={})
static void WaitFor(const Duration &duration)
Wait for a certain duration on the virtual clock.
Definition Clock.cpp:99
static Duration MicroSeconds(std::int64_t microSeconds)
Constructs a duration in microseconds.
Definition Duration.cpp:24
static Duration Seconds(std::int64_t seconds)
Constructs a duration in seconds.
Definition Duration.cpp:72
std::int64_t toSeconds() const
Returns the amount of seconds.
Definition Duration.cpp:84
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
Definition Logging.h:190
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:196
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition mongodb.cpp:68
::IceInternal::Handle< Dict > DictPtr
std::shared_ptr< Dict > DictPtr
Definition Dict.h:42
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::string errorStatustoString(skills::core::dto::Execution::Status s)
#define ARMARX_TRACE
Definition trace.h:77