1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-04 16:02:51 +01:00

fix(positioner-indicator): fix property setters for position indicator

This commit is contained in:
2025-04-23 14:00:06 +02:00
parent 7c303d0129
commit 1910993b2b
2 changed files with 39 additions and 3 deletions

View File

@@ -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

View File

@@ -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()