diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 990d40e3..0ac3ea83 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -13,6 +13,7 @@ class Widgets(str, enum.Enum): Enum for the available widgets. """ + BECStatusBox = "BECStatusBox" BECDock = "BECDock" BECDockArea = "BECDockArea" BECFigure = "BECFigure" @@ -1388,6 +1389,24 @@ class BECPlotBase(RPCBase): """ +class BECStatusBox(RPCBase): + @property + @rpc_call + def config_dict(self) -> "dict": + """ + Get the configuration of the widget. + + Returns: + dict: The configuration of the widget. + """ + + @rpc_call + def get_all_rpc(self) -> "dict": + """ + Get all registered RPC objects. + """ + + class BECWaveform(RPCBase): @property @rpc_call @@ -1649,6 +1668,60 @@ class BECWaveform(RPCBase): """ +class DeviceComboBox(RPCBase): + @property + @rpc_call + def config_dict(self) -> "dict": + """ + Get the configuration of the widget. + + Returns: + dict: The configuration of the widget. + """ + + @rpc_call + def get_all_rpc(self) -> "dict": + """ + Get all registered RPC objects. + """ + + +class DeviceInputBase(RPCBase): + @property + @rpc_call + def config_dict(self) -> "dict": + """ + Get the configuration of the widget. + + Returns: + dict: The configuration of the widget. + """ + + @rpc_call + def get_all_rpc(self) -> "dict": + """ + Get all registered RPC objects. + """ + + +class DeviceLineEdit(RPCBase): + @property + @rpc_call + def config_dict(self) -> "dict": + """ + Get the configuration of the widget. + + Returns: + dict: The configuration of the widget. + """ + + @rpc_call + def get_all_rpc(self) -> "dict": + """ + Get all registered RPC objects. + """ + + class Ring(RPCBase): @rpc_call def get_all_rpc(self) -> "dict": @@ -1950,7 +2023,7 @@ class TextBox(RPCBase): @rpc_call def set_color(self, background_color: str, font_color: str) -> None: """ - Set the background color of the Widget. + Set the background color of the widget. Args: background_color (str): The color to set the background in HEX. @@ -1960,13 +2033,19 @@ class TextBox(RPCBase): @rpc_call def set_text(self, text: str) -> None: """ - Set the text of the Widget + Set the text of the widget. + + Args: + text (str): The text to set. """ @rpc_call def set_font_size(self, size: int) -> None: """ - Set the font size of the text in the Widget. + Set the font size of the text in the widget. + + Args: + size (int): The font size to set. """ diff --git a/docs/user/getting_started/installation.md b/docs/user/getting_started/installation.md index ae20bd50..dd158668 100644 --- a/docs/user/getting_started/installation.md +++ b/docs/user/getting_started/installation.md @@ -13,13 +13,13 @@ To install BEC Widgets using the pip package manager, execute the following comm ```bash -pip install bec_widgets[pyqt6] +pip install 'bec_widgets[pyqt6]' ``` In case you want to use PyQt5, you can install it by using the following command: ```bash -pip install bec_widgets[pyqt5] +pip install 'bec_widgets[pyqt5]' ``` **Troubleshooting** diff --git a/docs/user/widgets/bec_status_box.md b/docs/user/widgets/bec_status_box.md new file mode 100644 index 00000000..087dc37c --- /dev/null +++ b/docs/user/widgets/bec_status_box.md @@ -0,0 +1,30 @@ +(user.widgets.text_box)= +# [BEC Status Box](/api_reference/_autosummary/bec_widgets.cli.client.BECStatusBox) +**Purpose:** + +The BECStatusBox Widget is a widget that allows you to monitor the status/health of the all running BEC processes. The widget generates the view automatically and updates the status of the processes in real-time. The top level indicates the overall state of the BEC core services (DeviceServer, ScanServer, SciHub, ScanBundler and FileWriter), but you can also see the status of each individual process by opening the collapsed view. In the collapsed view, you can double click on each process to get a popup window with live updates of the metrics for each process in real-time. + +**Key Features:** + +- monitor the state of individual BEC services. +- automatically track BEC services, i.e. additional clients connecting. +- live-updates of the metrics for each process. + +**Example of Use:** +![BECStatus](./bec_status_box.gif) + +**Code example:** + +The following code snipped demonstrates how to create a `BECStatusBox` widget using BEC Widgets within BEC. +```python +bec_status_box = gui.add_dock().add_widget("BECStatusBox") +``` + + + + + + + + +