Skip to content
Snippets Groups Projects
Commit 56789608 authored by Peter Albrecht's avatar Peter Albrecht
Browse files

Implemented tracking of selected SkillExecutionID in SelectedSkill

parent 181c3aa0
No related branches found
No related tags found
No related merge requests found
...@@ -160,16 +160,17 @@ namespace armarx ...@@ -160,16 +160,17 @@ namespace armarx
&QPushButton::clicked, &QPushButton::clicked,
this, this,
&SkillManagerMonitorWidgetController::executeSkill); &SkillManagerMonitorWidgetController::executeSkill);
// connect(widget.pushButtonStopSkill,
// &QPushButton::clicked,
// this,
// &SkillManagerMonitorWidgetController::stopSkill);
connect(widget.treeWidgetSkills, connect(widget.treeWidgetSkills,
&QTreeWidget::currentItemChanged, &QTreeWidget::currentItemChanged,
this, this,
&SkillManagerMonitorWidgetController::skillSelectionChanged); &SkillManagerMonitorWidgetController::skillSelectionChanged);
connect(widget.treeWidgetSkillExecutions,
&QTreeWidget::currentItemChanged,
this,
&SkillManagerMonitorWidgetController::skillExecutionSelectionChanged);
connect(widget.pushButtonRefreshNow, connect(widget.pushButtonRefreshNow,
&QPushButton::clicked, &QPushButton::clicked,
this, this,
...@@ -487,7 +488,8 @@ namespace armarx ...@@ -487,7 +488,8 @@ namespace armarx
void void
SkillManagerMonitorWidgetController::stopSkill() SkillManagerMonitorWidgetController::stopSkill()
{ {
ARMARX_IMPORTANT << "Stop skill triggered"; std::string c = selectedSkill.skillExecutionId.skillId.skillName;
ARMARX_IMPORTANT << "Stop skill triggered: " << c;
// std::scoped_lock l(updateMutex); // std::scoped_lock l(updateMutex);
// if (selectedSkill.skillId.fullySpecified()) // if (selectedSkill.skillId.fullySpecified())
// { // {
...@@ -505,6 +507,24 @@ namespace armarx ...@@ -505,6 +507,24 @@ namespace armarx
// manager->abortSkill(selectedSkill.skillId); // manager->abortSkill(selectedSkill.skillId);
} }
void
SkillManagerMonitorWidgetController::skillExecutionSelectionChanged(QTreeWidgetItem* current,
QTreeWidgetItem*)
{
std::scoped_lock l(updateMutex);
widget.groupBoxSkillExecutions->setEnabled(false);
if (!current)
{
// gui has died?
return;
}
auto c = static_cast<SkillExecutionInfoTreeWidgetItem*>(current);
selectedSkill.skillExecutionId = c->executionId;
widget.groupBoxSkillExecutions->setEnabled(true);
}
void void
SkillManagerMonitorWidgetController::skillSelectionChanged(QTreeWidgetItem* current, SkillManagerMonitorWidgetController::skillSelectionChanged(QTreeWidgetItem* current,
QTreeWidgetItem*) QTreeWidgetItem*)
......
...@@ -116,6 +116,7 @@ namespace armarx ...@@ -116,6 +116,7 @@ namespace armarx
private slots: private slots:
void skillSelectionChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous); void skillSelectionChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
void skillExecutionSelectionChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
void stopSkill(); void stopSkill();
void executeSkill(); void executeSkill();
...@@ -155,9 +156,14 @@ namespace armarx ...@@ -155,9 +156,14 @@ namespace armarx
struct SelectedSkill struct SelectedSkill
{ {
skills::SkillID skillId; skills::SkillID skillId;
skills::SkillExecutionID skillExecutionId;
// make default constructable // make default constructable
SelectedSkill() : skillId({skills::SkillID::UNKNOWN}, skills::SkillID::UNKNOWN) SelectedSkill() :
skillId({skills::SkillID::UNKNOWN}, skills::SkillID::UNKNOWN),
skillExecutionId({{skills::SkillID::UNKNOWN}, skills::SkillID::UNKNOWN},
skills::SkillExecutionID::UNKNOWN,
armarx::core::time::DateTime::Invalid())
{ {
} }
} selectedSkill; } selectedSkill;
......
...@@ -21,6 +21,7 @@ namespace armarx ...@@ -21,6 +21,7 @@ namespace armarx
SkillID skillId; SkillID skillId;
std::string executorName; std::string executorName;
armarx::core::time::DateTime executionStartedTime; armarx::core::time::DateTime executionStartedTime;
static const constexpr char* UNKNOWN = "UNKNOWN";
SkillExecutionID() = delete; SkillExecutionID() = delete;
SkillExecutionID(const SkillID&, SkillExecutionID(const SkillID&,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment