From 3ba0b1daf5b83da840e90fbbc063ed7b86ebe99b Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Thu, 21 Nov 2024 12:30:13 +0100 Subject: [PATCH] feat: add rpc_id member to client objects --- bec_widgets/cli/client.py | 106 +++++++++++++++++++++++++++++ bec_widgets/utils/bec_connector.py | 2 +- 2 files changed, 107 insertions(+), 1 deletion(-) diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index bd96e5ee..00753638 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -1403,6 +1403,14 @@ class BECMainWindow(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + + class BECMotorMap(RPCBase): @property @rpc_call @@ -2267,6 +2275,13 @@ class BECQueue(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class BECStatusBox(RPCBase): @property @@ -2285,6 +2300,13 @@ class BECStatusBox(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class BECWaveform(RPCBase): @property @@ -3007,6 +3029,13 @@ class DeviceBrowser(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class DeviceComboBox(RPCBase): @property @@ -3025,6 +3054,13 @@ class DeviceComboBox(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class DeviceInputBase(RPCBase): @property @@ -3043,6 +3079,13 @@ class DeviceInputBase(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class DeviceLineEdit(RPCBase): @property @@ -3061,6 +3104,13 @@ class DeviceLineEdit(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class DeviceSignalInputBase(RPCBase): @property @@ -3079,6 +3129,13 @@ class DeviceSignalInputBase(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class LMFitDialog(RPCBase): @property @@ -3097,6 +3154,13 @@ class LMFitDialog(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class PositionIndicator(RPCBase): @rpc_call @@ -3186,6 +3250,13 @@ class ResetButton(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class ResumeButton(RPCBase): @property @@ -3204,6 +3275,13 @@ class ResumeButton(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class Ring(RPCBase): @rpc_call @@ -3501,6 +3579,13 @@ class ScanControl(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class SignalComboBox(RPCBase): @property @@ -3519,6 +3604,13 @@ class SignalComboBox(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class SignalLineEdit(RPCBase): @property @@ -3537,6 +3629,13 @@ class SignalLineEdit(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class StopButton(RPCBase): @property @@ -3555,6 +3654,13 @@ class StopButton(RPCBase): Get all registered RPC objects. """ + @property + @rpc_call + def _rpc_id(self) -> "str": + """ + Get the RPC ID of the widget. + """ + class TextBox(RPCBase): @rpc_call diff --git a/bec_widgets/utils/bec_connector.py b/bec_widgets/utils/bec_connector.py index a2908c1d..d739c842 100644 --- a/bec_widgets/utils/bec_connector.py +++ b/bec_widgets/utils/bec_connector.py @@ -69,7 +69,7 @@ class Worker(QRunnable): class BECConnector: """Connection mixin class to handle BEC client and device manager""" - USER_ACCESS = ["_config_dict", "_get_all_rpc"] + USER_ACCESS = ["_config_dict", "_get_all_rpc", "_rpc_id"] EXIT_HANDLERS = {} def __init__(self, client=None, config: ConnectionConfig = None, gui_id: str = None):