From 6d5d67949ed929465f7e8ced37dfce4682c35c42 Mon Sep 17 00:00:00 2001 From: Arnaud TANGUY Date: Tue, 16 Mar 2021 13:50:18 +0900 Subject: [PATCH 1/2] [panel] Recurcursively resolve allOf property --- mc_rtc_rviz_panel/src/Schema.cpp | 17 +++++++++++++---- mc_rtc_rviz_panel/src/Schema.h | 4 ++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/mc_rtc_rviz_panel/src/Schema.cpp b/mc_rtc_rviz_panel/src/Schema.cpp index 0b206ee..332d522 100644 --- a/mc_rtc_rviz_panel/src/Schema.cpp +++ b/mc_rtc_rviz_panel/src/Schema.cpp @@ -47,7 +47,7 @@ Schema::Schema(const std::vector & schemas) }; } -Schema::Schema(const mc_rtc::Configuration & s, const std::string & source, const std::string & title, bool required_in) +mc_rtc::Configuration Schema::resolveAllOf(const mc_rtc::Configuration & s, const std::string & source) const { if(s.has("allOf")) { @@ -57,7 +57,11 @@ Schema::Schema(const mc_rtc::Configuration & s, const std::string & source, cons auto si = s("allOf")[i]; if(si.has("$ref")) { - schema.load(mc_rtc::Configuration{ref_path(source, si("$ref"))}); + schema.load(resolveAllOf(mc_rtc::Configuration{ref_path(source, si("$ref"))}, source)); + } + else if(si.has("allOf")) + { + schema.load(resolveAllOf(si, source)); } else { @@ -65,14 +69,19 @@ Schema::Schema(const mc_rtc::Configuration & s, const std::string & source, cons } } schema.remove("allOf"); - init(schema, source, title, required_in); + return schema; } else { - init(s, source, title, required_in); + return s; } } +Schema::Schema(const mc_rtc::Configuration & s, const std::string & source, const std::string & title, bool required_in) +{ + init(resolveAllOf(s, source), source, title, required_in); +} + void Schema::init(const mc_rtc::Configuration & s, const std::string & source, const std::string & title, diff --git a/mc_rtc_rviz_panel/src/Schema.h b/mc_rtc_rviz_panel/src/Schema.h index e76f629..c2f691e 100644 --- a/mc_rtc_rviz_panel/src/Schema.h +++ b/mc_rtc_rviz_panel/src/Schema.h @@ -62,6 +62,10 @@ struct Schema static SchemaStore & store(); +private: + /** Recursively resolve allOf property */ + mc_rtc::Configuration resolveAllOf(const mc_rtc::Configuration & s, const std::string & source) const; + private: std::string title_; bool is_object_ = false; From 9cdbbe7c11d0de672fa061001f1888d214e53285 Mon Sep 17 00:00:00 2001 From: Arnaud TANGUY Date: Wed, 17 Mar 2021 22:06:53 +0900 Subject: [PATCH 2/2] [ci] Make sure to install qt5 on MacOS --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8baaec0..681d848 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,7 +84,7 @@ jobs: run: | export PATH=/usr/local/opt/qt/bin:$PATH echo "PATH=${PATH}" >> $GITHUB_ENV - export CMAKE_PREFIX_PATH=/usr/local/opt/qt:${CMAKE_PREFIX_PATH} + export CMAKE_PREFIX_PATH=/usr/local/opt/qt@5:${CMAKE_PREFIX_PATH} echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV - name: Install dependencies uses: jrl-umi3218/github-actions/install-dependencies@master @@ -94,7 +94,7 @@ jobs: ubuntu: | apt: cython cython3 python-nose python3-nose python-numpy python3-numpy python-coverage python3-coverage python-setuptools python3-setuptools libeigen3-dev doxygen doxygen-latex libboost-all-dev libtinyxml2-dev libgeos++-dev libnanomsg-dev libyaml-cpp-dev libltdl-dev qt5-default libqwt-qt5-dev macos: | - brew: eigen boost tinyxml2 geos nanomsg yaml-cpp pkg-config libtool qt qwt gcc + brew: eigen boost tinyxml2 geos nanomsg yaml-cpp pkg-config libtool qt5 qwt gcc pip: Cython coverage nose numpy github: - path: jrl-umi3218/mc_rtc_data