Skip to content
Snippets Groups Projects
Commit c380ed53 authored by Julian Tusch's avatar Julian Tusch :no_entry_sign:
Browse files

merge conflict resolves

parent 1399d50e
No related branches found
No related tags found
1 merge request!449Fluxio preliminary release
Pipeline #22334 failed
......@@ -245,12 +245,17 @@ module armarx
provider::dto::ParameterUpdateResult
updateSkillParameters(dto::SkillExecutionID executionId, aron::data::dto::Dict parameters); // add params to a skill
// notify a skill to stop ASAP.
provider::dto::AbortSkillResult
abortSkill(dto::SkillExecutionID executionId); // notify a skill to stop ASAP.
abortSkill(dto::SkillExecutionID executionId);
provider::dto::AbortSkillResult
abortSkillAsync(dto::SkillExecutionID executionId);
// notify all skills directly via ice interface instead of ugly workarounds in both c++ and python
AbortSkillResultList abortAllSkills();
AbortSkillResultList abortAllSkillsAsync();
//****************************//
//** Fluxio related methods **//
//****************************//
......@@ -317,12 +322,6 @@ module armarx
optional(12) dto::FluxioSkillStatusUpdateList
getFluxioSkillExecutionStatus(string executionId) throws dto::FluxioException; // returns the status of a fluxio execution
// notify a skill to stop ASAP.
provider::dto::AbortSkillResult abortSkill(dto::SkillExecutionID executionId);
provider::dto::AbortSkillResult abortSkillAsync(dto::SkillExecutionID executionId);
// notify all skills directly via ice interface instead of ugly workarounds in both c++ and python
AbortSkillResultList abortAllSkills();
AbortSkillResultList abortAllSkillsAsync();
};
}
}
......
......@@ -21,14 +21,6 @@
* GNU General Public License
*/
#pragma once
// STD/STL
#include <map>
#include <string>
#include <vector>
// ArmarX
#include <ArmarXCore/core/exceptions/Exception.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <string>
......
......@@ -122,6 +122,71 @@ namespace armarx
return ret;
}
std::vector<skills::provider::dto::AbortSkillResult> SkillManagerComponentPluginUser::abortAllSkills(const Ice::Current &current)
{
ARMARX_IMPORTANT << "Stopping all running executions.";
std::vector<skills::provider::dto::AbortSkillResult> results;
skills::manager::dto::SkillStatusUpdateMap executions;
// we ALWAYS want the newest information when stopping all!
// e.g. there is some new skill not known to the GUI which we explicitely want to stop too.
// the stop-all function is often used in an emergency, so we'll live with the extra call...
try
{
executions = this->getSkillExecutionStatuses(current);
}
catch (...) // if any error occurs, we use the snapshot as backup. better to miss a skill
// than to not do anything.
{
executions = this->getSkillExecutionStatuses(current);
}
for (auto& [executionId, status] : executions)
{
// select all running executions...
if (status.status != armarx::skills::core::dto::Execution::Aborted and status.status != armarx::skills::core::dto::Execution::Failed)
{
// ... and kill them.
results.push_back(this->abortSkill(executionId, current));
}
}
return results;
}
std::vector<skills::provider::dto::AbortSkillResult> SkillManagerComponentPluginUser::abortAllSkillsAsync(const Ice::Current &current)
{
ARMARX_IMPORTANT << "Stopping all running executions.";
std::vector<skills::provider::dto::AbortSkillResult> results;
skills::manager::dto::SkillStatusUpdateMap executions;
// we ALWAYS want the newest information when stopping all!
// e.g. there is some new skill not known to the GUI which we explicitely want to stop too.
// the stop-all function is often used in an emergency, so we'll live with the extra call...
try
{
executions = this->getSkillExecutionStatuses(current);
}
catch (...) // if any error occurs, we use the snapshot as backup. better to miss a skill
// than to not do anything.
{
executions = this->getSkillExecutionStatuses(current);
}
for (auto& [executionId, status] : executions)
{
// select all running executions...
if (status.status != armarx::skills::core::dto::Execution::Aborted and status.status != armarx::skills::core::dto::Execution::Failed)
{
// ... and kill them.
results.push_back(this->abortSkillAsync(executionId, current));
}
}
return results;
}
void
SkillManagerComponentPluginUser::updateStatusForSkill(
const skills::provider::dto::SkillStatusUpdate& statusUpdate,
......
......@@ -56,6 +56,11 @@ namespace armarx
abortSkillAsync(const skills::manager::dto::SkillExecutionID& id,
const Ice::Current& current) override;
std::vector<skills::provider::dto::AbortSkillResult>
abortAllSkills(const Ice::Current& current) override;
std::vector<skills::provider::dto::AbortSkillResult>
abortAllSkillsAsync(const Ice::Current& current) override;
skills::manager::dto::SkillDescriptionMap
getSkillDescriptions(const Ice::Current& current) override;
......
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