89 auto createdAronDict = std::make_shared<aron::data::Dict>(i->getPath());
93 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
96 if (el->checkState(1) == Qt::CheckState::Unchecked)
104 for (
const auto& [key, value] : i->getMemberTypes())
111 if (v.isConversionSuccessful())
113 createdAronDict->addElement(key, v.createdAron);
122 auto createdAronDict = std::make_shared<aron::data::Dict>(i->getPath());
126 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
129 if (el->checkState(1) == Qt::CheckState::Unchecked)
136 for (
int x = 0;
x < el->childCount(); ++
x)
138 auto it = el->child(
x);
141 auto key = it->text(0).toStdString();
143 handleErrors(v, createdAronDict->hasElement(key));
144 if (v.createdAron && v.isConversionSuccessful() && !createdAronDict->hasElement(key))
146 createdAronDict->addElement(key, v.createdAron);
155 auto createdAronList = std::make_shared<aron::data::List>(i->getPath());
159 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
162 if (el->checkState(1) == Qt::CheckState::Unchecked)
169 auto childrenTypes = i->getChildren();
171 for (
int j = 0; j < el->childCount(); ++j)
175 handleErrors(convVisitor);
179 createdAronList->addElement(convVisitor.
createdAron);
256 auto createdMatrix = std::make_shared<aron::data::NDArray>(i->getPath());
258 switch (i->getElementType())
260 case armarx::aron::type::matrix::INT8:
261 case armarx::aron::type::matrix::UINT8:
264 case armarx::aron::type::matrix::INT16:
265 case armarx::aron::type::matrix::UINT16:
268 case armarx::aron::type::matrix::UINT32:
269 case armarx::aron::type::matrix::INT32:
270 case armarx::aron::type::matrix::FLOAT32:
273 case armarx::aron::type::matrix::FLOAT64:
274 case armarx::aron::type::matrix::INT64:
280 switch (i->getElementType())
282 case armarx::aron::type::matrix::UINT8:
283 createdMatrix->setType(
"unsigned char");
285 case armarx::aron::type::matrix::UINT16:
286 createdMatrix->setType(
"unsigned short");
288 case armarx::aron::type::matrix::UINT32:
289 createdMatrix->setType(
"unsigned int");
291 case armarx::aron::type::matrix::INT8:
292 createdMatrix->setType(
"char");
294 case armarx::aron::type::matrix::INT16:
295 createdMatrix->setType(
"short");
297 case armarx::aron::type::matrix::INT32:
298 createdMatrix->setType(
"int");
300 case armarx::aron::type::matrix::FLOAT32:
301 createdMatrix->setType(
"float");
303 case armarx::aron::type::matrix::FLOAT64:
304 createdMatrix->setType(
"double");
306 case armarx::aron::type::matrix::INT64:
307 createdMatrix->setType(
"long");
311 createdMatrix->setShape({i->getRows(), i->getCols(), dataSize});
312 int totalByteSize = i->getRows() * i->getCols() * dataSize;
316 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
319 if (el->checkState(1) == Qt::CheckState::Unchecked)
327 auto* rootWidget = el->treeWidget();
329 auto* widget = rootWidget->itemWidget(el, 1);
332 handleErrors(matrixWidget->hasParseErrors());
333 if (matrixWidget->hasParseErrors())
338 std::vector<unsigned char> elems;
339 elems.reserve(totalByteSize);
341 for (
size_t col = 0; col < (size_t)i->getCols(); ++col)
343 for (
size_t row = 0; row < (size_t)i->getRows(); ++row)
346 auto parsed = matrixWidget->parseElement(row, col);
348 elems.insert(elems.end(), parsed.begin(), parsed.end());
351 createdMatrix->setData(totalByteSize, elems.data());
358 auto createdQuat = std::make_shared<aron::data::NDArray>(i->getPath());
360 int dataSize = i->getElementType() == aron::type::quaternion::ElementType::FLOAT32 ? 4 : 8;
361 createdQuat->setShape({1, 4, dataSize});
362 createdQuat->setType(i->getFullName());
365 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
368 if (el->checkState(1) == Qt::CheckState::Unchecked)
375 auto* itemWidget = el->treeWidget()->itemWidget(el, 1);
379 handleErrors(quatWidget->hasParseErrors());
380 if (quatWidget->hasParseErrors())
386 auto serialized = quatWidget->parseAllToNDArray();
387 if ((
int)serialized.size() != dataSize * 4)
390 <<
"serialized quaternions did not return byte sequence of correct length!";
392 createdQuat->setData(serialized.size(), serialized.data());
442 auto createdAronInt = std::make_shared<aron::data::Int>(i->getPath());
446 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
449 if (el->checkState(1) == Qt::CheckState::Unchecked)
456 std::string
str = el->text(1).toStdString();
459 createdAronInt->setValue(0);
464 int val = simox::alg::to_<int>(
str);
465 createdAronInt->setValue(val);
467 catch (
const simox::error::SimoxError& err)
470 ARMARX_VERBOSE <<
"Conversion from String to Int failed. Error:\"" << err.what()
481 auto createdAronLong = std::make_shared<aron::data::Long>(i->getPath());
485 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
488 if (el->checkState(1) == Qt::CheckState::Unchecked)
495 std::string
str = el->text(1).toStdString();
499 str = el->text(3).toStdString();
503 createdAronLong->setValue(simox::alg::to_<long>(
str));
505 catch (
const simox::error::SimoxError& err)
508 ARMARX_VERBOSE <<
"Conversion from String to Long failed. Error:\"" << err.what()
519 auto createdAronFloat = std::make_shared<aron::data::Float>(i->getPath());
523 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
526 if (el->checkState(1) == Qt::CheckState::Unchecked)
533 std::string
str = el->text(1).toStdString();
536 str = el->text(3).toStdString();
540 createdAronFloat->setValue(simox::alg::to_<float>(
str));
542 catch (
const simox::error::SimoxError& err)
545 ARMARX_VERBOSE <<
"Conversion from String to Float failed. Error:\"" << err.what()
556 auto createdAronDouble = std::make_shared<aron::data::Double>(i->getPath());
560 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
563 if (el->checkState(1) == Qt::CheckState::Unchecked)
570 std::string
str = el->text(1).toStdString();
573 str = el->text(3).toStdString();
577 createdAronDouble->setValue(simox::alg::to_<double>(
str));
579 catch (
const simox::error::SimoxError& err)
582 ARMARX_VERBOSE <<
"Conversion from String to Double failed. Error:\"" << err.what()
593 auto createdAronBool = std::make_shared<aron::data::Bool>(i->getPath());
597 if (i->getMaybe() != armarx::aron::type::Maybe::NONE)
600 if (el->checkState(1) == Qt::CheckState::Unchecked)
607 std::string
str = el->text(1).toStdString();
610 str = el->text(3).toStdString();
614 createdAronBool->setValue(simox::alg::to_<bool>(
str));
616 catch (
const simox::error::SimoxError& err)
619 ARMARX_VERBOSE <<
"Conversion from String to Bool failed. Error:\"" << err.what()