From 1910993b2b3d30ecb8e4977b4a362f46adae3c75 Mon Sep 17 00:00:00 2001 From: appel_c Date: Wed, 23 Apr 2025 14:00:06 +0200 Subject: [PATCH] fix(positioner-indicator): fix property setters for position indicator --- bec_widgets/cli/client.py | 25 +++++++++++++++++-- .../position_indicator/position_indicator.py | 17 ++++++++++++- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index ebd9c5d8..2974bce2 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -2246,6 +2246,13 @@ class PositionIndicator(RPCBase): Property to determine the orientation of the position indicator """ + @vertical.setter + @rpc_call + def vertical(self): + """ + Property to determine the orientation of the position indicator + """ + @property @rpc_call def indicator_width(self): @@ -2253,6 +2260,13 @@ class PositionIndicator(RPCBase): Property to get the width of the indicator """ + @indicator_width.setter + @rpc_call + def indicator_width(self): + """ + Property to get the width of the indicator + """ + @property @rpc_call def rounded_corners(self): @@ -2260,6 +2274,13 @@ class PositionIndicator(RPCBase): Property to get the rounded corners of the position indicator """ + @rounded_corners.setter + @rpc_call + def rounded_corners(self): + """ + Property to get the rounded corners of the position indicator + """ + class PositionerBox(RPCBase): """Simple Widget to control a positioner in box form""" @@ -2469,9 +2490,9 @@ class RingProgressBar(RPCBase): @property @rpc_call - def rings(self): + def rings(self) -> "list[Ring]": """ - None + Returns a list of all rings in the progress bar. """ @rpc_call diff --git a/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py b/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py index d86c9560..01010cc1 100644 --- a/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py +++ b/bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py @@ -12,7 +12,16 @@ class PositionIndicator(BECWidget, QWidget): Display a position within a defined range, e.g. motor limits. """ - USER_ACCESS = ["set_value", "set_range", "vertical", "indicator_width", "rounded_corners"] + USER_ACCESS = [ + "set_value", + "set_range", + "vertical", + "vertical.setter", + "indicator_width", + "indicator_width.setter", + "rounded_corners", + "rounded_corners.setter", + ] PLUGIN = True ICON_NAME = "horizontal_distribute" @@ -209,6 +218,12 @@ class PositionIndicator(BECWidget, QWidget): @Slot(int) @Slot(float) def set_value(self, position: float): + """ + Set the position of the indicator + + Args: + position: The new position of the indicator + """ self.position = position self.update()