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

Merged master; made it compilable and implemented execution signature in

Ice
parent 2fe18b33
No related merge requests found
Showing with 52 additions and 32 deletions
......@@ -450,8 +450,8 @@ namespace armarx
// update maps
skillStatusUpdates.insert_or_assign(executionId, statusUpdate);
skillExecutionParams.insert_or_assign(executionId,
statusUpdate.usedParameterization);
//skillExecutionParams.insert_or_assign(executionId,
// statusUpdate.usedParameterization);
SkillExecutionInfoTreeWidgetItem* found = nullptr;
for (int i = 0; i < widget.treeWidgetSkillExecutions->topLevelItemCount(); ++i)
......@@ -531,10 +531,13 @@ namespace armarx
void
SkillManagerMonitorWidgetController::rerunSkillWithSimilarParams()
{
skills::SkillParameterization selectedExecutionParams =
skillExecutionParams.at(selectedSkill.skillExecutionId);
executeSkillWithParams(selectedSkill.skillExecutionId.skillId,
selectedExecutionParams.parameterization);
// TODO: disabled until skillparameterization is replaced
//skills::SkillParameterization selectedExecutionParams =
//skillExecutionParams.at(selectedSkill.skillExecutionId);
//executeSkillWithParams(selectedSkill.skillExecutionId.skillId,
// selectedExecutionParams.parameterization);
executeSelectedSkill();
}
void
......@@ -543,8 +546,12 @@ namespace armarx
{
std::scoped_lock l(updateMutex);
auto providerId = skills::ProviderID(skillId);
const auto& skillDescriptions = skills.at(providerId);
auto providerId = skillId.providerId;
if (!providerId.has_value())
{
return;
}
const auto& skillDescriptions = skills.at(providerId.value());
if (skillDescriptions.find(skillId) == skillDescriptions.end())
{
return;
......@@ -553,7 +560,7 @@ namespace armarx
char hostname[HOST_NAME_MAX];
gethostname(hostname, HOST_NAME_MAX);
skills::SkillExecutionRequest req{selectedSkill.skillId,
skills::SkillExecutionRequest req(selectedSkill.skillId,
"Skills.Manager GUI (hostname: " + std::string(hostname) +
")",
params);
......
......@@ -155,8 +155,9 @@ namespace armarx
std::map<skills::ProviderID, std::map<skills::SkillID, skills::SkillDescription>> skills =
{};
std::map<skills::SkillExecutionID, skills::SkillStatusUpdate> skillStatusUpdates = {};
// store copies (!) of skill descriptions
std::map<skills::SkillExecutionID, skills::SkillParameterization> skillExecutionParams = {};
//std::map<skills::SkillExecutionID, skills::SkillParameterization> skillExecutionParams = {};
// User Input
struct SelectedSkill
......@@ -166,8 +167,8 @@ namespace armarx
// make default constructable
SelectedSkill() :
skillId({skills::SkillID::UNKNOWN}, skills::SkillID::UNKNOWN),
skillExecutionId({{skills::SkillID::UNKNOWN}, skills::SkillID::UNKNOWN},
skillId({}, skills::SkillID::UNKNOWN),
skillExecutionId({{}, skills::SkillID::UNKNOWN},
skills::SkillExecutionID::UNKNOWN,
armarx::core::time::DateTime::Invalid())
{
......
......@@ -67,6 +67,7 @@ module armarx
{
SkillID skillId;
string executorName;
string executionSignature;
armarx::core::time::dto::DateTime executionStartedTime;
string uuid;
};
......
......@@ -136,6 +136,7 @@ module armarx
{
SkillID skillId;
string executorName;
string executionSignature;
armarx::core::time::dto::DateTime executionStartedTime;
string uuid;
};
......
......@@ -63,7 +63,7 @@ namespace armarx::skills::segment
[&](const armem::wm::EntityInstance& i)
{
auto event = i.dataAs<armarx::skills::arondto::SkillStatusUpdate>();
skills::SkillStatusUpdate up;
skills::SkillStatusUpdate up = {};
armem::fromAron(event, up);
if (auto it = ret.find(up.executionId); it != ret.end() && up < it->second)
......
......@@ -4,12 +4,20 @@ namespace armarx
{
namespace skills
{
/*SkillExecutionID::SkillExecutionID(const SkillID& id,
const std::string& executorName,
const armarx::core::time::DateTime& time) :
skillId(id), executorName(executorName), executionStartedTime(time)
{
}*/
skills::manager::dto::SkillExecutionID
SkillExecutionID::toManagerIce() const
{
skills::manager::dto::SkillExecutionID ret;
ret.skillId = skillId.toManagerIce();
ret.executorName = executorName;
ret.executionSignature = executionSignature;
armarx::core::time::toIce(ret.executionStartedTime, executionStartedTime);
return ret;
}
......@@ -20,6 +28,7 @@ namespace armarx
skills::provider::dto::SkillExecutionID ret;
ret.skillId = skillId.toProviderIce();
ret.executorName = executorName;
ret.executionSignature = executionSignature;
armarx::core::time::toIce(ret.executionStartedTime, executionStartedTime);
return ret;
}
......@@ -29,7 +38,10 @@ namespace armarx
{
armarx::core::time::DateTime t;
armarx::core::time::fromIce(i.executionStartedTime, t);
return {skills::SkillID::FromIce(i.skillId), i.executorName, t};
return {.skillId = skills::SkillID::FromIce(i.skillId),
.executorName = i.executorName,
.executionSignature = i.executionSignature,
.executionStartedTime = t};
}
SkillExecutionID
......@@ -38,13 +50,16 @@ namespace armarx
{
armarx::core::time::DateTime t;
armarx::core::time::fromIce(i.executionStartedTime, t);
return {skills::SkillID::FromIce(i.skillId, providerName), i.executorName, t};
return {skills::SkillID::FromIce(i.skillId, providerName),
i.executorName,
i.executionSignature,
t};
}
std::string
SkillExecutionID::toString(const std::string& prefix) const
SkillExecutionID::toString() const
{
return skillId.toString(prefix) + ENTER_SEPARATOR + executorName + SEPARATOR +
return skillId.toString() + ENTER_SEPARATOR + executorName + SEPARATOR +
executionStartedTime.toDateTimeString() + EXIT_SEPARATOR;
}
......
......@@ -20,6 +20,7 @@ namespace armarx
{
SkillID skillId;
std::string executorName;
std::string executionSignature;
armarx::core::time::DateTime executionStartedTime;
static const constexpr char* UNKNOWN = "UNKNOWN";
......@@ -27,10 +28,11 @@ namespace armarx
static const constexpr char* EXIT_SEPARATOR = "]";
static const constexpr char* SEPARATOR = "@";
SkillExecutionID() = delete;
SkillExecutionID(const SkillID&,
//SkillExecutionID() = delete;
/*SkillExecutionID(const SkillID& id,
const std::string& executorName,
const armarx::core::time::DateTime&);
const armarx::core::time::DateTime& time);*/
bool
operator==(const SkillExecutionID& other) const
......@@ -50,13 +52,6 @@ namespace armarx
return this->toString() <= other.toString();
}
std::string
toString() const
{
return skillId.toString() + " requested by " + executorName + " at " +
executionStartedTime.toDateTimeString();
}
skills::manager::dto::SkillExecutionID toManagerIce() const;
skills::provider::dto::SkillExecutionID toProviderIce() const;
......@@ -66,7 +61,7 @@ namespace armarx
static SkillExecutionID FromIce(const skills::provider::dto::SkillExecutionID&,
const std::optional<skills::ProviderID>& providerName);
std::string toString(const std::string& prefix = "") const;
std::string toString() const;
};
} // namespace skills
......
......@@ -18,6 +18,7 @@ namespace armarx
{
public:
static const constexpr char* NAME_SEPARATOR = "/";
static const constexpr char* UNKNOWN = "UNKNOWN";
bool operator==(const SkillID& other) const;
bool operator!=(const SkillID& other) const;
......
......@@ -190,10 +190,9 @@ namespace armarx::plugins
{
ARMARX_CHECK(executionRequest.skillId.isFullySpecified());
skills::SkillExecutionID executionId{.skillId = executionRequest.skillId,
.executorName = executionRequest.executorName,
.executionStartedTime =
armarx::core::time::DateTime::Now()};
skills::SkillExecutionID executionId(executionRequest.skillId,
executionRequest.executorName,
armarx::core::time::DateTime::Now());
skills::SkillStatusUpdate ret{
{executionId, executionRequest.parameters, executionRequest.callbackInterface}};
......
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