35 #define INPUT_GUARD(i) \
37 ARMARX_CHECK_NOT_NULL(i); \
44 std::string result =
"";
46 namespaces.begin(), namespaces.end(), [&result](
const auto& i) { result += i +
"."; });
59 property_user_->getProperty(
value->getValue(), name);
68 property_user_->getProperty(
value->getValue(), name);
77 property_user_->getProperty(
value->getValue(), name);
86 property_user_->getProperty(
value->getValue(), name);
94 auto name = global_namespace_ +
pathToName(
string);
95 auto property = property_user_->getProperty<std::string>(name);
96 if (not property.getValue().empty())
98 value->getValue() =
property.getValueAndReplaceAllVars();
102 value->getValue() =
"";
111 const auto& name = global_namespace_ +
pathToName(o);
113 if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) ==
114 implementedListDescriptors.end())
120 auto get_list = [
this, &name]() -> std::vector<std::string>
123 property_user_->getProperty(
list, name);
127 std::vector<std::string> vector = get_list();
128 std::for_each(vector.begin(),
130 [&old_list, &i, &type](
const auto& el)
132 old_list->addElement(factories::VariantHelper::make(type)->from_string(
133 el, old_list->getPath().withIndex(i)));
149 auto name = global_namespace_ +
pathToName(enumData);
150 property_user_->getProperty(
data->getValue(), name);
157 << (unknown ? unknown->getFullName() :
"nullptr");
162 const std::string& globalNamespace) :
164 global_namespace_(globalNamespace),
174 const auto& name = global_namespace_ +
pathToName(o);
176 if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) ==
177 implementedListDescriptors.end())
183 auto get_list = [
this, &name]() -> std::vector<std::string>
186 property_user_->getProperty(
list, name);
189 std::vector<std::string> vector = get_list();
193 [&old_dict, &type](
const auto& el)
195 auto key_value = simox::alg::split(el,
":");
196 old_dict->addElement(
198 factories::VariantHelper::make(type)->from_string(
199 key_value.back(), old_dict->getPath().withElement(key_value.front())));
251 const auto name = global_namespace_ +
pathToName(matrix);
252 const std::string
property = property_user_->getProperty<std::string>(name).getValue();
253 const auto vec = simox::alg::to_eigen_vec(property,
", ");
255 <<
"Matrix recovered from properties does not match the aron type";
257 data->setData(
data->getDataAsVector().size(),
258 reinterpret_cast<const unsigned char*
>(vec.data()));
266 auto name = global_namespace_ +
pathToName(quaternion);
267 const std::string
property = property_user_->getProperty<std::string>(name).getValue();
270 value->setData(newQuat->getDataAsVector().size(), newQuat->getData());
277 if (global_namespace_.empty())
280 global_namespace_ = t->getObjectNameWithoutNamespace() +
".";
286 const std::string& globalNamespace) :
288 global_namespace_(globalNamespace)
297 auto name = global_namespace_ +
pathToName(i);
298 property_definitions_->defineOptionalProperty<
int>(name, i->getValue());
306 auto name = global_namespace_ +
pathToName(f);
307 property_definitions_->defineOptionalProperty<
float>(name, f->getValue());
315 auto name = global_namespace_ +
pathToName(d);
316 property_definitions_->defineOptionalProperty<
double>(name, d->getValue());
324 auto name = global_namespace_ +
pathToName(b);
325 property_definitions_->defineOptionalProperty<
bool>(name, b->getValue());
333 auto name = global_namespace_ +
pathToName(
string);
334 property_definitions_->defineOptionalProperty<std::string>(name,
string->getValue());
342 auto name = global_namespace_ +
pathToName(i);
343 property_definitions_->defineOptionalProperty<
int>(name, i->getValue())
344 .map(t->getAcceptedValueMap());
354 const auto& name = global_namespace_ +
pathToName(l);
355 const auto& type = t->getAcceptedType()->getDescriptor();
356 if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) ==
357 implementedListDescriptors.end())
361 const auto&
input = l->getElements();
363 std::vector<std::string> vector;
366 std::back_inserter(vector),
367 [&type](
const auto& el)
368 { return factories::VariantHelper::make(type)->to_string(el); });
370 property_definitions_->defineOptionalProperty<std::string>(name,
str);
386 const auto& name = global_namespace_ +
pathToName(d);
387 const auto& type = t->getAcceptedType()->getDescriptor();
388 if (std::find(implementedListDescriptors.begin(), implementedListDescriptors.end(), type) ==
389 implementedListDescriptors.end())
393 const auto&
input = d->getElements();
394 std::stringstream ss;
395 for (
const auto& [key, el] :
input)
401 std::string
value = ss.str();
402 if (not
value.empty())
406 property_definitions_->defineOptionalProperty<std::string>(name,
value);
421 if (global_namespace_.empty())
423 global_namespace_ = type->getObjectNameWithoutNamespace() +
".";
432 auto name = global_namespace_ +
pathToName(quaternion);
434 data::converter::AronEigenConverter::ConvertToQuaternion<float>(quaternion);
435 property_definitions_->defineOptionalProperty<std::string>(
444 auto name = global_namespace_ +
pathToName(matrix);
445 auto shape = matrix->getShape();
447 if (shape.size() != 3 or (shape[0] != 1 and shape[1] != 1))
452 const auto mat = data::converter::AronEigenConverter::ConvertToMatrix<float>(*matrix);
453 std::string
value =
"";
454 for (
int i = 0; i < shape[0]; i++)
456 for (
int j = 0; j < shape[1]; j++)
461 if (not
value.empty())
466 property_definitions_->defineOptionalProperty<std::string>(name,
value);