91 auto createdAronDict = std::make_shared<aron::data::Dict>(i->getPath());
95 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
98 if (el->checkState(2) == Qt::CheckState::Unchecked)
106 for (
const auto& [key, value] : i->getMemberTypes())
113 if (v.isConversionSuccessful())
115 createdAronDict->addElement(key, v.createdAron);
125 auto createdAronDict = std::make_shared<aron::data::Dict>(i->getPath());
129 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
132 if (el->checkState(2) == Qt::CheckState::Unchecked)
139 for (
int x = 0;
x < el->childCount(); ++
x)
141 auto it = el->child(
x);
144 auto key = it->text(0).toStdString();
146 handleErrors(v, createdAronDict->hasElement(key));
147 if (v.createdAron && v.isConversionSuccessful() && !createdAronDict->hasElement(key))
149 createdAronDict->addElement(key, v.createdAron);
159 auto createdAronList = std::make_shared<aron::data::List>(i->getPath());
163 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
166 if (el->checkState(2) == Qt::CheckState::Unchecked)
173 auto childrenTypes = i->getChildren();
175 for (
int j = 0; j < el->childCount(); ++j)
179 handleErrors(convVisitor);
183 createdAronList->addElement(convVisitor.
createdAron);
263 auto createdMatrix = std::make_shared<aron::data::NDArray>(i->getPath());
265 switch (i->getElementType())
267 case armarx::aron::type::matrix::UINT8:
268 case armarx::aron::type::matrix::INT8:
271 case armarx::aron::type::matrix::UINT16:
272 case armarx::aron::type::matrix::INT16:
275 case armarx::aron::type::matrix::UINT32:
276 case armarx::aron::type::matrix::INT32:
277 case armarx::aron::type::matrix::FLOAT32:
280 case armarx::aron::type::matrix::FLOAT64:
281 case armarx::aron::type::matrix::INT64:
288 switch (i->getElementType())
290 case armarx::aron::type::matrix::UINT8:
291 createdMatrix->setType(
"unsigned char");
293 case armarx::aron::type::matrix::UINT16:
294 createdMatrix->setType(
"unsigned short");
296 case armarx::aron::type::matrix::UINT32:
297 createdMatrix->setType(
"unsigned int");
299 case armarx::aron::type::matrix::INT8:
300 createdMatrix->setType(
"char");
302 case armarx::aron::type::matrix::INT16:
303 createdMatrix->setType(
"short");
305 case armarx::aron::type::matrix::INT32:
306 createdMatrix->setType(
"int");
308 case armarx::aron::type::matrix::FLOAT32:
309 createdMatrix->setType(
"float");
311 case armarx::aron::type::matrix::FLOAT64:
312 createdMatrix->setType(
"double");
314 case armarx::aron::type::matrix::INT64:
315 createdMatrix->setType(
"long");
320 createdMatrix->setShape({i->getRows(), i->getCols(), dataSize});
321 int totalByteSize = i->getRows() * i->getCols() * dataSize;
325 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
328 if (el->checkState(2) == Qt::CheckState::Unchecked)
336 auto* rootWidget = el->treeWidget();
338 auto* widget = rootWidget->itemWidget(el, 1);
343 handleErrors(matrixWidget->hasParseErrors());
344 if (matrixWidget->hasParseErrors())
350 std::vector<unsigned char> elems;
351 elems.reserve(totalByteSize);
355 for (
size_t row = 0; row < (size_t)i->getRows(); ++row)
357 for (
size_t col = 0; col < (size_t)i->getCols(); ++col)
360 auto parsed = matrixWidget->parseElement(row, col);
362 elems.insert(elems.end(), parsed.begin(), parsed.end());
365 createdMatrix->setData(totalByteSize, elems.data());
373 auto createdQuat = std::make_shared<aron::data::NDArray>(i->getPath());
375 int dataSize = i->getElementType() == aron::type::quaternion::ElementType::FLOAT32 ? 4 : 8;
376 createdQuat->setShape({1, 4, dataSize});
377 createdQuat->setType(i->getFullName());
380 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
383 if (el->checkState(2) == Qt::CheckState::Unchecked)
390 auto* itemWidget = el->treeWidget()->itemWidget(el, 1);
394 handleErrors(quatWidget->hasParseErrors());
395 if (quatWidget->hasParseErrors())
401 auto serialized = quatWidget->parseAllToNDArray();
402 if ((
int)serialized.size() != dataSize * 4)
405 <<
"serialized quaternions did not return byte sequence of correct length!";
407 createdQuat->setData(serialized.size(), serialized.data());
459 auto createdAronInt = std::make_shared<aron::data::Int>(i->getPath());
463 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
466 if (el->checkState(2) == Qt::CheckState::Unchecked)
473 std::string
str = el->text(1).toStdString();
476 createdAronInt->setValue(0);
481 int val = simox::alg::to_<int>(
str);
482 createdAronInt->setValue(val);
484 catch (
const simox::error::SimoxError& err)
487 ARMARX_VERBOSE <<
"Conversion from String to Int failed. Error:\"" << err.what()
499 auto createdAronLong = std::make_shared<aron::data::Long>(i->getPath());
503 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
506 if (el->checkState(2) == Qt::CheckState::Unchecked)
513 std::string
str = el->text(1).toStdString();
517 str = el->text(3).toStdString();
521 createdAronLong->setValue(simox::alg::to_<long>(
str));
523 catch (
const simox::error::SimoxError& err)
526 ARMARX_VERBOSE <<
"Conversion from String to Long failed. Error:\"" << err.what()
538 auto createdAronFloat = std::make_shared<aron::data::Float>(i->getPath());
542 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
545 if (el->checkState(2) == Qt::CheckState::Unchecked)
552 std::string
str = el->text(1).toStdString();
555 str = el->text(3).toStdString();
559 createdAronFloat->setValue(simox::alg::to_<float>(
str));
561 catch (
const simox::error::SimoxError& err)
564 ARMARX_VERBOSE <<
"Conversion from String to Float failed. Error:\"" << err.what()
576 auto createdAronDouble = std::make_shared<aron::data::Double>(i->getPath());
580 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
583 if (el->checkState(2) == Qt::CheckState::Unchecked)
590 std::string
str = el->text(1).toStdString();
593 str = el->text(3).toStdString();
597 createdAronDouble->setValue(simox::alg::to_<double>(
str));
599 catch (
const simox::error::SimoxError& err)
602 ARMARX_VERBOSE <<
"Conversion from String to Double failed. Error:\"" << err.what()
614 auto createdAronBool = std::make_shared<aron::data::Bool>(i->getPath());
618 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
621 if (el->checkState(2) == Qt::CheckState::Unchecked)
628 std::string
str = el->text(1).toStdString();
631 str = el->text(3).toStdString();
635 createdAronBool->setValue(simox::alg::to_<bool>(
str));
637 catch (
const simox::error::SimoxError& err)
640 ARMARX_VERBOSE <<
"Conversion from String to Bool failed. Error:\"" << err.what()