SkillExecutionTreeWidget.h
Go to the documentation of this file.
1#ifndef SKILLEXECUTIONTREEWIDGET_H
2#define SKILLEXECUTIONTREEWIDGET_H
3
4#include <QTreeWidget>
5
7
9
10namespace armarx::skills::gui
11{
12 using StatusMap = std::map<skills::SkillExecutionID, skills::SkillStatusUpdate>;
13
14 class SkillExecutionTreeWidget : public QTreeWidget, public MemoryCommunicatorBase
15 {
16 public:
17 SkillExecutionTreeWidget(std::shared_ptr<SkillManagerWrapper> _memory,
18 QWidget* parent = nullptr) :
19 QTreeWidget(parent), MemoryCommunicatorBase(_memory)
20 {
21 setupUi();
22 }
23
25 {
27
28 // make default constructable
31 .skillId = {.providerId = std::nullopt, .skillName = skills::SkillID::UNKNOWN},
33 .executionStartedTime = armarx::core::time::DateTime::Invalid()}
34 {
35 }
36 };
37
39
40 public slots:
41 void disconnectGui();
43
44 private slots:
45 void executionSelectionChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
46 void runContextMenu(const QPoint& pos);
47 void stopSelectedExecution();
48 void rerunSkillWithSimilarParams();
49
50 private:
51 void setupUi();
52 void connectSignals();
53
54 /**
55 * @brief Checks the validity of the selected item at run time.
56 * @return the validity.
57 */
58 bool selectionValid();
59 SelectedExecution selectedExecution;
60 };
61} // namespace armarx::skills::gui
62
63#endif // SKILLEXECUTIONTREEWIDGET_H
static DateTime Invalid()
Definition DateTime.cpp:57
static const constexpr char * UNKNOWN
Definition SkillID.h:18
MemoryCommunicatorBase(std::shared_ptr< SkillManagerWrapper > _memory)
SkillExecutionTreeWidget(std::shared_ptr< SkillManagerWrapper > _memory, QWidget *parent=nullptr)
void updateGui(SkillManagerWrapper::Snapshot update)
std::map< skills::SkillExecutionID, skills::SkillStatusUpdate > StatusMap
static const constexpr char * UNKNOWN