mirror of
https://github.com/bec-project/bec_widgets.git
synced 2025-07-14 03:31:50 +02:00
feat(auto_updates): enforce rpc widget class for subclasses of auto updates
This commit is contained in:
@ -216,10 +216,14 @@ class RPCServer:
|
|||||||
while not self.rpc_register.object_is_registered(connector):
|
while not self.rpc_register.object_is_registered(connector):
|
||||||
QApplication.processEvents()
|
QApplication.processEvents()
|
||||||
|
|
||||||
|
widget_class = getattr(connector, "rpc_widget_class", None)
|
||||||
|
if not widget_class:
|
||||||
|
widget_class = connector.__class__.__name__
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"gui_id": connector.gui_id,
|
"gui_id": connector.gui_id,
|
||||||
"object_name": connector.object_name or connector.__class__.__name__,
|
"object_name": connector.object_name or connector.__class__.__name__,
|
||||||
"widget_class": connector.__class__.__name__,
|
"widget_class": widget_class,
|
||||||
"config": config_dict,
|
"config": config_dict,
|
||||||
"__rpc__": True,
|
"__rpc__": True,
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,9 @@ class AutoUpdates(BECMainWindow):
|
|||||||
USER_ACCESS = ["enabled", "enabled.setter", "selected_device", "selected_device.setter"]
|
USER_ACCESS = ["enabled", "enabled.setter", "selected_device", "selected_device.setter"]
|
||||||
RPC = True
|
RPC = True
|
||||||
|
|
||||||
|
# enforce that subclasses have the same rpc widget class
|
||||||
|
rpc_widget_class = "AutoUpdates"
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, parent=None, gui_id: str = None, window_title="Auto Update", *args, **kwargs
|
self, parent=None, gui_id: str = None, window_title="Auto Update", *args, **kwargs
|
||||||
):
|
):
|
||||||
|
Reference in New Issue
Block a user