Skip to content
Snippets Groups Projects

Merge of all branches of Fabian PK (related to skills)

Merged Fabian Tërnava requested to merge test/merge-branch-skills-to-master into master
7 files
+ 319
147
Compare changes
  • Side-by-side
  • Inline
Files
7
  • 3a5d0a2d
    - finally got clang-format again. (imo made the documents worse though)
    - implement callback on changed items in the gui. Attempt to convert them
    to aron types. If that fails, the element gets colored red.
@@ -27,13 +27,19 @@
// armarx
#include <ArmarXCore/core/logging/Logging.h>
#include <SimoxUtility/algorithm/string.h>
// qt
#include <QTreeWidgetItem>
namespace armarx
{
void
bool AronTreeWidgetConverterVisitor::isConversionSuccessful()
{
return !errorOccured;
}
void
AronTreeWidgetConverterVisitor::visitAronVariant(const aron::type::ObjectPtr& i)
{
auto createdAronDict = std::make_shared<aron::data::Dict>(i->getPath());
@@ -147,9 +153,14 @@ namespace armarx
createdAronInt->setValue(0);
return;
}
try {
int val = simox::alg::to_<int>(str);
createdAronInt->setValue(val);
} catch (const simox::error::SimoxError& err) {
errorOccured = true;
ARMARX_VERBOSE << "Conversion from String to Int failed. Error:\"" << err.what() <<"\"";
}
int val = std::stoi(str);
createdAronInt->setValue(val);
}
void
@@ -164,8 +175,12 @@ namespace armarx
{
str = el->text(3).toStdString();
}
createdAronLong->fromString(str);
try{
createdAronLong->setValue(simox::alg::to_<long>(str));
} catch (const simox::error::SimoxError& err) {
errorOccured = true;
ARMARX_VERBOSE << "Conversion from String to Long failed. Error:\"" << err.what() <<"\"";
}
}
void
@@ -180,8 +195,12 @@ namespace armarx
{
str = el->text(3).toStdString();
}
createdAronFloat->fromString(str);
try{
createdAronFloat->setValue(simox::alg::to_<float>(str));
} catch (const simox::error::SimoxError& err) {
errorOccured = true;
ARMARX_VERBOSE << "Conversion from String to Float failed. Error:\"" << err.what() <<"\"";
}
}
void
@@ -196,8 +215,12 @@ namespace armarx
{
str = el->text(3).toStdString();
}
createdAronDouble->fromString(str);
try{
createdAronDouble->setValue(simox::alg::to_<double>(str));
} catch (const simox::error::SimoxError& err) {
errorOccured = true;
ARMARX_VERBOSE << "Conversion from String to Double failed. Error:\"" << err.what() <<"\"";
}
}
void
@@ -212,8 +235,12 @@ namespace armarx
{
str = el->text(3).toStdString();
}
createdAronBool->fromString(str);
try{
createdAronBool->setValue(simox::alg::to_<bool>(str));
} catch (const simox::error::SimoxError& err) {
errorOccured = true;
ARMARX_VERBOSE << "Conversion from String to Bool failed. Error:\"" << err.what() <<"\"";
}
}
void
@@ -224,7 +251,7 @@ namespace armarx
QTreeWidgetItem* el = parentItem->child(index);
std::string str = el->text(1).toStdString();
createdAronString->fromString(str);
createdAronString->setValue(str);
}
void AronTreeWidgetConverterVisitor::visitUnknown(Input&)
Loading