diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/TODO b/source/RobotAPI/gui-plugins/SkillManagerPlugin/TODO index e2714bf266c35813293f5c480f4bb5ca15a2f774..d25aead078c039b5724f9a6f05abe669ed1caf50 100644 --- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/TODO +++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/TODO @@ -1,8 +1,3 @@ -- Print correct precision to keep information of default arguments (TreeWidgetSetter) -- support other bases in simox value parsing? -- int enum dropdown menu -- conversion of quaternions (Setter) -- debug ceation & handling of bool +- keep set values around to not loose precision of values that have not been manipulated (in AronTreeWidgetItem, as well as Matrix and Quaternion) - get rid of any todos present -- precision info in type column for matrix and quat -- prepare library? + diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp b/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp index e08feaa854d51acccf7439c9c2ff04c393958907..3eeee694bfee28470d31cf03f51b77145aaa124e 100644 --- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp +++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetConverter.cpp @@ -64,7 +64,6 @@ namespace armarx AronTreeWidgetConverterVisitor::handleErrors(AronTreeWidgetConverterVisitor childV, bool ownFault) { - // TODO debug this. Make target back to debugabble isDirectError |= ownFault; hasTransitiveError |= childV.isDirectError || childV.hasTransitiveError; @@ -117,7 +116,7 @@ namespace armarx AronTreeWidgetConverterVisitor v(el, x); aron::type::visit(v, i->getAcceptedType()); auto key = it->text(0).toStdString(); - // TODO: handle key errors more elegantly / separately + // TODO: handle key errors more elegantly / separately, fine for now handleErrors(v, createdAronDict->hasElement(key)); if (v.createdAron && v.isConversionSuccessful() && !createdAronDict->hasElement(key)) { diff --git a/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetCreator.cpp b/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetCreator.cpp index ccc80db3c712b28846419b56c503a0ae9e069f2f..84cb58585e3b4e7f3a058db66f3b5f3a40f54aea 100644 --- a/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetCreator.cpp +++ b/source/RobotAPI/gui-plugins/SkillManagerPlugin/aronTreeWidget/visitors/AronTreeWidgetCreator.cpp @@ -189,7 +189,6 @@ namespace armarx AronTreeWidgetCreatorVisitor::visitAronVariant(const aron::type::ListPtr& i) { insertNewTreeViewWidget(i, ""); - // TODO: Move to external helper class auto txt = misc::generateNumElementsText(0); createdQWidgetItem->setText(1, txt); } @@ -204,7 +203,28 @@ namespace armarx { editableValue = false; insertNewTreeViewWidget(i, ""); - // TODO add size and type info to 2nd column manually here + // special code to print the type of base type used + QString type = ""; + switch (i->getElementType()) + { + case armarx::aron::type::matrix::INT16: + type = "<int16>"; + break; + case armarx::aron::type::matrix::INT32: + type = "<int32>"; + break; + case armarx::aron::type::matrix::INT64: + type = "<int64>"; + break; + case armarx::aron::type::matrix::FLOAT32: + type = "<float>"; + break; + case armarx::aron::type::matrix::FLOAT64: + type = "<double>"; + break; + } + type = createdQWidgetItem->text(2) + type; + createdQWidgetItem->setText(2, type); // Widget fiddling source: https://blog.manash.io/quick-qt-6-how-to-add-qpushbutton-or-widgets-to-a-qtreewidget-as-qtreewidgetitem-2ae9f54c0e5f // overlay custom widget in column 1 @@ -218,6 +238,20 @@ namespace armarx { editableValue = false; insertNewTreeViewWidget(i, ""); + // special code to print the type of base type used + QString type = ""; + switch (i->getElementType()) + { + case armarx::aron::type::quaternion::FLOAT32: + type = "<float>"; + break; + case armarx::aron::type::quaternion::FLOAT64: + type = "<double>"; + break; + } + type = createdQWidgetItem->text(2) + type; + createdQWidgetItem->setText(2, type); + auto* toplevelWidget = createdQWidgetItem->treeWidget(); QuaternionWidget* quatWidget = new QuaternionWidget(i->getElementType(), createdQWidgetItem); @@ -241,9 +275,7 @@ namespace armarx ARMARX_CHECK_GREATER(i->getAcceptedValueNames().size(), 0); insertNewTreeViewWidget(i, ""); - // TODO set combobox widget with correct content IntEnumWidget* widget = new IntEnumWidget(i, createdQWidgetItem); - //widget->postCtorCall(); createdQWidgetItem->treeWidget()->setItemWidget(createdQWidgetItem, 1, widget); } void