diff --git a/etc/cmake/ArmarXPackageVersion.cmake b/etc/cmake/ArmarXPackageVersion.cmake index c007ba34e901f3f35aeb3f10441145dbeb5a1f9c..855fc4134baf23365fbd04ad5674dabd14b4a1e2 100644 --- a/etc/cmake/ArmarXPackageVersion.cmake +++ b/etc/cmake/ArmarXPackageVersion.cmake @@ -1,7 +1,7 @@ # armarx version file set(ARMARX_PACKAGE_LIBRARY_VERSION_MAJOR "0") set(ARMARX_PACKAGE_LIBRARY_VERSION_MINOR "9") -set(ARMARX_PACKAGE_LIBRARY_VERSION_PATCH "1") +set(ARMARX_PACKAGE_LIBRARY_VERSION_PATCH "2") set(ARMARX_PACKAGE_LIBRARY_VERSION "${ARMARX_PACKAGE_LIBRARY_VERSION_MAJOR}.${ARMARX_PACKAGE_LIBRARY_VERSION_MINOR}.${ARMARX_PACKAGE_LIBRARY_VERSION_PATCH}") diff --git a/source/ArmarXGui/applications/ArmarXGui/ArmarXGuiApp.cpp b/source/ArmarXGui/applications/ArmarXGui/ArmarXGuiApp.cpp index 8e09cdae587772c7bd1a9c043fe7e7b952a949ae..a42b1aa99bc58a05541dc1429ad607d2965e785d 100644 --- a/source/ArmarXGui/applications/ArmarXGui/ArmarXGuiApp.cpp +++ b/source/ArmarXGui/applications/ArmarXGui/ArmarXGuiApp.cpp @@ -26,6 +26,7 @@ #include <QListWidget> #include <QMessageBox> #include <QTime> +#include <QTextCodec> #include <iostream> using namespace armarx; @@ -40,6 +41,8 @@ ArmarXGuiApp::ArmarXGuiApp(int& argc, char** argv) : this->argv = 0; qApplication = new ArmarXQApplication(argc, argv); + // Set text encoding to UTF-8 (otherwise, umlauts display wrongly in, e.g., the log viewer) + QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8")); } ArmarXGuiApp::~ArmarXGuiApp() diff --git a/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.cpp b/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.cpp index e2df55dcfbbb813b375e8b71a7f1b14ef727d5ff..a5af14d370207fa1bdadc61fbf58fd646ede1188 100644 --- a/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.cpp +++ b/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.cpp @@ -204,6 +204,21 @@ std::string JPathNavigator::asString() const return asValue()->asString(); } +float JPathNavigator::stof(const std::string& input) { + std::stringstream ss; + float result; + //static std::locale uselocale("en_US"); + ss.imbue(std::locale::classic()); + ss << input; + ss >> result; + return result; +} + +float JPathNavigator::asFloat() const +{ + return stof(asValue()->rawValue()); +} + JsonDataPtr JPathNavigator::getData() const { checkValid(); diff --git a/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.h b/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.h index 66f13d212a3760706342e07a32386f25a4827bf5..b8da42b8e059cc4a524cf38d69bf3e86e52646fa 100644 --- a/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.h +++ b/source/ArmarXGui/libraries/StructuralJson/JPathNavigator.h @@ -63,11 +63,13 @@ namespace armarx JsonValuePtr asValue() const; std::string asString() const; + float asFloat() const; JsonDataPtr getData() const; int getIndex() const; std::string getKey() const; + static float stof(const std::string& input); private: JsonDataPtr data; diff --git a/source/ArmarXGui/libraries/StructuralJson/SimpleLexer.cpp b/source/ArmarXGui/libraries/StructuralJson/SimpleLexer.cpp index 0cd80f8bbcc61b80a2d436bb47df4d9e4a7b956e..45f97d069eca6ff5b8c60118ed8bd4b06e19cbcd 100644 --- a/source/ArmarXGui/libraries/StructuralJson/SimpleLexer.cpp +++ b/source/ArmarXGui/libraries/StructuralJson/SimpleLexer.cpp @@ -46,7 +46,7 @@ int SimpleLexer::nextToken() return currentTokenId; } - for (Rule rule : rules) + for (const Rule& rule : rules) { boost::cmatch result;