SkillExecutionTreeWidgetItem.h
Go to the documentation of this file.
1 #ifndef SKILLEXECUTIONTREEWIDGETITEM_H
2 #define SKILLEXECUTIONTREEWIDGETITEM_H
3 
4 #include <QPushButton>
5 #include <QTreeWidgetItem>
6 
10 
11 #include "../memory/MemoryCommunicatorBase.h"
13 
14 namespace armarx::skills::gui
15 {
16  static const std::map<skills::SkillStatus, std::string> EXECUTION_STATUS_TO_STRING = {
17  // Main states
18  {skills::SkillStatus::Constructing, "Constructing"},
19  {skills::SkillStatus::Initializing, "Initializing"},
20  {skills::SkillStatus::Preparing, "Preparing"},
21  {skills::SkillStatus::Running, "Running"},
22 
23  // Terminating
24  {skills::SkillStatus::Aborted, "Aborted"},
25  {skills::SkillStatus::Failed, "Failed"},
26  {skills::SkillStatus::Succeeded, "Succeeded"}};
27 
29  public QObject,
30  public QTreeWidgetItem,
32  {
33  Q_OBJECT
34  public:
36 
38  std::shared_ptr<SkillManagerWrapper> _memory,
39  SkillExecutionTreeWidget* parent) :
40  MemoryCommunicatorBase(_memory), executionId(id), parentTree(parent)
41  {
42  setupUi();
43  }
44 
47  const skills::SkillExecutionID& needle);
48 
50 
51  void updateItem(skills::SkillStatus& skillStatus);
52 
53  protected:
55 
56  public slots:
57  void abortExecution();
58 
59  private:
60  void setupUi();
61  void connectSignals();
62  void updateButtonState(skills::SkillStatus& skillStatus);
63  SkillExecutionTreeWidget* parentTree = nullptr;
64  QPushButton* abortButton = nullptr;
65  };
66 } // namespace armarx::skills::gui
67 
68 #endif // SKILLEXECUTIONTREEWIDGETITEM_H
armarx::skills::SkillExecutionID
Definition: SkillExecutionID.h:19
SkillStatusUpdate.h
armarx::skills::SkillStatus::Aborted
@ Aborted
armarx::skills::gui::SkillExecutionTreeWidgetItem::SkillExecutionTreeWidgetItem
SkillExecutionTreeWidgetItem()=delete
armarx::skills::gui::SkillExecutionTreeWidgetItem::SearchRecursiveForMatch
static SkillExecutionTreeWidgetItem * SearchRecursiveForMatch(SkillExecutionTreeWidgetItem *haystack, const skills::SkillExecutionID &needle)
Definition: SkillExecutionTreeWidgetItem.cpp:6
SkillExecutionID.h
armarx::skills::gui::SkillExecutionTreeWidgetItem::executionId
skills::SkillExecutionID executionId
Definition: SkillExecutionTreeWidgetItem.h:54
armarx::skills::gui::SkillExecutionTreeWidgetItem::abortExecution
void abortExecution()
Definition: SkillExecutionTreeWidgetItem.cpp:56
armarx::skills::SkillStatus::Preparing
@ Preparing
armarx::skills::gui
Definition: PeriodicUpdateWidget.cpp:11
armarx::skills::gui::SkillExecutionTreeWidgetItem::SkillExecutionTreeWidgetItem
SkillExecutionTreeWidgetItem(const skills::SkillExecutionID &id, std::shared_ptr< SkillManagerWrapper > _memory, SkillExecutionTreeWidget *parent)
Definition: SkillExecutionTreeWidgetItem.h:37
armarx::skills::gui::SkillExecutionTreeWidgetItem
Definition: SkillExecutionTreeWidgetItem.h:28
armarx::skills::SkillStatus::Initializing
@ Initializing
SkillExecutionTreeWidgetItem.h
SkillExecutionTreeWidget.h
armarx::skills::gui::SkillExecutionTreeWidgetItem::updateItem
void updateItem(skills::SkillStatus &skillStatus)
Definition: SkillExecutionTreeWidgetItem.cpp:39
armarx::skills::SkillStatus::Running
@ Running
armarx::skills::gui::SkillExecutionTreeWidgetItem::getExecutionId
skills::SkillExecutionID getExecutionId()
Definition: SkillExecutionTreeWidgetItem.cpp:33
armarx::skills::SkillStatus::Constructing
@ Constructing
armarx::skills::gui::SkillExecutionTreeWidget
Definition: SkillExecutionTreeWidget.h:14
armarx::skills::gui::MemoryCommunicatorBase
Definition: MemoryCommunicatorBase.h:14
armarx::skills::SkillStatus
SkillStatus
Definition: SkillStatusUpdate.h:20
armarx::skills::SkillStatus::Succeeded
@ Succeeded
armarx::skills::SkillStatus::Failed
@ Failed