diff --git a/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp b/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp index ef24a168384785a3d2b78b4d66fe019df50a5524..14fbb8bb3d7312775ffdd9f2adbc1bee41bae56f 100644 --- a/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp +++ b/source/RobotAPI/components/ArViz/Introspection/json_elements.cpp @@ -153,15 +153,14 @@ namespace armarx::viz j["lineColor"] = polygon.lineColor; j[json::meta::KEY]["lineColor"] = json::meta::COLOR; j["lineWidth"] = polygon.lineWidth; - - j["# Points"] = polygon.points.size(); - j[json::meta::KEY]["# Points"] = json::meta::READ_ONLY; + j["points"] = polygon.points; } void data::from_json(const nlohmann::json& j, ElementPolygon& polygon) { json::from_json_base(j, polygon); polygon.lineColor = j.at("lineColor"); polygon.lineWidth = j.at("lineWidth"); + polygon.points = j.at("points").get<std::vector<armarx::Vector3f>>(); } diff --git a/source/RobotAPI/components/RobotState/RobotStateComponent.cpp b/source/RobotAPI/components/RobotState/RobotStateComponent.cpp index 0b0a6785b74c95984886008e17e03bd25e09ab25..52bada6ff48ffdde36652b751b314eb777de2385 100644 --- a/source/RobotAPI/components/RobotState/RobotStateComponent.cpp +++ b/source/RobotAPI/components/RobotState/RobotStateComponent.cpp @@ -343,6 +343,7 @@ namespace armarx { if (_synchronized) { + ARMARX_DEBUG << "Comparing " << _synchronized->getName() << " and " << robotName << "."; if (_synchronized->getName() == robotName) { const IceUtil::Time time = IceUtil::Time::microSeconds(timestamp); diff --git a/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp b/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp index 674945033505ec7b93293be0dade8893880a9b80..6732b5b66028b2c9b1389088a36ead1ae1147093 100644 --- a/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp +++ b/source/RobotAPI/gui-plugins/ArViz/ArVizWidgetController.cpp @@ -114,7 +114,7 @@ namespace armarx { usingProxy(storageName); } - ARMARX_IMPORTANT << "OnInit: " << storageName; + // ARMARX_IMPORTANT << "OnInit: " << storageName; callbackData = new ArVizWidgetBatchCallback(); callbackData->this_ = this; diff --git a/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp b/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp index 9c96d12941c2a9e208fcaa8ec5b8c67258c75e38..fafc526ea282753dc4568e5300995f03f86b2ff7 100644 --- a/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp +++ b/source/RobotAPI/gui-plugins/ArViz/LayerInfoTree.cpp @@ -214,7 +214,29 @@ namespace armarx { if (json.is_array()) { - // Todo + nlohmann::json jmeta = nlohmann::json::object(); + + int iItem = 0; + for (auto j : json) + { + const std::string key = std::to_string(iItem); + + if (iItem >= parent->childCount()) + { + QTreeWidgetItem* item = addJsonChild(parent, key); + updateJsonItem(item, key, j, jmeta, recursive); + } + else // iItem < parent->childCount() + { + QTreeWidgetItem* currentItem = parent->child(iItem); + updateJsonItem(currentItem, key, j, jmeta, recursive); + } + ++iItem; + } + while (parent->childCount() > int(json.size())) + { + parent->removeChild(parent->child(parent->childCount() - 1)); + } } else if (json.is_object()) {