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

Implemented toString for SkillExecutionID

parent 56789608
No related branches found
No related tags found
No related merge requests found
......@@ -488,23 +488,28 @@ namespace armarx
void
SkillManagerMonitorWidgetController::stopSkill()
{
std::string c = selectedSkill.skillExecutionId.skillId.skillName;
ARMARX_IMPORTANT << "Stop skill triggered: " << c;
// std::scoped_lock l(updateMutex);
// if (selectedSkill.skillId.fullySpecified())
// {
// return;
// }
// const auto& skillDescriptions = skills.at(*selectedSkill.skillId.providerId);
// if (!skillDescriptions.count(selectedSkill.skillId.skillName))
// {
// return;
// }
// ARMARX_INFO << "Stopping skill from GUI: " << selectedSkill.skillId;
// manager->abortSkill(selectedSkill.skillId);
std::scoped_lock l(updateMutex);
/*
* Example skills are not fully specified; disabled check
*
if (selectedSkill.skillExecutionId.skillId.fullySpecified())
{
ARMARX_INFO << "The user requested to stop a skill, which was not fully specified!";
return;
}
const auto& skillDescriptions = skills.at(*selectedSkill.skillId.providerId);
if (!skillDescriptions.count(selectedSkill.skillId.skillName))
{
return;
}
*/
ARMARX_INFO << "Stopping skill from GUI: "
<< selectedSkill.skillExecutionId.skillId.skillName;
memory->abortSkill(selectedSkill.skillExecutionId.toManagerIce());
}
void
......
......@@ -47,5 +47,13 @@ namespace armarx
armarx::core::time::fromIce(i.executionStartedTime, t);
return {skills::SkillID::FromIce(i.skillId, providerName), i.executorName, t};
}
std::string
SkillExecutionID::toString(const std::string& prefix) const
{
return skillId.toString(prefix) + ENTER_SEPARATOR + executorName + SEPARATOR +
executionStartedTime.toDateTimeString() + EXIT_SEPARATOR;
}
} // namespace skills
} // namespace armarx
......@@ -21,7 +21,11 @@ namespace armarx
SkillID skillId;
std::string executorName;
armarx::core::time::DateTime executionStartedTime;
static const constexpr char* UNKNOWN = "UNKNOWN";
static const constexpr char* ENTER_SEPARATOR = "[";
static const constexpr char* EXIT_SEPARATOR = "]";
static const constexpr char* SEPARATOR = "@";
SkillExecutionID() = delete;
SkillExecutionID(const SkillID&,
......@@ -61,6 +65,8 @@ namespace armarx
static SkillExecutionID FromIce(const skills::provider::dto::SkillExecutionID&,
const std::optional<skills::ProviderID>& providerName);
std::string toString(const std::string& prefix = "") const;
};
} // namespace skills
......
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