From f80c35294a18771bbd3d4c60785e821321c7816a Mon Sep 17 00:00:00 2001 From: Kotakku Date: Wed, 28 Jun 2023 09:26:45 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E7=A7=BB=E5=8B=95=E4=B8=AD=E3=82=82?= =?UTF-8?q?=E6=8F=8F=E7=94=BB=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsk_rviz_plugins/src/linear_gauge_display.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsk_rviz_plugins/src/linear_gauge_display.cpp b/jsk_rviz_plugins/src/linear_gauge_display.cpp index b52d573d..1deae76e 100644 --- a/jsk_rviz_plugins/src/linear_gauge_display.cpp +++ b/jsk_rviz_plugins/src/linear_gauge_display.cpp @@ -433,8 +433,8 @@ bool LinearGaugeDisplay::isInRegion(int x, int y) void LinearGaugeDisplay::movePosition(int x, int y) { - top_ = y; - left_ = x; + top_property_->setValue(y); + left_property_->setValue(x); } void LinearGaugeDisplay::setPosition(int x, int y) From c27ce2ddcd6ee0cd43fd0fe4e88916ec749189de Mon Sep 17 00:00:00 2001 From: Kotakku Date: Wed, 28 Jun 2023 10:55:31 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E3=83=89=E3=83=A9=E3=83=83=E3=82=B0?= =?UTF-8?q?=E4=B8=AD=E3=82=82=E6=8F=8F=E7=94=BB=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsk_rviz_plugins/src/pie_chart_display.cpp | 73 ++++++++++++++++++---- 1 file changed, 60 insertions(+), 13 deletions(-) diff --git a/jsk_rviz_plugins/src/pie_chart_display.cpp b/jsk_rviz_plugins/src/pie_chart_display.cpp index 3ab531fd..032e1e42 100644 --- a/jsk_rviz_plugins/src/pie_chart_display.cpp +++ b/jsk_rviz_plugins/src/pie_chart_display.cpp @@ -260,23 +260,59 @@ void PieChartDisplay::updateSize() mutex_.unlock(); } -void PieChartDisplay::updateTop() { top_ = top_property_->getInt(); } +void PieChartDisplay::updateTop() +{ + top_ = top_property_->getInt(); + update_required_ = true; +} -void PieChartDisplay::updateLeft() { left_ = left_property_->getInt(); } +void PieChartDisplay::updateLeft() +{ + left_ = left_property_->getInt(); + update_required_ = true; +} -void PieChartDisplay::updateBGColor() { bg_color_ = bg_color_property_->getColor(); } +void PieChartDisplay::updateBGColor() +{ + bg_color_ = bg_color_property_->getColor(); + update_required_ = true; +} -void PieChartDisplay::updateFGColor() { fg_color_ = fg_color_property_->getColor(); } +void PieChartDisplay::updateFGColor() +{ + fg_color_ = fg_color_property_->getColor(); + update_required_ = true; +} -void PieChartDisplay::updateFGAlpha() { fg_alpha_ = fg_alpha_property_->getFloat() * 255.0; } +void PieChartDisplay::updateFGAlpha() +{ + fg_alpha_ = fg_alpha_property_->getFloat() * 255.0; + update_required_ = true; +} -void PieChartDisplay::updateFGAlpha2() { fg_alpha2_ = fg_alpha2_property_->getFloat() * 255.0; } +void PieChartDisplay::updateFGAlpha2() +{ + fg_alpha2_ = fg_alpha2_property_->getFloat() * 255.0; + update_required_ = true; +} -void PieChartDisplay::updateBGAlpha() { bg_alpha_ = bg_alpha_property_->getFloat() * 255.0; } +void PieChartDisplay::updateBGAlpha() +{ + bg_alpha_ = bg_alpha_property_->getFloat() * 255.0; + update_required_ = true; +} -void PieChartDisplay::updateMinValue() { min_value_ = min_value_property_->getFloat(); } +void PieChartDisplay::updateMinValue() +{ + min_value_ = min_value_property_->getFloat(); + update_required_ = true; +} -void PieChartDisplay::updateMaxValue() { max_value_ = max_value_property_->getFloat(); } +void PieChartDisplay::updateMaxValue() +{ + max_value_ = max_value_property_->getFloat(); + update_required_ = true; +} void PieChartDisplay::updateTextSize() { @@ -287,9 +323,14 @@ void PieChartDisplay::updateTextSize() font.setPointSize(text_size_); caption_offset_ = QFontMetrics(font).height(); mutex_.unlock(); + update_required_ = true; } -void PieChartDisplay::updateShowCaption() { show_caption_ = show_caption_property_->getBool(); } +void PieChartDisplay::updateShowCaption() +{ + show_caption_ = show_caption_property_->getBool(); + update_required_ = true; +} void PieChartDisplay::updateTopic() { @@ -305,13 +346,19 @@ void PieChartDisplay::updateAutoColorChange() } else { max_color_property_->hide(); } + update_required_ = true; } -void PieChartDisplay::updateMaxColor() { max_color_ = max_color_property_->getColor(); } +void PieChartDisplay::updateMaxColor() +{ + max_color_ = max_color_property_->getColor(); + update_required_ = true; +} void PieChartDisplay::updateClockwiseRotate() { clockwise_rotate_ = clockwise_rotate_property_->getBool(); + update_required_ = true; } bool PieChartDisplay::isInRegion(int x, int y) @@ -321,8 +368,8 @@ bool PieChartDisplay::isInRegion(int x, int y) void PieChartDisplay::movePosition(int x, int y) { - top_ = y; - left_ = x; + top_property_->setValue(y); + left_property_->setValue(x); } void PieChartDisplay::setPosition(int x, int y) From 5273a54268fbf2d527598ff7257af65b9cb821d3 Mon Sep 17 00:00:00 2001 From: Kotakku Date: Wed, 28 Jun 2023 10:55:52 +0900 Subject: [PATCH 3/5] =?UTF-8?q?StringDisplay=E3=82=82=E7=A7=BB=E5=8B=95?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsk_rviz_plugins/src/overlay_picker_tool.cpp | 7 +++++++ jsk_rviz_plugins/src/string_display.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/jsk_rviz_plugins/src/overlay_picker_tool.cpp b/jsk_rviz_plugins/src/overlay_picker_tool.cpp index 653c5f66..196d9ab5 100644 --- a/jsk_rviz_plugins/src/overlay_picker_tool.cpp +++ b/jsk_rviz_plugins/src/overlay_picker_tool.cpp @@ -53,6 +53,7 @@ #include "overlay_text_display.hpp" #include "pie_chart_display.hpp" #include "plotter_2d_display.hpp" +#include "string_display.hpp" #include "rviz_utils.hpp" namespace jsk_rviz_plugins @@ -101,6 +102,8 @@ bool OverlayPickerTool::handleDisplayClick( } else { if (startMovement(property, event, "overlay_text_display")) { return true; + } else if (startMovement(property, event, "string_display")) { + return true; } else if (startMovement(property, event, "plotter_2d_display")) { return true; } else if (startMovement(property, event, "pie_chart_display")) { @@ -139,6 +142,8 @@ void OverlayPickerTool::onMove(rviz_common::ViewportMouseEvent & event) if (target_property_) { if (target_property_type_ == "overlay_text_display") { movePosition(event); + } else if (target_property_type_ == "string_display") { + movePosition(event); } else if (target_property_type_ == "plotter_2d_display") { movePosition(event); } else if (target_property_type_ == "pie_chart_display") { @@ -163,6 +168,8 @@ void OverlayPickerTool::onRelease(rviz_common::ViewportMouseEvent & event) if (target_property_) { if (target_property_type_ == "overlay_text_display") { setPosition(event); + } else if (target_property_type_ == "string_display") { + setPosition(event); } else if (target_property_type_ == "plotter_2d_display") { setPosition(event); } else if (target_property_type_ == "pie_chart_display") { diff --git a/jsk_rviz_plugins/src/string_display.cpp b/jsk_rviz_plugins/src/string_display.cpp index 07c1219e..e858c398 100644 --- a/jsk_rviz_plugins/src/string_display.cpp +++ b/jsk_rviz_plugins/src/string_display.cpp @@ -428,8 +428,8 @@ bool StringDisplay::isInRegion(int x, int y) void StringDisplay::movePosition(int x, int y) { - top_ = y; - left_ = x; + top_property_->setValue(y); + left_property_->setValue(x); } void StringDisplay::setPosition(int x, int y) From 6d56d0bcc56541a618f16b67eb17ff65d5c5ec6b Mon Sep 17 00:00:00 2001 From: Kotakku Date: Wed, 28 Jun 2023 10:56:41 +0900 Subject: [PATCH 4/5] =?UTF-8?q?rviz=E3=81=A7=E8=BF=BD=E5=8A=A0=E3=81=99?= =?UTF-8?q?=E3=82=8B=E6=99=82=E3=81=ABBy=20topic=E3=81=A7=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jsk_rviz_plugins/plugins_description.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/jsk_rviz_plugins/plugins_description.xml b/jsk_rviz_plugins/plugins_description.xml index 7c28cf0a..a511b5bc 100644 --- a/jsk_rviz_plugins/plugins_description.xml +++ b/jsk_rviz_plugins/plugins_description.xml @@ -61,18 +61,18 @@ type="jsk_rviz_plugins::PictogramArrayDisplay" base_class_type="rviz_common::Display"> - visualize jsk_rviz_plugins/msg/PictogramArray + visualize jsk_rviz_plugin_msgs/msg/PictogramArray - jsk_rviz_plugins/msg/PictogramArray + jsk_rviz_plugin_msgs/msg/PictogramArray - visualize jsk_rviz_plugins/msg/Pictogram + visualize jsk_rviz_plugin_msgs/msg/Pictogram - jsk_rviz_plugins/msg/Pictogram + jsk_rviz_plugin_msgs/msg/Pictogram @@ -184,7 +184,7 @@ Displays text as overlay - jsk_rviz_plugins/msg/OverlayText + jsk_rviz_plugin_msgs/msg/OverlayText Displays menu as overlay - jsk_rviz_plugins/msg/OverlayMenu + jsk_rviz_plugin_msgs/msg/OverlayMenu Date: Wed, 28 Jun 2023 11:27:35 +0900 Subject: [PATCH 5/5] clang_format --- jsk_rviz_plugins/src/overlay_picker_tool.cpp | 2 +- jsk_rviz_plugins/src/pie_chart_display.cpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/jsk_rviz_plugins/src/overlay_picker_tool.cpp b/jsk_rviz_plugins/src/overlay_picker_tool.cpp index 196d9ab5..3a79ea1d 100644 --- a/jsk_rviz_plugins/src/overlay_picker_tool.cpp +++ b/jsk_rviz_plugins/src/overlay_picker_tool.cpp @@ -53,8 +53,8 @@ #include "overlay_text_display.hpp" #include "pie_chart_display.hpp" #include "plotter_2d_display.hpp" -#include "string_display.hpp" #include "rviz_utils.hpp" +#include "string_display.hpp" namespace jsk_rviz_plugins { diff --git a/jsk_rviz_plugins/src/pie_chart_display.cpp b/jsk_rviz_plugins/src/pie_chart_display.cpp index 032e1e42..24a4b2fc 100644 --- a/jsk_rviz_plugins/src/pie_chart_display.cpp +++ b/jsk_rviz_plugins/src/pie_chart_display.cpp @@ -260,43 +260,43 @@ void PieChartDisplay::updateSize() mutex_.unlock(); } -void PieChartDisplay::updateTop() +void PieChartDisplay::updateTop() { top_ = top_property_->getInt(); update_required_ = true; } -void PieChartDisplay::updateLeft() +void PieChartDisplay::updateLeft() { left_ = left_property_->getInt(); update_required_ = true; } -void PieChartDisplay::updateBGColor() +void PieChartDisplay::updateBGColor() { bg_color_ = bg_color_property_->getColor(); update_required_ = true; } -void PieChartDisplay::updateFGColor() +void PieChartDisplay::updateFGColor() { fg_color_ = fg_color_property_->getColor(); update_required_ = true; } -void PieChartDisplay::updateFGAlpha() +void PieChartDisplay::updateFGAlpha() { fg_alpha_ = fg_alpha_property_->getFloat() * 255.0; update_required_ = true; } -void PieChartDisplay::updateFGAlpha2() +void PieChartDisplay::updateFGAlpha2() { fg_alpha2_ = fg_alpha2_property_->getFloat() * 255.0; update_required_ = true; } -void PieChartDisplay::updateBGAlpha() +void PieChartDisplay::updateBGAlpha() { bg_alpha_ = bg_alpha_property_->getFloat() * 255.0; update_required_ = true; @@ -308,11 +308,11 @@ void PieChartDisplay::updateMinValue() update_required_ = true; } -void PieChartDisplay::updateMaxValue() +void PieChartDisplay::updateMaxValue() { max_value_ = max_value_property_->getFloat(); update_required_ = true; -} +} void PieChartDisplay::updateTextSize() { @@ -326,7 +326,7 @@ void PieChartDisplay::updateTextSize() update_required_ = true; } -void PieChartDisplay::updateShowCaption() +void PieChartDisplay::updateShowCaption() { show_caption_ = show_caption_property_->getBool(); update_required_ = true;