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

updated fluxio edge fromIce:

parent 311a60da
No related branches found
No related tags found
3 merge requests!460Draft: fluxio/dev-skill-timeout,!449Fluxio preliminary release,!446Draft: Fluxio related changes
Pipeline #18774 failed
......@@ -6,6 +6,7 @@
#include "FluxioNode.h"
#include "FluxioParameter.h"
#include "FluxioSubSkillNode.h"
namespace armarx
{
......@@ -36,20 +37,70 @@ namespace armarx
std::map<std::string, FluxioNode*>& nodesMap,
std::map<std::string, FluxioParameter>& parametersMap)
{
skills::FluxioNode* fromNodePtr =
FluxioNode::FromFluxioIdentificatorIce(i.fromNodeId, nodesMap);
skills::FluxioParameter* fromParameterPtr =
FluxioParameter::FromFluxioIdentificatorIce(i.fromParameterId, parametersMap);
skills::FluxioNode* toNodePtr =
FluxioNode::FromFluxioIdentificatorIce(i.toNodeId, nodesMap);
skills::FluxioParameter* toParameterPtr =
FluxioParameter::FromFluxioIdentificatorIce(i.toParameterId, parametersMap);
if (fromNodePtr == nullptr || fromParameterPtr == nullptr || toNodePtr == nullptr ||
toParameterPtr == nullptr)
if (fromNodePtr == nullptr || toNodePtr == nullptr)
{
ARMARX_WARNING << "Failed to convert node(s)";
return std::nullopt;
}
skills::FluxioParameter* fromParameterPtr = nullptr;
skills::FluxioParameter* toParameterPtr = nullptr;
// Check if fromNode is a SubSkillNode
if (fromNodePtr->nodeType == "SUBSKILL")
{
const auto* subSkillNodePtr = dynamic_cast<FluxioSubSkillNode*>(fromNodePtr);
try
{
auto& subSkillParams = subSkillNodePtr->skillPtr->parameters;
fromParameterPtr = FluxioParameter::FromFluxioIdentificatorIce(
i.fromParameterId, subSkillParams);
}
catch (...)
{
ARMARX_WARNING << "Failed to retrieve parameters of skill in subskill node";
return std::nullopt;
}
}
else
{
fromParameterPtr =
FluxioParameter::FromFluxioIdentificatorIce(i.fromParameterId, parametersMap);
}
// Check if toNode is a SubSkillNode
if (toNodePtr->nodeType == "SUBSKILL")
{
const auto* subSkillNodePtr = dynamic_cast<FluxioSubSkillNode*>(toNodePtr);
try
{
auto& subSkillParams = subSkillNodePtr->skillPtr->parameters;
toParameterPtr = FluxioParameter::FromFluxioIdentificatorIce(i.toParameterId,
subSkillParams);
}
catch (...)
{
ARMARX_WARNING << "Failed to retrieve parameters of skill in subskill node";
return std::nullopt;
}
}
else
{
toParameterPtr =
FluxioParameter::FromFluxioIdentificatorIce(i.toParameterId, parametersMap);
}
if (fromParameterPtr == nullptr || toParameterPtr == nullptr)
{
ARMARX_WARNING << "Could not create FluxioEdge";
ARMARX_WARNING << "Failed to convert parameter(s)";
return std::nullopt;
}
......
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