diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index 402bca49..00000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# .readthedocs.yaml -# Read the Docs configuration file -# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details - -# Required -version: 2 - -# Set the version of Python and other tools you might need -build: - os: ubuntu-22.04 - tools: - python: "3.11" - -# Build documentation in the docs/ directory with Sphinx -sphinx: - configuration: docs/conf.py - -# If using Sphinx, optionally build your docs in additional formats such as PDF -# formats: -# - pdf - -# Optionally declare the Python requirements required to build your docs -python: - install: - - requirements: docs/requirements.txt - - method: pip - path: .[dev] diff --git a/docs/Makefile b/docs/Makefile deleted file mode 100644 index d4bb2cbb..00000000 --- a/docs/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/custom.css b/docs/_static/custom.css deleted file mode 100644 index 047e2784..00000000 --- a/docs/_static/custom.css +++ /dev/null @@ -1,170 +0,0 @@ -/* Template Inherited from SciPy and modified for PyQtGraph purposes - https://github.com/scipy/scipy/blob/9ae8fd0f4341d7d8785777d460cca4f7b6a93edd/doc/source/_static/scipy.css - SPDX-License-Identifier: BSD-3-Clause */ - -/* Remove parenthesis around module using fictive font and add them back. - This is needed for better wrapping in the sidebar. */ - .bd-sidebar .nav li > a > code { - white-space: nowrap; - } - - .bd-sidebar .nav li > a > code:before { - content:'('; - } - - .bd-sidebar .nav li > a > code:after { - content:')'; - } - - .bd-sidebar .nav li > a { - font-family: "no-parens", sans-serif; - } - - /* Retrieved from https://codepen.io/jonneal/pen/bXLEdB (MIT) - It replaces (, ) with a zero-width font. This version is lighter than - the original font from Adobe. - */ - @font-face { - font-family: no-parens; - src: url("data:application/x-font-woff;base64,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"); - unicode-range: U+0028, U+0029; - } - - /* Colors from: - - Wong, B. Points of view: Color blindness. - Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618 - */ - - /* If the active version has the name "dev", style it orange */ - #version_switcher_button[data-active-version-name*="dev"] { - background-color: #E69F00; - border-color: #E69F00; - color: white; - } - - /* green for `stable` */ - #version_switcher_button[data-active-version-name*="stable"] { - background-color: #009E73; - border-color: #009E73; - color: white; - } - - /* red for `old` */ - #version_switcher_button:not([data-active-version-name*="stable"]):not([data-active-version-name*="dev"]):not([data-active-version-name*="pull"]) { - background-color: #980F0F; - border-color: #980F0F; - color: white; - } - - /* Main index page overview cards */ - - .index-card .sd-card { - background: #fff; - border-radius: 0; - padding: 30px 10px 20px 10px; - margin: 10px 0px; - } - - .index-card .sd-card-header { - text-align: center; - } - - .index-card .sd-card-header .sd-card-text { - margin: 0px; - } - - .index-card .sd-card-img-top { - height: 52px; - width: 52px; - margin-left: auto; - margin-right: auto; - } - - .index-card .sd-card-header { - border: none; - background-color:white; - color: #150458 !important; - font-size: var(--pst-font-size-h5); - font-weight: bold; - padding: 2.5rem 0rem 0.5rem 0rem; - border-bottom: none !important; - } - - .index-card .sd-card-footer { - border: none; - background-color:white; - border-top: none !important; - } - - .index-card .sd-card-footer .sd-card-text{ - max-width: 220px; - margin-left: auto; - margin-right: auto; - } - - .custom-button { - background-color:#DCDCDC; - border: none; - color: #484848; - text-align: center; - text-decoration: none; - display: inline-block; - font-size: 0.9rem; - border-radius: 0.5rem; - max-width: 120px; - padding: 0.5rem 0rem; - } - - .custom-button a { - color: #484848; - } - - .custom-button p { - margin-top: 0; - margin-bottom: 0rem; - color: #484848; - } - - /* Dark theme tweaking - - Matplotlib images are in png and inverted while other output - types are assumed to be normal images. - - */ - html[data-theme=dark] img[src*='.svg']:not(.only-dark):not(.dark-light) { - filter: brightness(0.8) invert(0.82) contrast(1.2); - background: unset - } - - html[data-theme=dark] .MathJax_SVG * { - fill: var(--pst-color-text-base); - } - - /* Main index page overview cards */ - - html[data-theme=dark] .index-card .sd-card { - background-color:var(--pst-color-background); - border: none - } - - html[data-theme=dark] .sd-shadow-sm { - box-shadow: 0 .1rem 0.5rem rgba(250, 250, 250, .2) !important - } - - html[data-theme=dark] .index-card .sd-card-header { - background-color:var(--pst-color-background); - color: #150458 !important; - } - - html[data-theme=dark] .index-card .sd-card-footer { - background-color:var(--pst-color-background); - } - - /* - Hide TypeAlias Classes - */ - - dt#ColorMapSpecifier { - visibility: hidden; - } \ No newline at end of file diff --git a/docs/_templates/custom-class-template.rst b/docs/_templates/custom-class-template.rst deleted file mode 100644 index d64b80d5..00000000 --- a/docs/_templates/custom-class-template.rst +++ /dev/null @@ -1,34 +0,0 @@ -{{ fullname | escape | underline}} - -.. currentmodule:: {{ module }} - -.. autoclass:: {{ objname }} - :members: - :show-inheritance: - :inherited-members: - :special-members: __call__, __add__, __mul__ - - {% block methods %} - {% if methods %} - .. rubric:: {{ _('Methods') }} - - .. autosummary:: - :nosignatures: - {% for item in methods %} - {%- if not item.startswith('_') %} - ~{{ name }}.{{ item }} - {%- endif -%} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block attributes %} - {% if attributes %} - .. rubric:: {{ _('Attributes') }} - - .. autosummary:: - {% for item in attributes %} - ~{{ name }}.{{ item }} - {%- endfor %} - {% endif %} - {% endblock %} \ No newline at end of file diff --git a/docs/_templates/custom-module-template.rst b/docs/_templates/custom-module-template.rst deleted file mode 100644 index dd90e32e..00000000 --- a/docs/_templates/custom-module-template.rst +++ /dev/null @@ -1,66 +0,0 @@ -{{ fullname | escape | underline}} - -.. automodule:: {{ fullname }} - - {% block attributes %} - {% if attributes %} - .. rubric:: Module attributes - - .. autosummary:: - :toctree: - {% for item in attributes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block functions %} - {% if functions %} - .. rubric:: {{ _('Functions') }} - - .. autosummary:: - :toctree: - :nosignatures: - {% for item in functions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block classes %} - {% if classes %} - .. rubric:: {{ _('Classes') }} - - .. autosummary:: - :toctree: - :template: custom-class-template.rst - :nosignatures: - {% for item in classes %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - - {% block exceptions %} - {% if exceptions %} - .. rubric:: {{ _('Exceptions') }} - - .. autosummary:: - :toctree: - {% for item in exceptions %} - {{ item }} - {%- endfor %} - {% endif %} - {% endblock %} - -{% block modules %} -{% if modules %} -.. autosummary:: - :toctree: - :template: custom-module-template.rst - :recursive: -{% for item in modules %} - {{ item }} -{%- endfor %} -{% endif %} -{% endblock %} \ No newline at end of file diff --git a/docs/api_reference/api_reference.md b/docs/api_reference/api_reference.md deleted file mode 100644 index 567e5150..00000000 --- a/docs/api_reference/api_reference.md +++ /dev/null @@ -1,11 +0,0 @@ -(api_reference)= -# API Reference - -This page contains the auto-generated API documentation for all modules, classes, and functions in the BEC Widgets package. - -```{toctree} -:maxdepth: 2 -:caption: API Documentation - -../autoapi/bec_widgets/index -``` \ No newline at end of file diff --git a/docs/assets/apps_48dp.svg b/docs/assets/apps_48dp.svg deleted file mode 100644 index 20a8f5da..00000000 --- a/docs/assets/apps_48dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/assets/display_settings_48dp.svg b/docs/assets/display_settings_48dp.svg deleted file mode 100644 index b976bb5f..00000000 --- a/docs/assets/display_settings_48dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/assets/index_api.svg b/docs/assets/index_api.svg deleted file mode 100644 index 87013d24..00000000 --- a/docs/assets/index_api.svg +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - diff --git a/docs/assets/index_contribute.svg b/docs/assets/index_contribute.svg deleted file mode 100644 index 399f1d76..00000000 --- a/docs/assets/index_contribute.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/docs/assets/index_getting_started.svg b/docs/assets/index_getting_started.svg deleted file mode 100644 index d1c7b08a..00000000 --- a/docs/assets/index_getting_started.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/docs/assets/index_user_guide.svg b/docs/assets/index_user_guide.svg deleted file mode 100644 index bff24824..00000000 --- a/docs/assets/index_user_guide.svg +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/docs/assets/rocket_launch_48dp.svg b/docs/assets/rocket_launch_48dp.svg deleted file mode 100644 index 1cd031b9..00000000 --- a/docs/assets/rocket_launch_48dp.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/assets/widget_screenshots/bec_progressbar.png b/docs/assets/widget_screenshots/bec_progressbar.png deleted file mode 100644 index 92c4278b..00000000 Binary files a/docs/assets/widget_screenshots/bec_progressbar.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/buttons.png b/docs/assets/widget_screenshots/buttons.png deleted file mode 100644 index 8988ca82..00000000 Binary files a/docs/assets/widget_screenshots/buttons.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/buttons_queue.png b/docs/assets/widget_screenshots/buttons_queue.png deleted file mode 100644 index ca32d91e..00000000 Binary files a/docs/assets/widget_screenshots/buttons_queue.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/dap_combo_box.png b/docs/assets/widget_screenshots/dap_combo_box.png deleted file mode 100644 index 1fa315e6..00000000 Binary files a/docs/assets/widget_screenshots/dap_combo_box.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/device_box.png b/docs/assets/widget_screenshots/device_box.png deleted file mode 100644 index 712ed159..00000000 Binary files a/docs/assets/widget_screenshots/device_box.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/device_browser.png b/docs/assets/widget_screenshots/device_browser.png deleted file mode 100644 index 8ac52d86..00000000 Binary files a/docs/assets/widget_screenshots/device_browser.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/device_inputs.png b/docs/assets/widget_screenshots/device_inputs.png deleted file mode 100644 index 09773197..00000000 Binary files a/docs/assets/widget_screenshots/device_inputs.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/dock_area.png b/docs/assets/widget_screenshots/dock_area.png deleted file mode 100644 index a9e99dc2..00000000 Binary files a/docs/assets/widget_screenshots/dock_area.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/figure.png b/docs/assets/widget_screenshots/figure.png deleted file mode 100644 index 67d0783d..00000000 Binary files a/docs/assets/widget_screenshots/figure.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/heatmap_widget.png b/docs/assets/widget_screenshots/heatmap_widget.png deleted file mode 100644 index cdc46ad2..00000000 Binary files a/docs/assets/widget_screenshots/heatmap_widget.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/image_widget.png b/docs/assets/widget_screenshots/image_widget.png deleted file mode 100644 index 0641d519..00000000 Binary files a/docs/assets/widget_screenshots/image_widget.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/lmfit_dialog.png b/docs/assets/widget_screenshots/lmfit_dialog.png deleted file mode 100644 index 8d097cfc..00000000 Binary files a/docs/assets/widget_screenshots/lmfit_dialog.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/lmfit_dialog_connect.png b/docs/assets/widget_screenshots/lmfit_dialog_connect.png deleted file mode 100644 index d2efa904..00000000 Binary files a/docs/assets/widget_screenshots/lmfit_dialog_connect.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/motor_map_widget.png b/docs/assets/widget_screenshots/motor_map_widget.png deleted file mode 100644 index d506591d..00000000 Binary files a/docs/assets/widget_screenshots/motor_map_widget.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/multi_waveform.png b/docs/assets/widget_screenshots/multi_waveform.png deleted file mode 100644 index d671170d..00000000 Binary files a/docs/assets/widget_screenshots/multi_waveform.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/pdf_viewer.png b/docs/assets/widget_screenshots/pdf_viewer.png deleted file mode 100644 index 4549f524..00000000 Binary files a/docs/assets/widget_screenshots/pdf_viewer.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/position_indicator.png b/docs/assets/widget_screenshots/position_indicator.png deleted file mode 100644 index 2b1c00c8..00000000 Binary files a/docs/assets/widget_screenshots/position_indicator.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/positioner_box_2d.png b/docs/assets/widget_screenshots/positioner_box_2d.png deleted file mode 100644 index 0a7b07a7..00000000 Binary files a/docs/assets/widget_screenshots/positioner_box_2d.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/queue.png b/docs/assets/widget_screenshots/queue.png deleted file mode 100644 index a2ca0d34..00000000 Binary files a/docs/assets/widget_screenshots/queue.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/ring_progress_bar.png b/docs/assets/widget_screenshots/ring_progress_bar.png deleted file mode 100644 index 07160657..00000000 Binary files a/docs/assets/widget_screenshots/ring_progress_bar.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/scan_controller.png b/docs/assets/widget_screenshots/scan_controller.png deleted file mode 100644 index 0f778d6b..00000000 Binary files a/docs/assets/widget_screenshots/scan_controller.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/scatter_waveform.png b/docs/assets/widget_screenshots/scatter_waveform.png deleted file mode 100644 index ab198870..00000000 Binary files a/docs/assets/widget_screenshots/scatter_waveform.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/signal_inputs.png b/docs/assets/widget_screenshots/signal_inputs.png deleted file mode 100644 index 45bf49d6..00000000 Binary files a/docs/assets/widget_screenshots/signal_inputs.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/spinner.gif b/docs/assets/widget_screenshots/spinner.gif deleted file mode 100644 index 08c31a00..00000000 Binary files a/docs/assets/widget_screenshots/spinner.gif and /dev/null differ diff --git a/docs/assets/widget_screenshots/status_box.png b/docs/assets/widget_screenshots/status_box.png deleted file mode 100644 index 57206c72..00000000 Binary files a/docs/assets/widget_screenshots/status_box.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/text_box.png b/docs/assets/widget_screenshots/text_box.png deleted file mode 100644 index 9b83e610..00000000 Binary files a/docs/assets/widget_screenshots/text_box.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/text_box_properties.png b/docs/assets/widget_screenshots/text_box_properties.png deleted file mode 100644 index c9100053..00000000 Binary files a/docs/assets/widget_screenshots/text_box_properties.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/toggle.png b/docs/assets/widget_screenshots/toggle.png deleted file mode 100644 index 65262a6f..00000000 Binary files a/docs/assets/widget_screenshots/toggle.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/waveform_widget.png b/docs/assets/widget_screenshots/waveform_widget.png deleted file mode 100644 index 544c8ccc..00000000 Binary files a/docs/assets/widget_screenshots/waveform_widget.png and /dev/null differ diff --git a/docs/assets/widget_screenshots/website.png b/docs/assets/widget_screenshots/website.png deleted file mode 100644 index fdd0cab9..00000000 Binary files a/docs/assets/widget_screenshots/website.png and /dev/null differ diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 8547ed33..00000000 --- a/docs/conf.py +++ /dev/null @@ -1,116 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -import datetime -import pathlib - -import tomli - -project = "BEC Widgets" -copyright = f"{datetime.datetime.today().year}, Paul Scherrer Institute" -author = "Paul Scherrer Institute" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -current_path = pathlib.Path(__file__).parent.parent.resolve() -version_path = f"{current_path}/pyproject.toml" - - -def get_version(): - """load the version from the version file""" - with open(version_path, "r", encoding="utf-8") as file: - res = tomli.loads(file.read()) - return res["project"]["version"] - - -release = get_version() - -extensions = [ - # "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx_toolbox.collapse", - "sphinx_copybutton", - "myst_parser", - "sphinx_design", - "sphinx_inline_tabs", - "autoapi.extension", - "sphinx.ext.viewcode", -] - -myst_enable_extensions = [ - "amsmath", - "attrs_inline", - "colon_fence", - "deflist", - "dollarmath", - "fieldlist", - "html_admonition", - "html_image", - "replacements", - "smartquotes", - "strikethrough", - "substitution", - "tasklist", -] - -# AutoAPI configuration -autoapi_dirs = ["../bec_widgets"] -autoapi_type = "python" -autoapi_generate_api_docs = True -autoapi_add_toctree_entry = False # We'll control the toctree manually -autoapi_keep_files = False -autoapi_python_class_content = "both" # Include both class docstring and __init__ -autoapi_member_order = "groupwise" - -add_module_names = False # Remove namespaces from class/method signatures -autodoc_inherit_docstrings = True # If no docstring, inherit from base class -set_type_checking_flag = True # Enable 'expensive' imports for sphinx_autodoc_typehints -autoclass_content = "both" # Include both class docstring and __init__ -autodoc_mock_imports = ["pyqtgraph", "qtpy", "PySide6"] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - -language = "Python" - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = "pydata_sphinx_theme" -html_static_path = ["_static"] -html_css_files = ["custom.css"] -html_logo = "../bec_widgets/assets/app_icons/bec_widgets_icon.png" - - -def skip_submodules(app, what, name, obj, skip, options): - if what == "module": - if not name.startswith("bec_widgets"): - skip = True - # print(f"Checking module: {name}") - if "bec_widgets.widgets" in name: - widget = name.split(".")[-2] - submodule = name.split(".")[-1] - if submodule in [f"register_{widget}", f"{widget}_plugin"]: - # print(f"Skipping submodule: {name}") - skip = True - elif what in ["data", "attribute"]: - obj_name = name.split(".")[-1] - if obj_name.startswith("_") or obj_name in ["__all__", "logger", "bec_logger", "app"]: - skip = True - - elif what == "class": - class_name = name.split(".")[-1] - if class_name.startswith("Demo"): - skip = True - return skip - - -def setup(app): - app.connect("autoapi-skip-member", skip_submodules) diff --git a/docs/developer/developer.md b/docs/developer/developer.md deleted file mode 100644 index 72980528..00000000 --- a/docs/developer/developer.md +++ /dev/null @@ -1,52 +0,0 @@ -(developer)= -# Developer - -Welcome to the BEC Widgets developer guide! BEC Widgets is a framework for building graphical user interfaces (GUIs) for [BEC](https://bec.readthedocs.io/en/latest/), a Python package for beamline experiment control. - -This guide targets readers who want to develop new widgets or extend existing ones. If your goal is to use BEC Widgets to build GUIs for your experiments, please refer to the [user guide](#user). - -```{toctree} ---- -maxdepth: 2 -hidden: true ---- - -introduction/introduction.md -widget_development/widget_development.md -api_reference/api_reference.md -``` - - -*** - -````{grid} 2 -:gutter: 5 - -```{grid-item-card} -:link: developer.introduction -:link-type: ref -:img-top: /assets/rocket_launch_48dp.svg -:text-align: center -:class-item: index-card - -## Introduction - -An introduction into the single-responsibility principle and the modular design of BEC Widgets. -``` - -```{grid-item-card} -:link: developer.widget_development -:link-type: ref -:img-top: /assets/apps_48dp.svg -:text-align: center -:class-item: index-card - -## Widget Development - -Learn how to develop a new modular widget for BEC Widgets. -``` - -````{grid} 2 - - - diff --git a/docs/developer/introduction/concepts.md b/docs/developer/introduction/concepts.md deleted file mode 100644 index 4465ff6a..00000000 --- a/docs/developer/introduction/concepts.md +++ /dev/null @@ -1,14 +0,0 @@ -(developer.concepts)= -# Concepts -This section provides an overview of the core concepts of BEC Widgets, which are based on the single-responsibility principle and modular design. - -## Moduler Design -We develop widgets with the single-responsibility principle in mind, meaning each widget is designed for a specific task. Our goal is to keep widgets simple, using them primarily for visualization or to initiate actions within BEC. Following these ideas, widgets should be designed to be reusable in various applications, making them versatile building blocks for larger GUIs. - -We offer up to three different options for composing larger GUIs from these modular widgets: BEC Designer, DockArea widget, or scripting from the command line interface. More information about these options can be found in the user sections on [applications](user.applications). - -## Client-Server Architecture - -BEC Widgets is built on top of the [BEC](https://bec.readthedocs.io/en/latest/) package, which provides the backend for beamline experiment control. BEC Widgets is a client of BEC, meaning it can interact with the backend through a client-server architecture. To make full usage of the available features of BEC, we recommend to check the documentation about [data access](https://bec.readthedocs.io/en/latest/developer/data_access/data_access.html) in which the messaging and event system of BEC is described. -In the context of BEC Widgets, the {py:class}`~bec_widgets.utils.bec_dispatcher.BECDispatcher` connects to this messaging and event system, allowing you to link your Qt [`Slots`](https://www.pythonguis.com/tutorials/pyside6-signals-slots-events/) to messages and event received from BEC. - diff --git a/docs/developer/introduction/contributing.md b/docs/developer/introduction/contributing.md deleted file mode 100644 index 53537b6f..00000000 --- a/docs/developer/introduction/contributing.md +++ /dev/null @@ -1,28 +0,0 @@ -(developer.contributing)= -# Contributing - -If you like to contribute to the development of BEC Widgets, you can follow the steps below to set up your development environment. -BEC Widgets works in conjunction with [BEC](https://bec.readthedocs.io/en/latest/). -Therefore, we recommend that you install BEC first following the [developer instructions](https://bec.readthedocs.io/en/latest/developer/getting_started/install_developer_env.html) and include BEC Widgets. - -If you already have a BEC environment set up, you can install BEC Widgets in editable mode into your BEC Python environment. - -**Prerequisites** -1. **Python Version:** BEC Widgets requires Python version 3.11 or higher. Verify your Python version to ensure compatibility. -2. **BEC Installation:** BEC Widgets works in conjunction with BEC. While BEC is a dependency and will be installed automatically, you can find more information about BEC and its installation process in the [BEC documentation](https://beamline-experiment-control.readthedocs.io/en/latest/). -3. **Qt Distributions:** BEC Widgets supports [PySide6](https://doc.qt.io/qtforpython-6/quickstart.html) and [PyQt6](https://www.riverbankcomputing.com/static/Docs/PyQt6/introduction.html). We use [qtpy](https://pypi.org/project/QtPy/) to abstract the underlying QT distribution. - -**Clone the Repository**: -```bash -git clone https://gitlab.psi.ch/bec/bec_widgets -cd bec_widgets -``` -**Install in Editable Mode**: - -Please install the package in editable mode into your BEC Python environment. -```bash -pip install -e '.[dev,pyside6]' -``` -This installs the package together with [PySide6](https://doc.qt.io/qtforpython-6/quickstart.html). - - diff --git a/docs/developer/introduction/introduction.md b/docs/developer/introduction/introduction.md deleted file mode 100644 index 26b7546c..00000000 --- a/docs/developer/introduction/introduction.md +++ /dev/null @@ -1,16 +0,0 @@ -(developer.introduction)= -# Introduction -BEC Widgets is a framework providing modular components that can be integrated into various larger GUI applications. Each widget serves a specific purpose adhering to the single-responsibility principle as detailed in our [concepts section](developer.concepts), and offers a straightforward, user-friendly interface. -These widgets provide data visualisation tools and experimental control interfaces by triggering actions within BEC. -If you're interested in contributing to BEC Widgets, please refer to our [contributing guide](developer.contributing), which provides instructions for setting up your development environment and creating your own widgets. - -```{toctree} ---- -maxdepth: 2 -hidden: false ---- - -concepts/ -contributing/ -useful_links/ -``` \ No newline at end of file diff --git a/docs/developer/introduction/useful_links.md b/docs/developer/introduction/useful_links.md deleted file mode 100644 index 2e6168c1..00000000 --- a/docs/developer/introduction/useful_links.md +++ /dev/null @@ -1,23 +0,0 @@ -(developer.useful_links)= - -# Useful Links - -If you're new to the Qt framework, here are some helpful resources to get you started. In BEC Widgets, we use Qt -distributions based on Qt6, specifically PyQt6 and PySide6. However, all code should be written using -the [`qtpy`](https://pypi.org/project/QtPy/) abstraction layer, which allows compatibility with both. While both PyQt6 -and PySide6 are supported, we prefer PySide6 as it is the official Python binding from the Qt Company. It offers -advantages like bundling all necessary libraries in a single package with pip installation and staying more up-to-date -compared to PyQt6. - -Below is a list of useful links to help you start developing with Qt and Qt Designer: - -- [Python GUIs](https://www.pythonguis.com): A great resource with tutorials and examples for creating GUIs in Python - using various frameworks. -- [PySide6 Quick Start Guide](https://doc.qt.io/qtforpython-6/index.html): The official documentation for PySide6, - including quick start guides and tutorials. -- [Qt Designer Official Documentation](https://doc.qt.io/qt-6/qtdesigner-manual.html): Comprehensive documentation for - Qt Designer, the underlying tool for BEC Designer. -- [Simple PyQt Tutorial from RealPython](https://realpython.com/python-pyqt-gui-calculator/): A beginner-friendly - tutorial on creating your first GUI application with PyQt. -- [PyQtGraph Documentation](https://pyqtgraph.readthedocs.io/en/latest/): BEC Widgets relies on PyQtGraph for plotting; - this is the official documentation. diff --git a/docs/developer/widget_development/bec_dispatcher.md b/docs/developer/widget_development/bec_dispatcher.md deleted file mode 100644 index 6ebd0250..00000000 --- a/docs/developer/widget_development/bec_dispatcher.md +++ /dev/null @@ -1,139 +0,0 @@ -(developer.widget_development.bec_dispatcher)= - -# BECDispatcher - -## Overview - -The [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) -is a powerful tool that simplifies the process of connecting [Qt slots](https://doc.qt.io/qt-6/signalsandslots.html) to message updates from the BEC server. It enables real-time communication between your widget and the BEC server by listening to specific message channels and triggering callbacks when new data is received. - -This tool is especially useful for creating widgets that need to respond to dynamic data, such as device readbacks or -scan updates. By -using [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher), -you -can create callback functions that react to incoming messages and update your widget's state or perform other tasks -based on the data received. - -## How It Works - -When you create a widget that needs to respond to updates from the BEC server, you can use -the [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) -to -connect specific Qt slots (callback functions) to message endpoints. These endpoints are defined within the BEC system -and represent specific channels of information ( -e.g., [`device readback`](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_lib.endpoints.MessageEndpoints.html#bec_lib.endpoints.MessageEndpoints.device_readback), -[`scan_segment`](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_lib.endpoints.MessageEndpoints.html#bec_lib.endpoints.MessageEndpoints.scan_segment), -etc.). - -### Step-by-Step Guide - -1. **Create a Callback Function**: Define a function within your widget that will handle the data received from the BEC - server. This function must accept two parameters: `msg_content` (the message content) and `metadata` ( - additional - information about the message). - - ```python - # Example for a callback function that updates a widget display based on motor readback data - from qtpy.QtCore import Slot - - @Slot(dict, dict) - def on_device_readback(self, msg_content:dict, metadata:dict): - # Process the incoming data - new_value = msg_content["signals"]['motor_x']["value"] - # Update the widget's display or perform another action - self.update_display(new_value) - ``` - -2. **Connect the Slot to an Endpoint**: Use - the [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) - to connect your callback function to a specific - endpoint. The endpoint represents the type of data or message you're interested in. - - ```python - from bec_lib.endpoints import MessageEndpoints - - self.bec_dispatcher.connect_slot(self.on_device_readback, MessageEndpoints.device_readback("motor_x")) - ``` - -3. **Handle Incoming Data**: Your callback function will be triggered automatically whenever a new message is received - on the connected endpoint. Use the data in `msg_content` to update your widget or perform other actions. - -4. **Clean Up Connections**: If your widget is being destroyed or you no longer need to listen for updates, make sure to - disconnect your slots from - the [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) - to avoid memory or thread leaks. - - ```python - self.bec_dispatcher.disconnect_slot(self.on_device_readback, MessageEndpoints.device_readback("motor_x")) - ``` - -### Example: Motor Map Widget - -The [`BECMotorMap`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.widgets.figure.plots.motor_map.motor_map.BECMotorMap.html#bec-widgets-widgets-figure-plots-motor-map-motor-map-becmotormap) -widget is a great example of -how [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) -can be used to handle real-time data updates. This -widget listens for updates on specific motor positions and dynamically updates the motor map display. - -Here's a breakdown of -how [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) -is used in -the [`BECMotorMap`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.widgets.figure.plots.motor_map.motor_map.BECMotorMap.html#bec-widgets-widgets-figure-plots-motor-map-motor-map-becmotormap) -widget: - -1. **Connecting to Motor Readbacks**: - The widget connects to - the [`device readback`](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_lib.endpoints.MessageEndpoints.html#bec_lib.endpoints.MessageEndpoints.device_readback) - endpoints using - the [`connect_slot`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher.connect_slot) - method - of [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher). - This allows - the widget to receive real-time updates about the motor positions. - -```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py -:language: python -:pyobject: BECMotorMap._connect_motor_to_slots -:dedent: 4 -``` - -2. **Handling Readback Data**: - The `on_device_readback` slot is called whenever new data is received from the motor readback. This slot processes - the data and updates the motor map plot accordingly. - -```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py -:language: python -:pyobject: BECMotorMap.on_device_readback -:dedent: 4 -``` - -3. **Updating the Plot**: - The motor map plot is updated in response to the new data, providing a real-time visualization of the motor's - position. - -```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py -:language: python -:pyobject: BECMotorMap._update_plot -:dedent: 4 -``` - -4. **Disconnecting When No Longer Needed**: - The widget ensures that connections are properly cleaned up when no longer needed. - -```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py -:language: python -:pyobject: BECMotorMap._update_plot -:dedent: 4 -``` - -## Conclusion - -The [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher) -is a key tool for developing interactive and responsive widgets within the BEC framework. By leveraging this tool, you can create widgets that automatically respond to real-time data updates from the BEC server, -enhancing the interactivity and functionality of your user interface. - -In next tutorials we will cover how to create a custom widget using the BECDispatcher and BECWidget base class. - -```{note} -For more details on specific messages and endpoints, please refer to the [Message Endpoints Documentation](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_lib.endpoints.MessageEndpoints.html#bec-lib-endpoints-messageendpoints). -``` \ No newline at end of file diff --git a/docs/developer/widget_development/tutorial_tests.md b/docs/developer/widget_development/tutorial_tests.md deleted file mode 100644 index 05519ba9..00000000 --- a/docs/developer/widget_development/tutorial_tests.md +++ /dev/null @@ -1,81 +0,0 @@ -(developer.widget_development.tutorial_tests)= - -# Testing BEC Widgets - -## Importance of Writing Tests for Widgets - -Writing tests for widgets, even for simple ones, is crucial in maintaining the reliability and stability of a software -project. Tests help ensure that new contributions don't unintentionally break existing functionality, and they provide a -safety net for developers making changes in the future. In the context of the BEC Widgets, testing is particularly -important due to the complexity of interactions with external systems like the BEC server. - -## Testing with Pytest and QtBot - -For testing Qt-based applications, we use [`pytest`](https://docs.pytest.org/en/stable/) along with -the [`pytest-qt`](https://pytest-qt.readthedocs.io/en/latest/) plugin, which provides the `qtbot` fixture. `qtbot` is -specifically designed to simplify interactions with Qt applications during testing. It handles the creation, management, -and cleanup of widgets, ensuring that your tests are robust and do not leave behind any lingering resources or open -windows. - -## Fixtures for Testing BEC Widgets - -Let's break down the key fixtures used in testing BEC Widgets: - -1. **`qapplication` Fixture**: This fixture ensures that all Qt applications and widgets are properly closed after each - test. It uses `qtbot` to wait until all top-level widgets are closed, raising an error if any remain open. - -2. **`rpc_register` Fixture**: This fixture manages the `RPCRegister` singleton, ensuring that it is reset after each - test. This prevents state from leaking between tests, which could cause unexpected behavior. - -3. **`bec_dispatcher` Fixture**: This fixture initializes the `BECDispatcher` and ensures that all connections are - properly disconnected and the BEC client is shut down after each test. Like `rpc_register`, it resets the singleton - after each test. - -4. **`clean_singleton` Fixture**: This fixture cleans up any singleton instances used in error popups, preventing - interference between tests. - -5. **`create_widget` Helper Function**: This function is a helper that should be used in all tests requiring widget - creation. It ensures that widgets are properly added to `qtbot`, which manages their lifecycle during tests. We - highly recommend using this function to create widgets in your tests to ensure proper cleanup and compatibility with - other `autouse` fixtures. - -```{note} -These fixtures are automatically applied to all tests within the `tests/unit_tests` directory, ensuring consistency and proper cleanup between tests. You can find all unit test fixtures in the `conftest.py` file located in the `tests/unit_tests` directory of the BEC Widgets repository. - -``` - -````{dropdown} View code: Conftest with Fixtures -:icon: code-square -:animate: fade-in-slide-down -```{literalinclude} ../../../tests/unit_tests/conftest.py -:language: python -``` -```` - -## Example Test for `PositionerBox` - -Below is an example of how to write a simple test for the [`PositionerBox`](user.widgets.positioner_box) widget, -utilizing the fixtures mentioned above: - -````{dropdown} View code: PositionerBox Widget Unit Tests -:icon: code-square -:animate: fade-in-slide-down -```{literalinclude} ../../../tests/unit_tests/test_positioner_box.py -:language: python -``` -```` - -## Key Points in the Test: - -- **Fixture Use**: The `positioner_box` fixture handles widget creation and mocking of external dependencies. This - ensures the test runs in isolation and doesn't rely on actual hardware or network connections. - -- **Assertion Checks**: The test includes several assertions to verify that the widget initializes correctly, including - checking the setpoint, precision, and step size. - -## Conclusion - -By writing tests like the one shown above, you help ensure that your widget behaves as expected. Tests also provide a -way to automatically verify that new changes do not introduce regressions. This is particularly important in a -collaborative environment where multiple developers are contributing to the same codebase. Your tests not only safeguard -your code but also provide confidence to others that their contributions won't break existing functionality. \ No newline at end of file diff --git a/docs/developer/widget_development/widget_base_class.md b/docs/developer/widget_development/widget_base_class.md deleted file mode 100644 index b4b9fc3a..00000000 --- a/docs/developer/widget_development/widget_base_class.md +++ /dev/null @@ -1,192 +0,0 @@ -(developer.widget_development.widget_base_class)= - -# BECWidget Base Class - -When developing new widgets, it is crucial to ensure seamless integration with the BEC system. This is achieved by using -the [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -base class, which provides essential functionalities and shortcuts to interact with various BEC services. In this -tutorial, we will explore the importance of this base class, the role of -the [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) -mixin, and how these components work together to facilitate the development of powerful and responsive widgets. - -## Understanding the `BECWidget` Base Class - -The [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -base class is designed to serve as the foundation for all BEC-connected widgets. It ensures that your widget is properly -integrated with the BEC system by providing: - -1. **Connection to BEC Services**: - [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) includes the [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) - mixin, which handles all the necessary connections to BEC services such as the BEC server, device manager, scan - control, and more. - -2. **Qt Integration**: - The [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) - base class also ensures that your widget is correctly integrated with Qt by requiring that it inherits from - both [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) - and [`QWidget`](https://doc.qt.io/qtforpython-6/PySide6/QtWidgets/QWidget.html). This combination allows your widget - to leverage the full power of Qt for creating rich user interfaces while staying connected to the BEC ecosystem. - -3. **Configuration Management**: The base class provides a `ConnectionConfig` model (based on Pydantic) that helps - manage and validate the configuration of your widget. This configuration can be easily serialized to and from Python - dictionaries, JSON, or YAML formats, allowing for persistent storage and retrieval of widget states. - -4. **RPC Registration**: Widgets derived - from [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) - are automatically registered with - the [`RPCRegister`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.cli.rpc_register.RPCRegister.html#bec_widgets.cli.rpc_register.RPCRegister), - enabling them to handle remote procedure calls (RPCs) efficiently. This allows the widget to be controlled remotely - from the `BECIPythonClient` via CLI, providing powerful control and automation capabilities. For example, you can - remotely adjust widget settings, start/stop operations, or query the widget’s status directly from the command line. - -5. **Reacting to Theme Changes**: The base class provides a dedicated input flag to subscribe to theme changes, allowing - your widget to adapt its appearance based on the current theme (e.g., light or dark mode) and can even synchronize with the user's OS settings. The widget-specific logic can then - be implemented in the `apply_theme` method, which is called whenever the theme changes. This ensures a consistent user experience across different themes and environments. - -Here’s a basic example of a widget inheriting -from [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget): - -```python -from bec_widgets.utils.bec_widget import BECWidget -from qtpy.QtWidgets import QWidget, QVBoxLayout - -class MyWidget(BECWidget, QWidget): - def __init__(self, parent=None, *args, **kwargs): - super().__init__(*args, **kwargs) # disable theme updates - QWidget.__init__(self, parent=parent) - self.get_bec_shortcuts() # Initialize BEC shortcuts - self.init_ui() - - def init_ui(self): - layout = QVBoxLayout(self) - # Add more UI components here - self.setLayout(layout) - - -# To enable theme updates, set theme_update=True, e.g.: - -class MyDynamicWidget(BECWidget, QWidget): - def __init__(self, parent=None, *args, **kwargs): - super().__init__(*args, theme_update=True, **kwargs) # enable theme updates - QWidget.__init__(self, parent=parent) - self.get_bec_shortcuts() # Initialize BEC shortcuts - self.init_ui() - - def init_ui(self): - layout = QVBoxLayout(self) - # Add more UI components here - self.setLayout(layout) - - def apply_theme(self, theme): - # Implement theme-specific logic here - pass - -``` - -### The Role of `BECConnector` - -At the heart -of [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -is -the [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) -mixin, which plays a crucial role in managing the connection between your widget and the BEC system. -The [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) -provides several key functionalities: - -1. **Client Initialization**: It initializes a `BECClient` instance if one isn't provided, ensuring your widget is - connected to the BEC server. This client is central to all interactions with the BEC system. - -2. **Task Management**: - The [`submit_task`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector.submit_task) - method allows for running tasks in separate threads, preventing long-running operations from blocking the main UI - thread. - -3. **Configuration Handling - **: [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) - uses the `ConnectionConfig` model to manage the widget’s configuration, ensuring all parameters are validated and - properly set up. - -4. **RPC Registration**: Widgets are registered with - the [`RPCRegister`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.cli.rpc_register.RPCRegister.html#bec-widgets-cli-rpc-register-rpcregister), - allowing them to handle remote procedure calls effectively. - -5. **Error Handling**: It includes utilities for handling errors gracefully within the Qt environment, ensuring that - issues are reported to the user without crashing the application. - -### Utilizing `get_bec_shortcuts` - -One of the most powerful features of -the [`BECConnector`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_connector.BECConnector.html#bec_widgets.utils.bec_connector.BECConnector) -is the `get_bec_shortcuts` method. This method provides your widget with direct access to essential components of the -BEC system through convenient shortcuts: - -1. **Device Manager (`self.dev`)**: - - Access all devices registered with the BEC system. You can interact with devices, retrieve their status, and send - commands directly through this shortcut. - ```python - # Moves 'motor1' to position 10 - self.dev["motor1"].move(10) - ``` - -2. **Scan Control (`self.scans`)**: - - Control scans, initiate new ones, monitor progress, and manage their execution. - ```python - # Starts Line Scan from -10 to 10 in samx and -5 to 5 in samy - self.scans.line_scan(self.dev.samx,-10,10,self.dev.samy,-5,5, steps=100, exp_time=0.001,relative=False) - ``` - -3. **Queue Management (`self.queue`)**: - - Manage the BEC scan queue, such as adding scans, checking status, or removing scans. - ```python - # Request abortion of the current scan queue - self.queue.request_scan_abortion() - ``` - -4. **Scan Storage (`self.scan_storage`)**: - - Access stored scan data for retrieval and analysis. - ```python - # Retrieve scan item for a specific scan ID - self.scan_item = self.queue.scan_storage.find_scan_by_ID(self.scan_id) - ``` - -5. **Full BECClient Access (`self.client`)**: - - Direct access to the BECClient instance, allowing for additional functionalities not covered by the shortcuts. - ```python - # Shutdown the BECClient - self.client.shutdown() - ``` - -### Example: [`PositionerBox`](user.widgets.positioner_box) Widget - -Let’s look at an example of a widget that leverages -the [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -base class and `get_bec_shortcuts`: - -````{dropdown} View code: PositionerBox Widget -:icon: code-square -:animate: fade-in-slide-down -```{literalinclude} ../../../bec_widgets/widgets/positioner_box/positioner_box.py -:language: python -:pyobject: PositionerBox -``` -```` - -In this widget: - -- **Device Interaction**: The widget uses `self.dev` to interact with a positioner device, reading its state and - updating the UI accordingly. - -- **Scan and Queue Control**: Although not shown in this example, the widget could easily use `self.scans` - and `self.queue` to manage scans related to the positioner or queue up new operations. - -### Conclusion - -The `BECWidget` base class and the `BECConnector` mixin are foundational components for creating widgets that seamlessly -integrate with the BEC system. By inheriting from `BECWidget`, you gain access to powerful connection management, task -handling, and configuration capabilities, as well as shortcuts that make interacting with BEC services straightforward -and efficient. - -By leveraging these tools, you can focus on building the core functionality of your widget, confident that the -complexities of BEC integration are handled robustly and efficiently. In the next tutorial we will demonstrate -step-by-step how to create a custom widget using the `BECWidget` base class and explore advanced features for creating -responsive and interactive user interfaces. \ No newline at end of file diff --git a/docs/developer/widget_development/widget_development.md b/docs/developer/widget_development/widget_development.md deleted file mode 100644 index 3ee959d5..00000000 --- a/docs/developer/widget_development/widget_development.md +++ /dev/null @@ -1,56 +0,0 @@ -(developer.widget_development)= - -# Widget Development -This section provides an introduction to the building blocks of BEC Widgets: widgets. Widgets are the basic components of the graphical user interface (GUI) and are used to create larger applications. We will cover key topics such as how to develop new widgets or how to customise existing widgets. For details on the already available widgets and their usage, please refer to user section about [widgets](#user.widgets). - -To facilitate the development of new widgets, integrated into the BEC framework, we provide two main base classes: `BECWidget` and its parent class `BECDispatcher`. The `BECDispatcher` class is responsible for managing the communication between widgets and the BEC framework. The `BECWidget` class is the base class for all widgets and provides the basic functionality for creating and managing widgets. Leveraging these classes, you can rapidly develop new widgets that are responsive and interactive. - -A very simple "Hello World" example of a widget can be seen below: - -````{dropdown} View code: Hello World Widget -:icon: code-square -:animate: fade-in-slide-down - -```python -from qtpy.QtWidgets import QLabel, QWidget - -from bec_widgets.utils.bec_widget import BECWidget - - -class HelloWorldWidget(BECWidget, QWidget): - def __init__( - self, parent: QWidget | None = None, client=None, gui_id: str | None = None, **kwargs - ) -> None: - # Initialize base classes - super().__init__(parent=parent, client=client, gui_id=gui_id, **kwargs) - - self.label = QLabel(self) - self.label.setText("Hello World") - - -# Run the widget as a standalone application -if __name__ == "__main__": - import sys - - from qtpy.QtWidgets import QApplication - - app = QApplication(sys.argv) - w = HelloWorldWidget() - w.show() - sys.exit(app.exec_()) -``` -```` - -The following sections will provide more details on how to develop new widgets and how to leverage the `BECDispatcher` and `BECWidget` classes to create interactive and responsive widgets. - -```{toctree} ---- -maxdepth: 2 -hidden: false ---- - -bec_dispatcher -widget_base_class -widget_tutorial -tutorial_tests -``` \ No newline at end of file diff --git a/docs/developer/widget_development/widget_tutorial.md b/docs/developer/widget_development/widget_tutorial.md deleted file mode 100644 index 17b02b56..00000000 --- a/docs/developer/widget_development/widget_tutorial.md +++ /dev/null @@ -1,243 +0,0 @@ -(developer.widget_development.widget_tutorial)= - -# Tutorial: Creating a New BEC-Connected Widget - -In this tutorial, we'll create a BEC-connected widget that allows you to control a motor by setting its position. The -widget will demonstrate how to retrieve data from BEC, prompt an action in BEC (like moving a motor), and expose an RPC -interface for remote control. By the end of this tutorial, you'll have a functional widget that can interact with the -BEC system both through a graphical interface and via command-line control. - -We'll break the tutorial into the following steps: - -1. **Creating the Basic Widget Layout**: We’ll design a simple UI with a `QLabel`, `QDoubleSpinBox`, and - a `QPushButton`. -2. **Connecting to BEC**: We’ll integrate our widget with the BEC system using - the [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) - base class - and [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher). -3. **Implementing RPC for Remote Control**: We’ll set up an RPC interface to allow remote control of the widget via CLI. -4. **Running the Widget**: We’ll create a small script to run the widget in a `QApplication`. - -## Step 1: Creating the Basic Widget Layout - -First, let's start by creating the basic layout of our widget. We’ll add a `QLabel` to display the current coordinates -of the motor, a `QDoubleSpinBox` to input the desired coordinates, and a `QPushButton` to initiate the motor movement. - -```python -from qtpy.QtWidgets import QWidget, QLabel, QDoubleSpinBox, QPushButton, QVBoxLayout - - -class MotorControlWidget(QWidget): - def __init__(self, parent=None, motor_name: str = ""): - super().__init__(parent) - - self.motor_name = motor_name - - # Initialize UI elements - self.label_top = QLabel("Current Position:", self) - self.label = QLabel(f"{self.motor_name} - N/A", self) - self.spin_box = QDoubleSpinBox(self) - self.spin_box.setRange(-10000, 10000) - self.spin_box.setDecimals(3) - self.spin_box.setSingleStep(0.1) - - self.move_button = QPushButton("Move Motor", self) - - # Set up the layout - layout = QVBoxLayout(self) - layout.addWidget(self.label_top) - layout.addWidget(self.label) - layout.addWidget(self.spin_box) - layout.addWidget(self.move_button) - self.setLayout(layout) - - # Connect button click to move motor - self.move_button.clicked.connect(self.move_motor) - - def move_motor(self): - # Placeholder method for motor movement - print(f"Moving motor {self.motor_name} to {self.spin_box.value()}") -``` - -## Step 2: Connecting to BEC - -Now that we have the basic layout, let's connect our widget to the BEC system using -the [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -base class -and [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher). -We’ll modify the widget to inherit -from [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget), -pass the motor name to the widget, and use `get_bec_shortcuts` to access BEC services. - -```python -from bec_lib.endpoints import MessageEndpoints -from qtpy.QtWidgets import QDoubleSpinBox, QLabel, QPushButton, QVBoxLayout, QWidget - -from bec_widgets.utils.bec_widget import BECWidget -from bec_widgets.utils.error_popups import SafeSlot - - -class MotorControlWidget(BECWidget, QWidget): - - def __init__(self, parent=None, motor_name: str = "", **kwargs): - super().__init__(parent=parent, **kwargs) - - self.motor_name = motor_name - - # Initialize BEC shortcuts - self.get_bec_shortcuts() - - # Initialize UI elements - self.label_top = QLabel(f"Current Position:", self) - self.label = QLabel(f"{self.motor_name} - N/A", self) - self.spin_box = QDoubleSpinBox(self) - self.spin_box.setRange(-10000, 10000) - self.spin_box.setDecimals(3) - self.spin_box.setSingleStep(0.1) - - self.move_button = QPushButton("Move Motor", self) - - # Set up the layout - layout = QVBoxLayout(self) - layout.addWidget(self.label_top) - layout.addWidget(self.label) - layout.addWidget(self.spin_box) - layout.addWidget(self.move_button) - self.setLayout(layout) - - # Connect button click to move motor - self.move_button.clicked.connect(self.move_motor) - - # Register BECDispatcher to listen for motor position updates - self.bec_dispatcher.connect_slot( - self.on_motor_update, MessageEndpoints.device_readback(self.motor_name) - ) - - @SafeSlot() - def move_motor(self): - target_position = self.spin_box.value() - self.dev[self.motor_name].move(target_position) - print(f"Commanding motor {self.motor_name} to move to {target_position}") - - @SafeSlot(dict, dict) - def on_motor_update(self, msg_content, metadata): - position = msg_content.get("signals", {}).get(self.motor_name, {}).get("value", "N/A") - self.label.setText(f"{self.motor_name} : {round(position, 2)}") -``` - -## Step 3: Implementing RPC for Remote Control - -Next, we’ll set up an RPC interface to allow remote control of the widget from the command line via -the `BECIPythonClient`. We’ll expose a method that allows changing the motor name through CLI commands. - -```python -from bec_lib.endpoints import MessageEndpoints -from qtpy.QtWidgets import QDoubleSpinBox, QLabel, QPushButton, QVBoxLayout, QWidget - -from bec_widgets.utils.bec_widget import BECWidget -from bec_widgets.utils.error_popups import SafeSlot - - -class MotorControlWidget(BECWidget, QWidget): - USER_ACCESS = ["change_motor"] - - def __init__(self, parent=None, motor_name: str = "", **kwargs): - super().__init__(parent=parent, **kwargs) - - self.motor_name = motor_name - - # Initialize BEC shortcuts - self.get_bec_shortcuts() - - # Initialize UI elements - self.label_top = QLabel(f"Current Position:", self) - self.label = QLabel(f"{self.motor_name} - N/A", self) - self.spin_box = QDoubleSpinBox(self) - self.spin_box.setRange(-10000, 10000) - self.spin_box.setDecimals(3) - self.spin_box.setSingleStep(0.1) - - self.move_button = QPushButton("Move Motor", self) - - # Set up the layout - layout = QVBoxLayout(self) - layout.addWidget(self.label_top) - layout.addWidget(self.label) - layout.addWidget(self.spin_box) - layout.addWidget(self.move_button) - self.setLayout(layout) - - # Connect button click to move motor - self.move_button.clicked.connect(self.move_motor) - - # Register BECDispatcher to listen for motor position updates - self.bec_dispatcher.connect_slot( - self.on_motor_update, MessageEndpoints.device_readback(self.motor_name) - ) - - @SafeSlot() - def move_motor(self): - target_position = self.spin_box.value() - self.dev[self.motor_name].move(target_position) - print(f"Commanding motor {self.motor_name} to move to {target_position}") - - @SafeSlot(dict, dict) - def on_motor_update(self, msg_content, metadata): - position = msg_content.get("signals", {}).get(self.motor_name, {}).get("value", "N/A") - self.label.setText(f"{self.motor_name} : {round(position, 2)}") - - def change_motor(self, motor_name): - """RPC method to change the motor being controlled.""" - # Disconnect from previous motor - self.bec_dispatcher.disconnect_slot( - self.on_motor_update, MessageEndpoints.device_readback(self.motor_name) - ) - # Update motor name and reconnect to new motor - self.motor_name = motor_name - self.label.setText(f"{self.motor_name} - N/A") - self.bec_dispatcher.connect_slot( - self.on_motor_update, MessageEndpoints.device_readback(self.motor_name) - ) -``` - -```{warning} -After implementing an RPC method, you must run the `bw-generate-cli --target ` script to update the CLI commands for `BECIPythonClient`, e.g. `bw-generate-cli --target csaxs_bec`. This script generates the necessary command-line interface bindings, ensuring that your RPC method can be accessed and controlled remotely. -``` - -```{note} -In this tutorial, we used the @SafeSlot decorator from BEC Widgets to mark methods as slots for signals. This decorator ensures that the connected methods are treated as slots by the Qt framework, which can be connected to signals. It’s a best practice to use the @SafeSlot decorator to clearly indicate which methods are intended to handle signal events with correct argument signatures. @SafeSlot also provides error handling and logging capabilities, making it more robust and easier to debug. -``` - -## Step 4: Running the Widget - -Finally, let’s create a script to run our widget within a `QApplication`. This script can be used to test the widget -independently. You can pass different motor names to control different motors using the same widget class. - -```python -import sys -from qtpy.QtWidgets import QApplication - -if __name__ == "__main__": - app = QApplication(sys.argv) - widget = MotorControlWidget(motor_name='samx') - widget.show() - sys.exit(app.exec_()) -``` - -## Conclusion - -In this tutorial, we've created a BEC-connected widget that allows you to control a motor. We started by designing the -UI, then connected it to the BEC system using -the [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -base class -and [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher). -We also implemented an RPC interface, allowing remote control of the widget through the CLI. Finally, we tested our -widget by running it in a `QApplication`. - -This widget demonstrates a simplified version of the [`PositionerBox`](user.widgets.positioner_box), showcasing the -power and flexibility of -the [`BECWidget`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_widget.BECWidget.html#bec_widgets.utils.bec_widget.BECWidget) -base class -and [`BECDispatcher`](https://bec.readthedocs.io/projects/bec-widgets/en/latest/api_reference/_autosummary/bec_widgets.utils.bec_dispatcher.BECDispatcher.html#bec_widgets.utils.bec_dispatcher.BECDispatcher), -making it easy to integrate with the BEC system and enabling robust, interactive control of devices directly from the -GUI or the command line. \ No newline at end of file diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 96468128..00000000 --- a/docs/index.md +++ /dev/null @@ -1,74 +0,0 @@ -:html_theme.sidebar_secondary.remove: - -# BEC Widgets documentation - -A flexible and extensible framework for building graphical user interfaces in Python, optimized for use in the BEC environment. - -

- -````{grid} 2 -:gutter: 5 - -```{grid-item-card} -:link: introduction -:link-type: ref -:img-top: /assets/index_getting_started.svg -:text-align: center -:class-item: index-card - -## Introduction - -General information about BEC Widgets. -``` - -```{grid-item-card} -:link: user -:link-type: ref -:img-top: /assets/index_user_guide.svg -:text-align: center -:class-item: index-card - -## User guide - -Information for users of BEC Widgets. -``` - -```{grid-item-card} -:link: developer -:link-type: ref -:img-top: /assets/index_contribute.svg -:text-align: center -:class-item: index-card - -## Developer guide - -Information for developers of BEC Widgets. -``` - -```{grid-item-card} -:link: api_reference -:link-type: ref -:img-top: /assets/index_api.svg -:text-align: center -:class-item: index-card - -## API reference - -Comprehensive reference of all BEC Widget classes, functions, and methods. -``` - -```` - - -```{toctree} ---- -numbered: true -maxdepth: 2 -hidden: true ---- - -introduction/introduction -user/user -developer/developer -api_reference/api_reference -``` diff --git a/docs/introduction/introduction.md b/docs/introduction/introduction.md deleted file mode 100644 index 6dc29748..00000000 --- a/docs/introduction/introduction.md +++ /dev/null @@ -1,18 +0,0 @@ -(introduction)= -# Introduction - -## Overview - -BEC Widgets is a GUI framework developed with beamline scientists in mind, aiming to provide a modern and modular environment for interacting with experiments. This package offers a suite of widgets specifically designed to enhance the workflow of beamline experiments, including features for running scans and data visualization. - -Targeting the unique needs of beamline scientists, BEC Widgets stands out with its modular approach to widget design and high customizability. This flexibility allows for tailored solutions that meet the specific requirements of each beamline. - -**Key Features**: - -- **Integration:** Seamlessly integrates with [BEC (Beamline Experiment Control)](https://gitlab.psi.ch/bec/bec), ensuring a cohesive and efficient experiment control experience. -- **Support for Pyside6 and PyQt6:** Provides compatibility with both Pyside6 and PyQt6, offering versatility in your development environment. -- **Widget Modularity:** Features modular widgets that can be easily combined to create customized applications, perfectly aligning with the diverse needs of beamline experiments. - -## Getting Started - -For detailed usage instructions and examples showcasing the practical applications of BEC Widgets, please refer to the [User](#user) section. Developers interested in contributing or customizing BEC Widgets can find more information in the [Developer](#developer) section. \ No newline at end of file diff --git a/docs/make.bat b/docs/make.bat deleted file mode 100644 index 32bb2452..00000000 --- a/docs/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index a478318a..00000000 --- a/docs/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -sphinx -sphinx_copybutton -recommonmark -sphinx-toolbox -pydata-sphinx-theme -sphinx-copybutton -sphinx-inline-tabs -myst-parser -sphinx-design -sphinx-autoapi -tomli \ No newline at end of file diff --git a/docs/user/api_reference/api_reference.md b/docs/user/api_reference/api_reference.md deleted file mode 100644 index 8cbfb661..00000000 --- a/docs/user/api_reference/api_reference.md +++ /dev/null @@ -1,10 +0,0 @@ -(user.api_reference)= -# User API Reference - -This section contains the API documentation for the main user-facing modules and classes. - -```{toctree} -:maxdepth: 2 - -../../autoapi/bec_widgets/cli/index -``` \ No newline at end of file diff --git a/docs/user/applications/applications.md b/docs/user/applications/applications.md deleted file mode 100644 index 2e59cb63..00000000 --- a/docs/user/applications/applications.md +++ /dev/null @@ -1,10 +0,0 @@ -(user.applications)= -# Applications - -**Coming soon** - -```{toctree} ---- -maxdepth: 1 -hidden: true ---- diff --git a/docs/user/customisation.md b/docs/user/customisation.md deleted file mode 100644 index 15a2dfd5..00000000 --- a/docs/user/customisation.md +++ /dev/null @@ -1,123 +0,0 @@ -(user.customisation)= -# Customisation - -## Leveraging BEC Widgets in custom GUI applications - -BEC Widgets can be used to compose a complete Qt graphical application, along with -other QWidgets. The only requirement is to connect to BEC servers in order to get -data, or to interact with BEC components. This role is devoted to the BECDispatcher, -a singleton object which has to be instantiated **after the QApplication is created**. - -A typical BEC Widgets custom application "main" entry point should follow the template -below: - -``` -import argparse -import sys - -from bec_widgets.utils.bec_dispatcher import BECDispatcher -from qtpy.QtWidgets import QApplication - -# optional command line arguments processing -parser = argparse.ArgumentParser(description="...") -parser.add_argument( ...) -... -args = parser.parse_args() - -# creation of the Qt application -app = QApplication([]) - -# creation of BEC Dispatcher -# /!\ important: after the QApplication has been instantiated -bec_dispatcher = BECDispatcher() -client = bec_dispatcher.client -client.start() - -# (optional) processing of command line args, -# creation of a main window depending on the command line arguments (or not) -if args.xxx == "...": - window = ... - -# display of the main window and start of Qt event loop -window.show() -sys.exit(app.exec()) -``` - -The main "window" object presents the layout of widgets to the user and allows -users to interact. BEC Widgets must be placed in the window: - -``` -from qtpy.QWidgets import QMainWindow -from bec_widgets.widgets.figure import BECFigure - -window = QMainWindow() -bec_figure = BECFigure(gui_id="my_gui_app_id") -window.setCentralWidget(bec_figure) - -# prepare to plot samx motor vs bpm4i value -bec_figure.plot(device_x="samx", device_y="bpm4i") -``` - -In the example just above, the resulting application will show a plot of samx -positions on the horizontal axis, and beam intensity on the vertical axis -(when the next scan will be started). - -It is important to ensure proper cleanup of the resources is done when application -quits: - -``` -def final_cleanup(): - bec_figure.clear_all() - bec_figure.client.shutdown() - -window.aboutToQuit.connect(final_cleanup) -``` - -Final example: - -``` -import sys -from qtpy.QtWidgets import QMainWindow, QApplication -from bec_widgets.widgets.figure import BECFigure -from bec_widgets.utils.bec_dispatcher import BECDispatcher - -# creation of the Qt application -app = QApplication([]) - -# creation of BEC Dispatcher -bec_dispatcher = BECDispatcher() -client = bec_dispatcher.client -client.start() - -# creation of main window -window = QMainWindow() - -# inserting BEC Widgets -bec_figure = BECFigure(parent=window, gui_id="my_gui_app_id") -window.setCentralWidget(bec_figure) - -bec_figure.plot(device_x="samx", device_y="bpm4i") - -# ensuring proper cleanup -def final_cleanup(): - bec_figure.clear_all() - bec_figure.client.shutdown() - -app.aboutToQuit.connect(final_cleanup) - -# execution -window.show() -sys.exit(app.exec()) -``` - -## Writing applications using BEC Designer - -BEC Widgets are designed to be used with BEC Designer to quickly design GUI. - -## Example of promoting widgets in BEC Designer - -_Work in progress_ - -## Implementation of plugins into BEC Designer - -_Work in progress_ diff --git a/docs/user/getting_started/BECDockArea.png b/docs/user/getting_started/BECDockArea.png deleted file mode 100644 index 245220ea..00000000 Binary files a/docs/user/getting_started/BECDockArea.png and /dev/null differ diff --git a/docs/user/getting_started/auto_updates.md b/docs/user/getting_started/auto_updates.md deleted file mode 100644 index ab85a04c..00000000 --- a/docs/user/getting_started/auto_updates.md +++ /dev/null @@ -1,129 +0,0 @@ -(user.auto_updates)= -# Auto updates -BEC Widgets provides a simple way to update the entire GUI configuration based on events. These events can be of different types, such as a new scan being started or completed, a button being pressed, a device reporting an error or the existence of a specific metadata key. This allows the users to streamline the experience of the GUI and to focus on the data and the analysis, rather than on the GUI itself. - -The auto update widget can be launched through the BEC launcher: - -![BEC launcher](launcher.png) - -The auto update's launch tile also provides a combo box to select the specific auto update to be launched. These options are automatically populated with all available auto updates from a plugin repository and the default auto update. - -Once the proper auto update is selected and launched, the CLI will automatically add a new entry to the `gui` object. - -The default auto update only provides a simple handler that switches between `line_scan`, `grid_scan` and `best_effort`. More details can be found in the following snippet. - -````{dropdown} Auto Updates Handler -:icon: code-square -:animate: fade-in-slide-down -:open: -```{literalinclude} ../../../bec_widgets/widgets/containers/auto_update/auto_updates.py -:pyobject: AutoUpdates.on_scan_open -``` -```` - -As shown, the default auto updates switches between different visualizations whenever a new scan is started. If the scan is a `line_scan`, the `simple_line_scan` update method is executed. - -````{dropdown} Auto Updates Simple Line Scan -:icon: code-square -:animate: fade-in-slide-down -:open: -```{literalinclude} ../../../bec_widgets/widgets/containers/auto_update/auto_updates.py -:pyobject: AutoUpdates.simple_line_scan -``` -```` - -As can be seen from the above snippet, the update method changes the dock to a specific widget, in this case to a waveform widget. After selecting the device for the x axis, the y axis is retrieved from the list of monitored devices or from a user-specified `selected_device`. - -The y axis can also be set by the user using the `selected_device` attribute: - -```python -gui.AutoUpdates.selected_device = 'bpm4i' -``` - - -````{dropdown} Auto Updates Code -:icon: code-square -:animate: fade-in-slide-down -```{literalinclude} ../../../bec_widgets/widgets/containers/auto_update/auto_updates.py -``` -```` - -## Custom Auto Updates -The beamline can customize their default behaviour through customized auto update classes. This can be achieved by adding an auto update class to the plugin repository: `/bec_widgets/auto_updates/auto_updates.py`. The class must inherit from the `AutoUpdates` class. - -An example of a custom auto update class `PXIIIUpdate` is shown below. - -```{note} -The code below is simply a copy of the default auto update class's 'GUI Callbacks' section. The user can modify any of the methods to suit their needs but we suggest to have a look at the 'GUI Callbacks' section and the 'Update Functions' section of the default auto update class to understand how to implement the custom auto update class. -``` - -```python -from __future__ import annotations - -from typing import TYPE_CHECKING - -from bec_widgets.widgets.containers.auto_update.auto_updates import AutoUpdates - -if TYPE_CHECKING: # pragma: no cover - from bec_lib.messages import ScanStatusMessage - - -class PXIIIUpdate(AutoUpdates): - - ####################################################################### - ################# GUI Callbacks ####################################### - ####################################################################### - - def on_start(self) -> None: - """ - Procedure to run when the auto updates are enabled. - """ - self.start_default_dock() - - def on_stop(self) -> None: - """ - Procedure to run when the auto updates are disabled. - """ - - def on_scan_open(self, msg: ScanStatusMessage) -> None: - """ - Procedure to run when a scan starts. - - Args: - msg (ScanStatusMessage): The scan status message. - """ - if msg.scan_name == "line_scan" and msg.scan_report_devices: - return self.simple_line_scan(msg) - if msg.scan_name == "grid_scan" and msg.scan_report_devices: - return self.simple_grid_scan(msg) - if msg.scan_report_devices: - return self.best_effort(msg) - return None - - def on_scan_closed(self, msg: ScanStatusMessage) -> None: - """ - Procedure to run when a scan ends. - - Args: - msg (ScanStatusMessage): The scan status message. - """ - - def on_scan_abort(self, msg: ScanStatusMessage) -> None: - """ - Procedure to run when a scan is aborted. - - Args: - msg (ScanStatusMessage): The scan status message. - """ - -``` - - -````{important} -In order for the custom auto update method to be found, the class must be added to the `__init__.py` file of the `auto_updates` folder. This should be done already when the plugin repository is created but it is worth mentioning here. If not, the user can add the following line to the `__init__.py` file: -```python -from .auto_updates import * -``` -```` - - diff --git a/docs/user/getting_started/getting_started.md b/docs/user/getting_started/getting_started.md deleted file mode 100644 index 1aeaa8a2..00000000 --- a/docs/user/getting_started/getting_started.md +++ /dev/null @@ -1,15 +0,0 @@ -(user.getting_started)= -# Getting Started -This section provides a comprehensive guide to getting started with BEC Widgets. Whether you are new to BEC Widgets or looking to refresh your knowledge, this guide will help you set up and navigate the framework with ease. - -```{toctree} ---- -maxdepth: 2 -hidden: true ---- - -installation/ -quick_start/ -auto_updates/ -video_tutorials/ -``` \ No newline at end of file diff --git a/docs/user/getting_started/gui_complex_gui.gif b/docs/user/getting_started/gui_complex_gui.gif deleted file mode 100644 index 8d712bde..00000000 Binary files a/docs/user/getting_started/gui_complex_gui.gif and /dev/null differ diff --git a/docs/user/getting_started/installation.md b/docs/user/getting_started/installation.md deleted file mode 100644 index baf1a965..00000000 --- a/docs/user/getting_started/installation.md +++ /dev/null @@ -1,32 +0,0 @@ -(user.installation)= -# Installation -**Prerequisites** - -Before installing BEC Widgets, please ensure the following requirements are met: - -1. **Python Version:** BEC Widgets requires Python version 3.11 or higher. Verify your Python version to ensure compatibility. -2. **BEC Installation:** BEC Widgets works in conjunction with BEC. While BEC is a dependency and will be installed automatically, you can find more information about BEC and its installation process in the [BEC documentation](https://beamline-experiment-control.readthedocs.io/en/latest/). - -**Standard Installation** - -To install BEC Widgets using the pip package manager, execute the following command in your terminal for getting the -default PySide6 version into your python environment for BEC: - - -```bash -pip install 'bec_widgets[pyside6]' -``` - -**Troubleshooting** - -If you encounter issues during installation, particularly with Qt, try purging the pip cache: - -```bash -pip cache purge -``` - -This can resolve conflicts or issues with package installations. - -```{warning} -At the moment PyQt6 is no longer officially supported by BEC Widgets due to incompatibilities with BEC Designer. Please use PySide6 instead. -``` diff --git a/docs/user/getting_started/launcher.png b/docs/user/getting_started/launcher.png deleted file mode 100644 index e1704257..00000000 Binary files a/docs/user/getting_started/launcher.png and /dev/null differ diff --git a/docs/user/getting_started/quick_start.md b/docs/user/getting_started/quick_start.md deleted file mode 100644 index c2263e4f..00000000 --- a/docs/user/getting_started/quick_start.md +++ /dev/null @@ -1,144 +0,0 @@ -(user.command_line_introduction)= -# Quick start -In order to use BEC Widgets as a plotting tool for BEC, it needs to be [installed](#user.installation) in the same Python environment as the BEC IPython client (please refer to the [BEC documentation](https://bec.readthedocs.io/en/latest/user/command_line_interface.html#start-up) for more details). Upon startup, the client will automatically launch a GUI and store it as a `gui` object in the client. The GUI backend will also be automatically connect to the BEC server, giving access to all information on the server and allowing the user to visualize the data in real-time. - -## BECGuiClient -The `gui` object is the main entry point for interacting with the BEC Widgets framework. It is an instance of the {py:class}`~bec_widgets.cli.client_utils.BECGuiClient` class, which provides methods to create and manage GUI components. Upon BEC startup, a default {py:class}`~bec_widgets.cli.client.BECDockArea` instance named *bec* is automatically launched. - -A launcher interface is available via the top menu bar under New → Open Launcher. This opens a window where users can launch a new {py:class}`~bec_widgets.cli.client.BECDockArea` instance, an [AutoUpdate](#user.auto_updates) instance, individual widgets or a custom *ui file* created with *BEC Designer*. Alternatively, users can launch a new {py:class}`~bec_widgets.cli.client.BECDockArea` from the command line: - -```python -dock_area = gui.new() # launches a new BECDockArea instance -gui.new('my_dock_area') # launches a new BECDockArea instance with the name 'my_dock_area' -dock_area2 = gui.my_dock_area # Dynamic attribute access to created dock_area -``` - -``` {note} -If a name is provided, the new dock area will use that name. If the name already exists, an error is raised. If no name is specified, a name will be auto-generated following the pattern *dock_area_ii* where *ii* is the next available number. Named dock areas can be accessed dynamically as attributes of the gui object. -``` - - -## BECDockArea -The {py:class}`~bec_widgets.cli.client.BECDockArea` is a versatile container for quickly building customized GUIs. It supports adding new widgets either through the CLI or directly via toolbar actions. Widgets must be added into {py:class}`~bec_widgets.cli.client.BECDockArea` instances, which serve as the individual containers. These docks can be arranged freely, detached from the main window, and used as floating panels. - -From the CLI, you can create new docks like this: - -```python -dock_area = gui.new() -dock = dock_area.new(name='my_dock_area') -dock = gui.new().new() -``` - - - -## Widgets -Widgets are the building blocks of the BEC Widgets framework. They are the visual components that allow users to interact with the data and control the behavior of the application. Each dock can contain multiple widgets, albeit we recommend for most use cases a single widget per dock. BEC Widgets provides a set of core widgets (cf. {ref}`user.widgets`). More widgets can be added by the users, and we invite you to explore the {ref}`developer.widgets` to learn how to create custom widgets. -For the introduction given here, we will focus on the plotting widgets of BECWidgets. - - - -**Waveform Plot** - - The {py:class}`~bec_widgets.cli.client.Waveform` is a widget that can be used to visualize 1D waveform data, i.e. to plot data of a monitor against a motor position. The method {py:meth}`~bec_widgets.cli.client.Waveform.plot` returns the plot object. - -```python -plt = gui.new().new().new(gui.available_widgets.Waveform) -plt.plot(device_x='samx', device_y='bpm4i') -``` -Here, we create a new plot with a subscription to the devices `samx` and `bpm4i` and assign the plot to the object `plt`. We can now use this object to further customize the plot, e.g. changing the title (`title`), axis labels (`x_label`) - - -We invite you to explore the API of the WaveForm in the {ref}`user.widgets.waveform_1d` or directly in the command line. - -To plot custom data, i.e. data that is not directly available through a scan in BEC, we can use the same method, but provide the data directly to the plot. - -```python -plt = gui.new().new().new(gui.available_widgets.Waveform) -# -plt.plot([1,2,3,4], [1,4,9,16]) -# or -plt.plot(x=np.array([1,2,3,4]), y=np.array([1,4,9,16])) -# or -plt.plot(np.random.rand(10,2)) -# or if you like to receive the custom curve item -curve = plt.plot(x=[1,2,3,4], y=[1,4,9,16]) -``` - -**Scatter Plot** - -The {py:class}`~bec_widgets.cli.client.Waveform` widget can also be used to visualize 2D scatter plots. More details on setting up the scatter plot are available in the widget documentation of the {ref}`user.widgets.scatter_2d`. - -**Motor Map** - -The {py:class}`~bec_widgets.cli.client.MotorMap` widget can be used to visualize the position of motors. It's focused on tracking and visualizing the position of motors, crucial for precise alignment and movement tracking during scans. More details on setting up the motor map are available in the widget documentation of the {ref}`user.widgets.motor_map`. - -**Image Plot** - -The {py:class}`~bec_widgets.cli.client.Image` widget can be used to visualize 2D image data for example a camera. More details on setting up the image plot are available in the widget documentation of the {ref}`user.widgets.image`. - -### Useful Commands -We recommend users to explore the API of the widgets by themselves since we assume that the user interface is supposed to be intuitive and self-explanatory. We appreciate feedback from user in order to constantly improve the experience and allow easy access to the gui, widgets and their functionality. We recommend checking the {ref}`user.api_reference`, but also by using BEC Widgets, exploring the available functions and check their dockstrings. -```python -gui.new? # shows the dockstring of the new method -``` - -In addition, we list below a few useful commands that can be used to interface with the widgets: - -```python -gui.windows # Returns a dictionary of all dock areas in the GUI -gui.new() # Adds a new BECDockArea to the GUI - -dock_area = gui.windows['bec'] -dock = dock_area.new('my_dock') # Adds a new dock named 'my_dock' to the dock area -plt = dock.new(gui.available_widgets.Waveform) # Adds a Waveform widget to the dock - -# Alternative syntax: -# dock_area.my_dock.new(gui.available_widgets.Waveform) - -dock.element_list # Returns a list of all widgets in the dock -dock.elements # Equivalent to dock.element_list - -plt.curves # Returns a list of all curves in the plot -``` - -We note that commands can also be chained. For example, `gui.new().new().new(gui.available_widgets.Waveform)` will add a new dock_area to the gui and add a new dock with a `Waveform` widget to the dock. - -## Composing a larger GUI -The example given above introduces BEC Widgets with its different components, and provides an overview of how to interact with the widgets. Nevertheless, another power aspect of BEC Widgets lies in the ability to compose a larger GUI with multiple docks and widgets. This section aims to provide a tutorial like guide on how to compose a more complex GUI that (A) live-plots a 1D waveform, (B) plots data from a camera, and (C) tracks the positions of two motors. -Let's assume BEC was just started and the `gui` object is available in the client. A single dock is already attached together with a BEC Figure. Let's add the 1D waveform to this dock, change the color of the line to white and add the title *1D Waveform* to the plot. - -```python -dock_area = gui.new() -plt = dock_area.new().new(gui.available_widgets.Waveform) -plt.plot(device_x='samx', device_y='bpm4i') -plt.curves[0].set_color(color="white") -plt.title = '1D Waveform' -``` - -Next, we add 2 new docks to the gui, one to plot the data of a camera and one to track the positions of two motors. -```ipython -cam_widget= dock_area.new().new(gui.available_widgets.Image) -cam_widget.image("eiger") -motor_widget = dock_area.new().new(gui.available_widgets.MotorMap) -motor_widget.map("samx", "samy") -``` - -Note, we chain commands here which is possible since the `new()` and `new()` methods return the dock and the widget respectively. We can now further customize the widgets by changing the title, axis labels, etc. - -```python -cam_widget.title = "Camera Image Eiger" -cam_widget.vrange = [0, 100] -``` -As a final step, we can now add also a RingProgressBar to a new dock, and perform a grid_scan with the motors *samx* and *samy*. -As you see in the example below, all docks are arranged below each other. This is the default behavior of the `new()` method. However, the docks can be freely arranged by drag and drop as desired by the user. We invite you to explore this by yourself following the example in the video, and build your custom GUI with BEC Widgets. - -```python -prog_bar = dock_area.new().new(gui.available_widgets.RingProgressBar) -prog_bar.set_line_widths(15) -scans.grid_scan(dev.samy, -2, 2, 10, dev.samx, -5, 5, 10, exp_time=0.1, relative=False) -``` - -![gui_complex_gui](./gui_complex_gui.gif) - diff --git a/docs/user/getting_started/video_tutorials.md b/docs/user/getting_started/video_tutorials.md deleted file mode 100644 index 8dccfb54..00000000 --- a/docs/user/getting_started/video_tutorials.md +++ /dev/null @@ -1,17 +0,0 @@ -(user.video_tutorials)= - -# Video Tutorials - -This section includes video tutorials that demonstrate various use cases of `bec-widgets`, including video tutorials, -presentations, and conference talks. - -## BSEG Meeting 24th July 2024 - -This video is a presentation of the BEC Widgets project at the BSEG meeting on the 24th July 2024. The presentation -covers the basic interactions, including visualization of live data acquisition and how to steer experiments using -user-friendly tools. Learn how BEC Widgets can enhance your experimental control projects with its intuitive interface -and powerful features. - -Used version of BEC Widgets: 0.91.0 - - \ No newline at end of file diff --git a/docs/user/plugin_widgets.md b/docs/user/plugin_widgets.md deleted file mode 100644 index e71eb020..00000000 --- a/docs/user/plugin_widgets.md +++ /dev/null @@ -1,58 +0,0 @@ -(user.plugin_widgets)= -# Plugin repository widgets - -## Adding widgets to the plugin repository - -Widgets can be created by users and added to a beamline plugin repository, then they can be used in -all the same ways as built-in widgets. To make this work, the widget author should follow a few -simple guidelines. - -Widgets should be added in `plugin_repo.bec_widgets.widgets`. They may be added in submodules. If -so, please make sure that these are properly defined python submodules with `__init__.py` files, so -that the widgets are discoverable. - -### Preparing a widget to be a plugin - -- make sure that the widget class inherits from both `BECWidget` as well as `QWidget` or a subclass - of it, such as `QComboBox` or `QLineEdit`. -- make sure it initialises each of these superclasses in its `__init__()` method, and passes the - `parent` keyword argument on to `QWidget.__init__()`. -- add `PLUGIN = True` as a class variable to the widget class -- add `USER_ACCESS = [...]`, including any methods and properties which should be accessible in the - client to the list, as strings. - -(Search the `bec_widgets` code for one of the above names for examples of these magic variables) - -### Example / template - -```Python -class TestWidget(BECWidget, QWidget): - USER_ACCESS = ["set_text"] - PLUGIN = True - - def __init__(self, parent=None, **kwargs): - super().__init__(**kwargs) - QWidget.__init__(self, parent=parent) - self.setLayout(QHBoxLayout()) - self._text_widget = QLabel("Test widget text") - self.layout().addWidget(self._text_widget) - - def set_text(self, value: str): - self._text_widget.setText(value) -``` - -### Generating the plugin files and RPC client template - -To allow the BEC client to communicate with the GUI server and to know which widgets are available, -as well as to allow the BEC Designer to find the available widgets, a code generation tool should be -run to prepare a client file which lists all the available widget classes and functions. Make sure -you are in the BEC python environment where your plugin repository is also installed, and run: - -```bash -$ bw-generate-cli --target plugin_repo -``` - -replacing `plugin_repo` with the name of your repository. This will overwrite the file for -`plugin_repo.bec_widgets.client`. This file should not be edited by hand, and should always be -regenerated when changes are made to widgets in the plugin repository. BEC will need to be restarted -for changes made here to take effect. \ No newline at end of file diff --git a/docs/user/user.md b/docs/user/user.md deleted file mode 100644 index f150e8ec..00000000 --- a/docs/user/user.md +++ /dev/null @@ -1,80 +0,0 @@ -(user)= -# User -Welcome to the User section of the BEC Widgets documentation! BEC Widgets is a versatile GUI framework tailored for beamline scientists, enabling efficient and intuitive interaction with beamline experiments. This section is designed to guide both new and experienced users through the essential aspects of utilizing BEC Widgets. - -```{toctree} ---- -maxdepth: 2 -hidden: false ---- - -customisation.md -plugin_widgets.md -``` - -```{toctree} ---- -maxdepth: 2 -hidden: true ---- - -getting_started/getting_started.md -applications/applications.md -widgets/widgets.md -api_reference/api_reference.md -``` - -*** - -````{grid} 2 -:gutter: 5 - -```{grid-item-card} -:link: user.getting_started -:link-type: ref -:img-top: /assets/rocket_launch_48dp.svg -:text-align: center -:class-item: index-card - -## Getting Started - -Learn how to install BEC Widgets and get started with the framework. -``` - -```{grid-item-card} -:link: user.applications -:link-type: ref -:img-top: /assets/display_settings_48dp.svg -:text-align: center -:class-item: index-card - -## Applications - -Learn how to use BEC Widgets Applications, to modify and create new applications. - -``` - -```{grid-item-card} -:link: user.widgets -:link-type: ref -:img-top: /assets/apps_48dp.svg -:text-align: center -:class-item: index-card - -## Widgets - -Learn about the building blocks of larger applications: widgets. -``` - -```{grid-item-card} -:link: user.api_reference -:link-type: ref -:img-top: /assets/index_api.svg -:text-align: center -:class-item: index-card - -## API reference - -Comprehensive reference of all user-facing classes, functions, and methods. -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/bec_progressbar/bec_progressbar.md b/docs/user/widgets/bec_progressbar/bec_progressbar.md deleted file mode 100644 index 51f4bddf..00000000 --- a/docs/user/widgets/bec_progressbar/bec_progressbar.md +++ /dev/null @@ -1,42 +0,0 @@ -(user.widgets.bec_progressbar)= -# BEC Progressbar - -```{tab} Overview - -The {py:class}`~bec_widgets.cli.client.BECProgressBar` widget is a general purpose progress bar that follows the BEC theme and style. It can be embedded in any application to display the progress of a task or operation. - -## Key Features: -- **Modern Design**: The BEC Progressbar widget is designed with a modern and sleek appearance, following the BEC theme. -- **Customizable**: Users can customize the appearance and behavior of the progress bar to suit their application. -- **Responsive**: The progress bar updates in real-time to reflect the progress of the task or operation. - -## Screenshot -![BEC Progressbar](./bec_progressbar_running.png) -![BEC Progressbar](./bec_progressbar_completed.png) - -``` - -````{tab} Examples - -The `BECProgressBar` widget can be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. Below are examples demonstrating how to create and use the `BECProgressBar` widget. - -## Example 1 - Adding BEC Status Box to BECDockArea - -In this example, we demonstrate how to add a `BECProgressBar` widget to a `BECDockArea`, allowing users to manually set and update the progress states. - -```python -# Add a new dock with a BEC Progressbar widget -dock_area = gui.new() -pb = dock_area.new().new(gui.available_widgets.BECProgressBar) -pb.set_value(50) -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.BECProgressBar - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/bec_progressbar/bec_progressbar_completed.png b/docs/user/widgets/bec_progressbar/bec_progressbar_completed.png deleted file mode 100644 index 40563797..00000000 Binary files a/docs/user/widgets/bec_progressbar/bec_progressbar_completed.png and /dev/null differ diff --git a/docs/user/widgets/bec_progressbar/bec_progressbar_running.png b/docs/user/widgets/bec_progressbar/bec_progressbar_running.png deleted file mode 100644 index 072db4bc..00000000 Binary files a/docs/user/widgets/bec_progressbar/bec_progressbar_running.png and /dev/null differ diff --git a/docs/user/widgets/bec_status_box/bec_status_box.gif b/docs/user/widgets/bec_status_box/bec_status_box.gif deleted file mode 100644 index 757833aa..00000000 Binary files a/docs/user/widgets/bec_status_box/bec_status_box.gif and /dev/null differ diff --git a/docs/user/widgets/bec_status_box/bec_status_box.md b/docs/user/widgets/bec_status_box/bec_status_box.md deleted file mode 100644 index 539507c9..00000000 --- a/docs/user/widgets/bec_status_box/bec_status_box.md +++ /dev/null @@ -1,40 +0,0 @@ -(user.widgets.bec_status_box)= -# BEC Status Box - -````{tab} Overview - -The {py:class}`~bec_widgets.cli.client.BECStatusBox` widget is designed to monitor the status and health of all running BEC processes. This widget provides a real-time overview of the BEC core services, including DeviceServer, ScanServer, SciHub, ScanBundler, and FileWriter. The top-level display indicates the overall state of the BEC services, while the collapsed view allows users to delve into the status of each individual process. By double-clicking on a specific process, users can access a detailed popup window with live updates of the metrics for that process. - -## Key Features: -- **Comprehensive Service Monitoring**: Track the state of individual BEC services, including real-time updates on their health and status. -- **Automatic Service Tracking**: Automatically detects and monitors additional clients connecting to the BEC services. -- **Detailed Metrics**: Provides live updates of the metrics for each process, accessible through an interactive popup window. - -![BECStatus](./bec_status_box.gif) -```` - -````{tab} Examples - -The `BECStatusBox` widget can be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. Below are examples demonstrating how to create and use the `BECStatusBox` widget. - -## Example 1 - Adding BEC Status Box to BECDockArea - -In this example, we demonstrate how to add a `BECStatusBox` widget to a `BECDockArea`, allowing users to monitor the status of BEC processes directly from the GUI. - -```python -# Add a new dock with a BECStatusBox widget -sb = gui.bec.new().new(widget=gui.available_widgets.BECStatusBox) -``` - -```{hint} -Once the `BECStatusBox` is added, users can interact with it to view the status of individual processes. By expanding the view, you can see the status of each BEC service in detail. -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.BECStatusBox - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/buttons_appearance/buttons_appearance.md b/docs/user/widgets/buttons_appearance/buttons_appearance.md deleted file mode 100644 index 5d7550eb..00000000 --- a/docs/user/widgets/buttons_appearance/buttons_appearance.md +++ /dev/null @@ -1,159 +0,0 @@ -(user.widgets.buttons_appearance)= - -# Appearance Buttons - -`````{tab} Overview -This section consolidates various buttons designed to manage the appearance of the BEC GUI, allowing users to easily switch themes, select colors, and choose colormaps. - -## Dark Mode Button - -The `Dark Mode Button` is a toggle control that allows users to switch between light and dark themes in the BEC GUI. It provides a convenient way to adjust the interface's appearance based on user preferences or environmental conditions. - -````{grid} 2 -:gutter: 2 - -```{grid-item-card} Dark Mode -:img-top: ./dark_mode_enabled.png -``` - -```{grid-item-card} Light Mode -:img-top: ./dark_mode_disabled.png -``` -```` - -**Key Features:** -- **Theme Switching**: Enables users to switch between light and dark themes with a single click. -- **Configurable from BEC Designer**: The defaults for the dark mode can be set in the BEC Designer, allowing users to customize the startup appearance of the GUI. - -## Color Button - -The `Color Button` is a user interface element that provides a dialog to select colors. This button, adapted from `pyqtgraph`, is a simple yet powerful tool to integrate color selection functionality into the BEC GUIs. - -**Key Features:** -- **Color Selection**: Opens a dialog for selecting colors, returning the selected color in both RGBA and HEX formats. - -## Colormap Selector - -The `Colormap Selector` is a specialized combobox that allows users to select a colormap. It includes a preview of the colormap, making it easier for users to choose the appropriate one for their needs. - -**Key Features:** -- **Colormap Selection**: Provides a dropdown to select from all available colormaps in `pyqtgraph`. -- **Visual Preview**: Displays a small preview of the colormap next to its name, enhancing usability. - -## Colormap Button - -The `Colormap Button` is a custom widget that displays the current colormap and, upon clicking, shows a nested menu for selecting a different colormap. It integrates the `ColorMapMenu` from `pyqtgraph`, providing an intuitive and interactive way for users to choose colormaps within the GUI. - -**Key Features:** -- **Current Colormap Display**: Shows the name and a gradient icon of the current colormap directly on the button. -- **Nested Menu Selection**: Offers a nested menu with categorized colormaps, making it easy to find and select the desired colormap. -- **Signal Emission**: Emits a signal when the colormap changes, providing the new colormap name as a string. -- **BEC Designer Integration**: Exposes properties and signals to be used within BEC Designer, allowing for customization within the designer interface. -- **Resizable and Styled**: Features adjustable size policies and styles to match the look and feel of standard `QPushButton` widgets, including rounded edges. -````` - -````{tab} Examples - -Integrating these buttons into a BEC GUI layout is straightforward. The following examples demonstrate how to embed these buttons within a custom GUI layout using `QtWidgets`. - -## Example 1 - Adding a Dark Mode Button - -```python -from qtpy.QtWidgets import QWidget, QVBoxLayout -from bec_widgets.widgets.buttons import DarkModeButton - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) - - # Create and add the DarkModeButton to the layout - self.dark_mode_button = DarkModeButton(parent=self) - self.layout().addWidget(self.dark_mode_button) - -# Example of how this custom GUI might be used: -my_gui = MyGui() -my_gui.show() -``` - -## Example 2 - Adding a Color Button - -```python -from qtpy.QtWidgets import QWidget, QVBoxLayout -from bec_widgets.widgets.buttons import ColorButton - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) - - # Create and add the ColorButton to the layout - self.color_button = ColorButton(self) - self.layout().addWidget(self.color_button) - -# Example of how this custom GUI might be used: -my_gui = MyGui() -my_gui.show() -``` - -## Example 3 - Adding a Colormap Selector - -```python -from qtpy.QtWidgets import QWidget, QVBoxLayout -from bec_widgets.widgets.buttons import ColormapSelector - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) - - # Create and add the ColormapSelector to the layout - self.colormap_selector = ColormapSelector(self) - self.layout().addWidget(self.colormap_selector) - -# Example of how this custom GUI might be used: -my_gui = MyGui() -my_gui.show() -``` - -## Example 4 - Adding a Colormap Button - -```python -from qtpy.QtWidgets import QWidget, QVBoxLayout -from bec_widgets.widgets.buttons import ColormapButton - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) - - # Create and add the ColormapButton to the layout - self.colormap_button = ColormapButton(self) - self.layout().addWidget(self.colormap_button) - - # Connect the signal to handle colormap changes - self.colormap_button.colormap_changed_signal.connect(self.on_colormap_changed) - - def on_colormap_changed(self, colormap_name): - print(f"Selected colormap: {colormap_name}") - -# Example of how this custom GUI might be used: -my_gui = MyGui() -my_gui.show() -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.DarkModeButton - :members: - :show-inheritance: -.. autoclass:: bec_widgets.cli.client.ColorButton - :members: - :show-inheritance: -.. autoclass:: bec_widgets.cli.client.ColormapSelector - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/buttons_appearance/dark_mode_disabled.png b/docs/user/widgets/buttons_appearance/dark_mode_disabled.png deleted file mode 100644 index bf13b8ae..00000000 Binary files a/docs/user/widgets/buttons_appearance/dark_mode_disabled.png and /dev/null differ diff --git a/docs/user/widgets/buttons_appearance/dark_mode_enabled.png b/docs/user/widgets/buttons_appearance/dark_mode_enabled.png deleted file mode 100644 index a19d5bd6..00000000 Binary files a/docs/user/widgets/buttons_appearance/dark_mode_enabled.png and /dev/null differ diff --git a/docs/user/widgets/buttons_queue/button_queue.md b/docs/user/widgets/buttons_queue/button_queue.md deleted file mode 100644 index c269683e..00000000 --- a/docs/user/widgets/buttons_queue/button_queue.md +++ /dev/null @@ -1,86 +0,0 @@ -(user.widgets.buttons_queue)= - -# Queue Control Buttons - -```{tab} Overview -This section consolidates various buttons designed to manage the BEC scan queue, providing essential controls for operations like stopping, resuming, aborting, and resetting the scan queue. - -## Stop Button - -The `Stop Button` is a specialized control that provides an immediate interface to halt ongoing operations in the BEC Client. It is essential for scenarios where operations need to be terminated quickly, such as in the case of an error or when an operation needs to be interrupted by the user. - -**Key Features:** -- **Immediate Termination**: Instantly halts the execution of the current script or process. -- **Queue Management**: Stops the current scan or the entire scan queue. - -## Resume Button - -The `Resume Button` allows users to continue the paused scan queue. It’s useful in scenarios where the scan queue has been halted and needs to be resumed. - -**Key Features:** -- **Queue Continuation**: Resumes the scan queue after a pause. -- **Toolbar and Button Options**: Can be configured as a toolbar button or a standard push button. - -## Abort Button - -The `Abort Button` provides an interface to abort a specific scan or the entire queue. This is useful for scenarios where an operation needs to be terminated but in a controlled manner. - -**Key Features:** -- **Scan Abortion**: Aborts the current scan or a specific scan in the queue. -- **Toolbar and Button Options**: Can be configured as a toolbar button or a standard push button. - -## Reset Queue Button - -The `Reset Button` is used to reset the scan queue. It prompts the user for confirmation before resetting, ensuring that the action is intentional. - -**Key Features:** -- **Queue Reset**: Resets the entire scan queue. -- **Confirmation Dialog**: Prompts the user to confirm the reset action to prevent accidental resets. -- **Toolbar and Button Options**: Can be configured as a toolbar button or a standard push button. -``` - -````{tab} Examples - -Integrating these buttons into a BEC GUI layout is straightforward. The following examples demonstrate how to embed these buttons within a custom GUI layout using `QtWidgets`. - -### Example 1 - Embedding a Stop Button in a Custom GUI Layout - -```python -import sys -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.control.buttons.stop_button.stop_button import StopButton - -class MyGui(QWidget): - def __init__(self): - super().__init__() - self.setLayout(QVBoxLayout()) - # Create and add the StopButton to the layout - self.stop_button = StopButton() - self.layout().addWidget(self.stop_button) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -`ResumeButton`, `ResetButton`, and `AbortButton` may be used in an exactly analogous way. -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.StopButton - :members: - :show-inheritance: -.. autoclass:: bec_widgets.cli.client.ResumeButton - :members: - :show-inheritance: -.. autoclass:: bec_widgets.cli.client.AbortButton - :members: - :show-inheritance: -.. autoclass:: bec_widgets.cli.client.ResetButton - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/dap_combo_box/dap_combo_box.md b/docs/user/widgets/dap_combo_box/dap_combo_box.md deleted file mode 100644 index 2778f77b..00000000 --- a/docs/user/widgets/dap_combo_box/dap_combo_box.md +++ /dev/null @@ -1,41 +0,0 @@ -(user.widgets.dap_combo_box)= - -# DAP Combobox - -````{tab} Overview - -The {py:class}`~bec_widgets.widgets.dap_combo_box.dap_combo_box.DAPComboBox` is a widget that extends the functionality of a standard `QComboBox` to allow the user to select a DAP process from all available DAP models. -One of its signals `new_dap_config` is designed to be connected to the {py:class}`~bec_widgets.widgets.plots.waveform.waveform.Waveform.add_dap_curve` slot from the Waveform widget to add a DAP process. - -## Key Features: -- **Select DAP model**: Select one of the available DAP models. -- **Signal/Slot Interaction**: Signal and slots to configure the fit_model, x_axis, and y_axis, and to add a DAP model to the BECWaveformWidget. -```{figure} /assets/widget_screenshots/dap_combo_box.png ---- -name: lmfit_dialog ---- -LMFit Dialog -``` -```` -````{tab} Summary of Signals -The following signals are emitted by the `DAP ComboBox` widget: -- `new_dap_config(str, str, str)` : Signal to add a DAP model to the BECWaveformWidget -- `x_axis_updated(str)` : Signal to emit the current x axis -- `y_axis_updated(str)` : Signal to emit the current y axis -- `fit_model_updated(str)` : Signal to emit the current fit model -```` -````{tab} Summary of Slots -The following slots are available for the `DAP ComboBox` widget: -- `select_x_axis(str)` : Slot to select the current x axis, emits the `x_axis_updated` signal -- `select_y_axis(str)` : Slot to select the current y axis, emits the `x_axis_updated` signal -- `select_fit_model(str)` : Slot to select the current fit model, emits the `fit_model_updated` signal. If x and y axis are set, it will also emit the `new_dap_config` signal. -```` - - - - - - - - - diff --git a/docs/user/widgets/device_browser/device_browser.md b/docs/user/widgets/device_browser/device_browser.md deleted file mode 100644 index 909e4ea0..00000000 --- a/docs/user/widgets/device_browser/device_browser.md +++ /dev/null @@ -1,41 +0,0 @@ -(user.widgets.device_browser)= - -# Device Browser - -````{tab} Overview - -The {py:class}`~bec_widgets.cli.client.DeviceBrowser` widget provides a user-friendly interface for browsing through all available devices in the current BEC session. As it supports drag functionality, users can easily drag and drop device into other widgets or applications. - -```{note} -The `Device Browser` widget is currently under development. Other widgets may not support drag and drop functionality yet. -``` - -## Key Features: -- **Device Search**: Allows users to search for devices using regular expressions. -- **Drag and Drop**: Supports drag and drop functionality for easy transfer of devices to other widgets or applications. - -```{figure} ./device_browser.png -``` -```` - -````{tab} Examples - -In this example, we demonstrate how to add a `DeviceBrowser` widget to a `BECDockArea` to visualize the progress of a task. - -```python -# Add a new dock with a DeviceBrowser widget -dock_area = gui.new() -browser = dock_area.new("device_browser").new(gui.available_widgets.DeviceBrowser) -# You can also access the DeviceBrowser widget directly from the dock_area -dock_area.device_browser.DeviceBrowser -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.DeviceBrowser - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/device_browser/device_browser.png b/docs/user/widgets/device_browser/device_browser.png deleted file mode 100644 index 281caff5..00000000 Binary files a/docs/user/widgets/device_browser/device_browser.png and /dev/null differ diff --git a/docs/user/widgets/device_input/QProperties_DeviceInput.png b/docs/user/widgets/device_input/QProperties_DeviceInput.png deleted file mode 100644 index aef534a4..00000000 Binary files a/docs/user/widgets/device_input/QProperties_DeviceInput.png and /dev/null differ diff --git a/docs/user/widgets/device_input/device_input.md b/docs/user/widgets/device_input/device_input.md deleted file mode 100644 index ac051b9c..00000000 --- a/docs/user/widgets/device_input/device_input.md +++ /dev/null @@ -1,129 +0,0 @@ -(user.widgets.device_input)= - -# Device Input Widgets - -````{tab} Overview - -The `Device Input Widgets` consist of two primary widgets: `DeviceLineEdit` and `DeviceComboBox`. Both widgets are designed to facilitate the selection of devices within the BEC environment, allowing users to filter, search, and select devices dynamically. These widgets are highly customizable and can be integrated into a GUI either through direct code instantiation or by using `BEC Designer`. - -## DeviceLineEdit -The `DeviceLineEdit` widget provides a line edit interface with autocomplete functionality for device names, making it easier for users to quickly search and select devices. - -## DeviceComboBox -The `DeviceComboBox` widget offers a dropdown interface for device selection, providing a more visual way to browse through available devices. - -## Key Features: -- **Device Filtering**: Both widgets allow users to filter devices by device type and readout priority, ensuring that only relevant devices are shown. -- **Default Device Setting**: Users can set a default device to be pre-selected when the widget is initialized. -- **Set Device Selection**: Both widgets allow users to set the available devices to be displayed independent of the applied filters. -- **Real-Time Autocomplete (LineEdit)**: The `DeviceLineEdit` widget supports real-time autocomplete, helping users find devices faster. -- **Real-Time Input Validation (LineEdit)**: User input is validated in real-time with a red border around the `DeviceLineEdit` indicating an invalid input. -- **Dropdown Selection (ComboBox)**: The `DeviceComboBox` widget displays devices in a dropdown list, making selection straightforward. -- **BEC Designer Integration**: Both widgets can be added as custom widgets in `BEC Designer` or instantiated directly in code. - -## Screenshot -```{figure} /assets/widget_screenshots/device_inputs.png -``` - -```` - -````{tab} Examples - -Both `DeviceLineEdit` and `DeviceComboBox` can be integrated within a GUI application through direct code instantiation or by using `BEC Designer`. Below are examples demonstrating how to create and use these widgets. - - -## Example 1 - Creating a DeviceLineEdit in Code - -In this example, we demonstrate how to create a `DeviceLineEdit` widget in code and customize its behavior. -We filter down to Positioners with readout_priority Baseline. -Note, if we do not specify a device_filter or readout_filter, all enabled devices will be included. - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.device_line_edit.device_line_edit import DeviceLineEdit -from bec_lib.device import ReadoutPriority -from bec_widgets.widgets.base_classes.device_input_base import BECDeviceFilter - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - - # Create and add the DeviceLineEdit to the layout - self.device_line_edit = DeviceLineEdit(parent=self, device_filter=BECDeviceFilter.POSITIONER, readout_priority_filter=ReadoutPriority.BASELINE) - self.layout().addWidget(self.device_line_edit) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 2 - Creating a DeviceComboBox in Code - -Similarly, here is an example of creating a `DeviceComboBox` widget in code and customizing its behavior. - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.device_combobox.device_combobox import DeviceComboBox -from bec_lib.device import ReadoutPriority -from bec_widgets.widgets.base_classes.device_input_base import BECDeviceFilter - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - - # Create and add the DeviceComboBox to the layout - self.device_combobox = DeviceComboBox(parent=self, device_filter=BECDeviceFilter.POSITIONER, readout_priority_filter=ReadoutPriority.BASELINE) - self.layout().addWidget(self.device_combobox) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 3 - Setting Default Device - -Both `DeviceLineEdit` and `DeviceComboBox` allow you to set a default device that will be selected when the widget is initialized. - -```python -# Set default device for DeviceLineEdit -self.device_line_edit.set_device("motor1") - -# Set default device for DeviceComboBox -self.device_combo_box.set_device("motor2") - -# Set the available devices to be displayed independent of the applied filters -self.device_combo_box.set_available_devices(["motor1", "motor2", "motor3"]) -``` -```` -````{tab} BEC Designer -Both widgets are also available as plugins for the BEC Designer. We have included Qt properties for both widgets, allowing customization of filtering and default device settings directly from the designer. In addition to the common signals and slots for `DeviceLineEdit` and `DeviceComboBox`, the following slots are available: -- `set_device(str)` to set the default device -- `update_devices()` to refresh the devices list - -The following Qt properties are also included: -```{figure} ./QProperties_DeviceInput.png -``` - -```` - -````{tab} API - ComboBox -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.DeviceComboBox - :members: - :show-inheritance: -``` -```` - -````{tab} API - LineEdit -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.DeviceLineEdit - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/dock_area/BECDockArea.png b/docs/user/widgets/dock_area/BECDockArea.png deleted file mode 100644 index 83e908cf..00000000 Binary files a/docs/user/widgets/dock_area/BECDockArea.png and /dev/null differ diff --git a/docs/user/widgets/dock_area/bec_dock_area.md b/docs/user/widgets/dock_area/bec_dock_area.md deleted file mode 100644 index 84ff80b4..00000000 --- a/docs/user/widgets/dock_area/bec_dock_area.md +++ /dev/null @@ -1,122 +0,0 @@ -(user.widgets.bec_dock_area)= - -# BECDockArea - -````{tab} Overview - -`BECDockArea` is a powerful and flexible container designed to host various widgets and docks within a grid layout. It provides an environment for organizing and managing complex user interfaces, making it ideal for applications that require multiple tools and data visualizations to be displayed simultaneously. BECDockArea is particularly useful for embedding not only visualization tools but also other interactive components, allowing users to tailor their workspace to their specific needs. - -- **Flexible Dock Management**: Easily add, remove, and rearrange docks within `BECDockArea`, providing a customized layout for different tasks. -- **State Persistence**: Save and restore the state of the dock area, enabling consistent user experiences across sessions. -- **Dock Customization**: Add docks with customizable positions, names, and behaviors, such as floating or closable docks. -- **Integration with Widgets**: Integrate various widgets like [`WaveformWidget`](user.widgets.waveform_widget), [`ImageWidget`](user.widgets.image_widget), and [`MotorMapWidget`](user.widgets.motor_map) into `BECDockArea`, either as standalone tools or as part of a more complex interface. - -**BEC Dock Area Components Schema** - -![BECDockArea.png](BECDockArea.png) -```` - -````{tab} Examples - CLI -In the following examples, we will use `BECIPythonClient` as the main object to interact with the `BECDockArea`. These tutorials focus on how to work with the `BECDockArea` framework, such as adding and removing docks, saving and restoring layouts, and managing the docked widgets. By default the `BECDockArea` is referred to as `gui` in `BECIPythonClient`. For more detailed examples of each individual component, please refer to the example sections of each individual [`widget`](user.widgets). - -## Example 1 - Adding Docks to BECDockArea - -In this example, we will demonstrate how to add different docks to a single `BECDockArea` widget. New docks are always added to the bottom of the dock area by default; however, you can specify the position of the dock by using the `position` and `relative_to` arguments. - -```python -# Create a new dock_area from GUI object -dock_area = gui.new() - -# Add a new dock with a Waveform to the BECDockArea -dock_area.new(name="waveform_dock", widget="Waveform") -dock1 = dock_area.waveform_dock # dynamic namespace was created - -# Add a second dock with a MotorMapWidget to the BECDockArea to the right of the first dock -dock2 = dock_area.new(name="motor_dock", widget="MotorMap",relative_to="Waveform Dock", position="right") - -# Add a third dock with an ImageWidget to the BECDockArea, placing it on bottom of the dock area -dock3 = dock_area.new(name="image_dock", widget="Image") -``` - -```{hint} -You can move docks around by dragging them with the mouse using the dock's title bar. The dock will snap to the grid layout of the dock area. -``` - -## Example 2 - Access of Docks in BECDockArea - -Docks can be accessed by their name or by the dock object. The dock object can be used to modify the dock properties or to add widgets to the dock. - -```python -# All docks can be accessed by their name from the panels dictionary -dock_area.panels - -# Output -{'waveform_dock': , - 'motor_dock': , - 'image_dock': } -# Access all docks from the dock area via list -dock_area.panel_list - -# Access through dynamic namespace mapping -dock_area.waveform_dock -dock_area.motor_dock -dock_area.image_dock - -# If objects were closed, we will keep a reference that will indicate that the dock was deleted -# Try closing the window with the dock_area via mouse click on x - -dock_area -# Output - -``` - -## Example 3 - Detaching and Attaching Docks in BECDockArea - -Docks in `BECDockArea` can be detached (floated) or reattached to the main dock area. This is useful when you want to temporarily undock a widget for better visibility or organization. - -```python -# Detach the dock named "Waveform Dock" -dock_area.detach_dock("waveform_dock") -# Alternatively, you can use the dock object to detach the dock -dock1 = dock_area.waveform_dock -dock1.detach() - -# Docks can be individually reattached to the main dock area -dock2.attach() - -# Reattach all floating docks to the main dock area -gui.attach_all() -``` - -```{note} -Floating docks are always returned to the original dock area if they are closed manually. Docks can also be detached by double-clicking on the dock title. -``` - -## Example 4 - Removing Docks from BECDockArea - -Docks can be removed from the dock area by their name or by the dock object. The dock object can be used to remove the dock from the dock area. - -```python -# Removing docks by their name -dock_area.delete("waveform_dock") -# Alternatively, you can use the dock object to remove the dock -dock1 = dock_area.motor_dock -dock1.remove() - -# Removing all docks from the dock area -gui.delete_all() -``` - -```{warning} -When removing a dock, all widgets within the dock will be removed as well. This action cannot be undone, and all references to the dock and its widgets will be lost. -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.BECDockArea - :members: - :show-inheritance: -``` -```` - diff --git a/docs/user/widgets/games/games.md b/docs/user/widgets/games/games.md deleted file mode 100644 index 1608ba71..00000000 --- a/docs/user/widgets/games/games.md +++ /dev/null @@ -1,11 +0,0 @@ -(user.widgets.games)= - -# Game widgets - -To provide some entertainment during long nights at the beamline, there are game widgets available. Well, only one, so far. - -## Minesweeper - -![Minesweeper](./minesweeper.png) - -The classic game Minesweeper. You may select from three different levels. The game can be ended or reset by clicking on the icon in the top-centre (the robot in the screenshot). diff --git a/docs/user/widgets/games/minesweeper.png b/docs/user/widgets/games/minesweeper.png deleted file mode 100644 index f1839569..00000000 Binary files a/docs/user/widgets/games/minesweeper.png and /dev/null differ diff --git a/docs/user/widgets/heatmap/heatmap_fermat_scan.gif b/docs/user/widgets/heatmap/heatmap_fermat_scan.gif deleted file mode 100644 index 779ba237..00000000 Binary files a/docs/user/widgets/heatmap/heatmap_fermat_scan.gif and /dev/null differ diff --git a/docs/user/widgets/heatmap/heatmap_grid_scan.gif b/docs/user/widgets/heatmap/heatmap_grid_scan.gif deleted file mode 100644 index fbea6de2..00000000 Binary files a/docs/user/widgets/heatmap/heatmap_grid_scan.gif and /dev/null differ diff --git a/docs/user/widgets/heatmap/heatmap_widget.md b/docs/user/widgets/heatmap/heatmap_widget.md deleted file mode 100644 index d019f995..00000000 --- a/docs/user/widgets/heatmap/heatmap_widget.md +++ /dev/null @@ -1,108 +0,0 @@ -(user.widgets.heatmap_widget)= - -# Heatmap widget - -````{tab} Overview - -The Heatmap widget is a specialized plotting tool designed for visualizing 2D grid data with color mapping for the z-axis. It excels at displaying data from grid scans or arbitrary step scans, automatically interpolating scattered data points into a coherent 2D image. Directly integrated with the `BEC` framework, it can display live data streams from scanning experiments within the current `BEC` session. - -## Key Features: -- **Flexible Integration**: The widget can be integrated into [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. -- **Live Grid Scan Visualization**: Real-time plotting of grid scan data with automatic positioning and color mapping based on scan parameters. -- **Dual Scan Support**: Handles both structured grid scans (with pre-allocated grids) and unstructured step scans (with interpolation). -- **Intelligent Data Interpolation**: For arbitrary step scans, the widget automatically interpolates scattered (x, y, z) data points into a smooth 2D heatmap using various interpolation methods. -- **Oversampling**: Supports oversampling to enhance the appearance of the heatmap, allowing for smoother transitions and better visual representation of data. Especially useful the for nearest-neighbor interpolation. -- **Customizable Color Maps**: Wide variety of color maps available for data visualization, with support for both simple and full color bars. -- **Real-time Image Processing**: Apply real-time processing techniques such as FFT and logarithmic scaling to enhance data visualization. -- **Interactive Controls**: Comprehensive toolbar with settings for heatmap configuration, crosshair tools, mouse interaction, and data export capabilities. - - -```{figure} ./heatmap_grid_scan.gif -:width: 60% - -Real-time heatmap visualization of a 2D grid scan showing motor positions and detector intensity -``` - -```{figure} ./heatmap_fermat_scan.gif -:width: 80% - -Real-time heatmap visualization of an (not path-optimized) scan following Fermat's spiral pattern. On the left, the heatmap widget is shown with the oversampling option set to 10 and the interpolation method set to nearest neighbor. On the right, the scatter waveform widget is shown with the same data. -``` - - -```` - -````{tab} Examples - CLI - -`HeatmapWidget` can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. The command-line API is the same for all cases. - -## Example 1 - Visualizing Grid Scan Data - -In this example, we demonstrate how to add a `HeatmapWidget` to visualize live data from a 2D grid scan with motor positions and detector readout. - -```python -# Add a new dock with HeatmapWidget -dock_area = gui.new() -heatmap_widget = dock_area.new().new(gui.available_widgets.Heatmap) - -# Plot a heatmap with x and y motor positions and z detector signal -heatmap_widget.plot( - device_x='samx', # X-axis motor - device_y='samy', # Y-axis motor - device_z='bpm4i', # Z-axis detector signal - color_map='plasma' -) -heatmap_widget.title = "Grid Scan - Sample Position vs BPM Intensity" -``` - -## Example 2 - Step Scan with Custom Entries - -This example shows how to visualize data from an arbitrary step scan by specifying custom data entries for each axis. - -```python -# Add a new dock with HeatmapWidget -dock_area = gui.new() -heatmap_widget = dock_area.new().new(gui.available_widgets.Heatmap) - -# Plot heatmap with specific data entries -heatmap_widget.plot( - device_x='motor1', - device_y='motor2', - device_z='detector1', - signal_x='RBV', # Use readback value for x - signal_y='RBV', # Use readback value for y - signal_z='value', # Use main value for z - color_map='viridis', - reload=True # Force reload of data -) -``` - -## Example 3 - Real-time Processing and Customization - -The `Heatmap` widget provides real-time processing capabilities and extensive customization options for enhanced data visualization. - -```python -# Configure heatmap appearance and processing -heatmap_widget.color_map = 'plasma' -heatmap_widget.lock_aspect_ratio = True - -# Apply real-time processing -heatmap_widget.fft = True # Apply FFT to the data -heatmap_widget.log = True # Use logarithmic scaling - -# Configure color bar and range -heatmap_widget.enable_full_colorbar = True -heatmap_widget.v_min = 0 -heatmap_widget.v_max = 1000 - -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.widgets.plots.heatmap.heatmap.Heatmap - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/image/image.gif b/docs/user/widgets/image/image.gif deleted file mode 100644 index 1e352597..00000000 Binary files a/docs/user/widgets/image/image.gif and /dev/null differ diff --git a/docs/user/widgets/image/image_widget.md b/docs/user/widgets/image/image_widget.md deleted file mode 100644 index 52e6a0ff..00000000 --- a/docs/user/widgets/image/image_widget.md +++ /dev/null @@ -1,112 +0,0 @@ -(user.widgets.image_widget)= - -# Image widget - -````{tab} Overview - -The Image widget is a versatile tool designed for visualizing both 1D and 2D data, such as camera images or waveform data, in real-time. Directly integrated with the `BEC` framework, it can display live data streams from connected detectors or other data sources within the current `BEC` session. The widget provides advanced customization options for color maps and scale bars, allowing users to tailor the visualization to their specific needs. - -## Key Features: -- **Flexible Integration**: The widget can be integrated into [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. -- **Live Data Visualization**: Real-time plotting of both 1D and 2D data from detectors or other data sources, provided that a data stream is available in the BEC session. -- **Support for Multiple Monitor Types**: The Image widget supports different monitor types (`'1d'` and `'2d'`), allowing visualization of various data dimensions. It can automatically determine the best way to visualise the data based on the shape of the data source. -- **Customizable Color Maps and Scale Bars**: Users can customize the appearance of images with various color maps and adjust scale bars to better interpret the visualized data. -- **Real-time Image Processing**: Apply real-time image processing techniques directly within the widget to enhance the quality or analyze specific aspects of the data, such as rotation, logarithmic scaling, and Fast Fourier Transform (FFT). -- **Data Export**: Export visualized data to various formats such as PNG, TIFF, or H5 for further analysis or reporting. -- **Interactive Controls**: Offers interactive controls for zooming, panning, and adjusting the visual properties of the images on the fly. - -![Image 2D](./image.gif) -```` - -````{tab} Examples - CLI - -`ImageWidget` can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. The command-line API is the same for all cases. - -## Example 1 - Visualizing 2D Image Data from a Detector - -In this example, we demonstrate how to add an `ImageWidget` to a [`BECDockArea`](user.widgets.bec_dock_area) to visualize live 2D image data from a connected camera detector. - -```python -# Add a new dock with BECFigure widget -dock_area = gui.new() -img_widget = dock_area.new().new(gui.available_widgets.Image) - -# Add an ImageWidget to the BECFigure for a 2D detector -img_widget.image(device='eiger', signal='preview') -img_widget.title = "Camera Image - Eiger Detector" -``` - -## Example 2 - Visualizing 1D Waveform Data from a Detector - -This example demonstrates how to set up the Image widget to visualize 1D waveform data from a detector, such as a line detector or a spectrometer. The widget will stack incoming 1D data arrays to construct a 2D image. - -```python -# Add a new dock with BECFigure widget -dock_area = gui.new() -img_widget = dock_area.new().new(gui.available_widgets.Image) - -# Add an ImageWidget to the BECFigure for a 2D detector -img_widget.image(device='waveform', signal='data') -img_widget.title = "Line Detector Data" - -# Optional: Set the color map and value range -img_widget.colormap = "plasma" -img_widget.vrange= [0, 100] -``` - -## Example 3 - Real-time Image Processing - -The `Image` provides real-time image processing capabilities, such as rotating, scaling, applying logarithmic scaling, and performing FFT on the displayed images. The following example demonstrates how to apply these transformations to an image. - -```python -# Rotate the image by 90 degrees (1,2,3,4 are multiplied by 90 degrees) -img_widget.num_rotation_90 = 1 - -# Transpose the image -img_widget.transpose = True - -# Apply FFT to the image -img_widget.fft = True - -# Set logarithmic scaling for the image display -img_widget.log = True - -# Set autorange for the image color map -img_widget.autorange = True -img_widget.autorange_mode = 'mean'# or 'max' -``` - - - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.Image - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/lmfit_dialog/lmfit_dialog.md b/docs/user/widgets/lmfit_dialog/lmfit_dialog.md deleted file mode 100644 index 1baa244e..00000000 --- a/docs/user/widgets/lmfit_dialog/lmfit_dialog.md +++ /dev/null @@ -1,46 +0,0 @@ -(user.widgets.lmfit_dialog)= - -# LMFit Dialog - -````{tab} Overview - -The `LMFitDialog` is a widget that is developed to be used together with the `Waveform` widget. The `Waveform` widget allows user to submit a fit request to BEC's [DAP server](https://bec.readthedocs.io/en/latest/developer/getting_started/architecture.html) choosing from a selection of [LMFit models](https://lmfit.github.io/lmfit-py/builtin_models.html#) to fit monitored data sources. The `LMFit Dialog` provides an interface to monitor these fits, including statistics and fit parameters in real time. -Within the `Waveform` widget, the dialog is accessible via the toolbar and will be automatically linked to the current waveform widget. For a more customised use, we can embed the `LMFit Dialog` in a larger GUI using the *BEC Designer*. In this case, one has to connect the `update_summary_tree` slot of the LMFit Dialog to the `dap_summary_update` signal of the Waveform widget to ensure its functionality. - - -## Key Features: -- **Fit Summary**: Display updates on LMFit DAP processes and fit statistics. -- **Fit Parameter**: Display current fit parameter. -- **`Waveform` Widget Integration**: Directly connect to `Waveform` widget to display fit statistics and parameters. -```{figure} /assets/widget_screenshots/lmfit_dialog.png ---- -name: lmfit_dialog ---- -LMFit Dialog -``` -```` -````{tab} Connect in BEC Designer -The `LMFit Dialog` widget can be connected to a `Waveform` widget to display fit statistics and parameters from the LMFit DAP process hooked up to the waveform widget. You can use the signal/slot editor from the BEC Designer to connect the `dap_summary_update` signal of the `Waveform` widget to the `update_summary_tree` slot of the LMFit Dialog. - -```{figure} /assets/widget_screenshots/lmfit_dialog_connect.png -```` -````{tab} Connect in Python -It is also possible to directly connect the `dap_summary_update` signal of the `Waveform` widget to the `update_summary_tree` slot of the LMFit Dialog in Python. - -```python -waveform = Waveform(...) -lmfit_dialog = LMFitDialog(...) -waveform.dap_summary_update.connect(lmfit_dialog.update_summary_tree) - -``` -```` - - - - - - - - - - diff --git a/docs/user/widgets/log_panel/log_panel.md b/docs/user/widgets/log_panel/log_panel.md deleted file mode 100644 index 75bda1dd..00000000 --- a/docs/user/widgets/log_panel/log_panel.md +++ /dev/null @@ -1,39 +0,0 @@ -(user.widgets.log_panel)= - -# LogPanel widget - -The LogPanel widget can be used to view logs: - -![LogPanel](./logpanel.png) - -It automatically subscribes to log updates. You can fetch the log history with the "Fetch history" button. - -## Filtering based on log level - -If you select a dropdown box, only logs of that priority level or higher will be displayed: - -![LogPanel](./logpanel_level.png) - - -## Filtering based on a search string - -If you type in a search string into the box in the toolbar, and hit enter or press the update button, that filter will be applied: - -![LogPanel](./logpanel_text.png) - -This search uses the [Python regular expression syntax](https://docs.python.org/3/library/re.html) if the checkbox for this option is selected: - -![LogPanel](./logpanel_regex.png) - - -## Filtering based on time range - -You may filter the logs to those occurring within a given time range. - -![LogPanel](./logpanel_timerange.png) - -## Filtering based on service - -You can select which services to show logs from. - -![LogPanel](./logpanel_services.png) \ No newline at end of file diff --git a/docs/user/widgets/log_panel/logpanel.png b/docs/user/widgets/log_panel/logpanel.png deleted file mode 100644 index d964d3c8..00000000 Binary files a/docs/user/widgets/log_panel/logpanel.png and /dev/null differ diff --git a/docs/user/widgets/log_panel/logpanel_level.png b/docs/user/widgets/log_panel/logpanel_level.png deleted file mode 100644 index 706220a8..00000000 Binary files a/docs/user/widgets/log_panel/logpanel_level.png and /dev/null differ diff --git a/docs/user/widgets/log_panel/logpanel_regex.png b/docs/user/widgets/log_panel/logpanel_regex.png deleted file mode 100644 index 3f6a3023..00000000 Binary files a/docs/user/widgets/log_panel/logpanel_regex.png and /dev/null differ diff --git a/docs/user/widgets/log_panel/logpanel_services.png b/docs/user/widgets/log_panel/logpanel_services.png deleted file mode 100644 index b65294c1..00000000 Binary files a/docs/user/widgets/log_panel/logpanel_services.png and /dev/null differ diff --git a/docs/user/widgets/log_panel/logpanel_text.png b/docs/user/widgets/log_panel/logpanel_text.png deleted file mode 100644 index 7d817175..00000000 Binary files a/docs/user/widgets/log_panel/logpanel_text.png and /dev/null differ diff --git a/docs/user/widgets/log_panel/logpanel_timerange.png b/docs/user/widgets/log_panel/logpanel_timerange.png deleted file mode 100644 index 43db92b1..00000000 Binary files a/docs/user/widgets/log_panel/logpanel_timerange.png and /dev/null differ diff --git a/docs/user/widgets/motor_map/motor.gif b/docs/user/widgets/motor_map/motor.gif deleted file mode 100644 index daccbeb9..00000000 Binary files a/docs/user/widgets/motor_map/motor.gif and /dev/null differ diff --git a/docs/user/widgets/motor_map/motor_map.md b/docs/user/widgets/motor_map/motor_map.md deleted file mode 100644 index 09e51a7f..00000000 --- a/docs/user/widgets/motor_map/motor_map.md +++ /dev/null @@ -1,70 +0,0 @@ -(user.widgets.motor_map)= - -# Motor Map Widget - -````{tab} Overview - -The Motor Map Widget is a specialized tool for tracking and visualizing the positions of motors in real-time. This widget is crucial for applications requiring precise alignment and movement tracking during scans. It provides an intuitive way to monitor motor trajectories, ensuring accurate positioning throughout the scanning process. - -## Key Features: -- **Flexible Integration**: The widget can be integrated into a [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. -- **Real-time Motor Position Visualization**: Tracks motor positions in real-time and visually represents motor trajectories. -- **Customizable Visual Elements**: The appearance of all widget components is fully customizable, including scatter size and background values. -- **Interactive Controls**: Interactive controls for zooming, panning, and adjusting the visual properties of motor trajectories on the fly. - -![MotorMap](./motor.gif) -```` - -````{tab} Examples CLI -`MotorMapWidget` can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. However, the command-line API is the same for all cases. - -## Example 1 - Adding Motor Map Widget as a Dock in BECDockArea - -Adding `MotorMapWidget` into a [`BECDockArea`](user.widgets.bec_dock_area) is similar to adding any other widget. - -```python -# Add new MotorMaps to the BECDockArea -dock_area = gui.new() -mm1 = dock_area.new().new(gui.available_widgets.MotorMap) -mm2 = dock_area.new().new(gui.available_widgets.MotorMap) - -# Add signals to the MotorMaps -mm1.map(device_x='samx', device_y='samy') -mm2.map(device_x='aptrx', device_y='aptry') -``` - -## Example 2 - Customizing Motor Map Display - -The `MotorMapWidget` allows customization of its visual elements to better suit the needs of your application. Below is an example of how to adjust the scatter size, set background values, and limit the number of points displayed from the position buffer. - -```python -# Set scatter size -mm1.scatter_size = 10 - -# Set background value (between 0 and 100) -mm1.background_value = 0 - -# Limit the number of points displayed and saved in the position buffer -mm1.max_points = 500 -``` - -## Example 3 - Changing Motors and Resetting History - -You can dynamically change the motors being tracked and reset the history of the motor trajectories during the session. - -```python -# Reset the history of motor movements -mm1.reset_history() - -# Change the motors being tracked -mm1.map(device_x='aptrx', device_y='aptry') -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.MotorMap - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/multi_waveform/multi_waveform.md b/docs/user/widgets/multi_waveform/multi_waveform.md deleted file mode 100644 index 827df866..00000000 --- a/docs/user/widgets/multi_waveform/multi_waveform.md +++ /dev/null @@ -1,96 +0,0 @@ -(user.widgets.multi_waveform_widget)= - -# Multi Waveform Widget - -````{tab} Overview -The Multi Waveform Widget is designed to display multiple 1D detector signals over time. It is ideal for visualizing real-time streaming data from a monitor in the BEC framework, where each new data set is added as a new curve on the plot. This allows users to observe historical changes and trends in the signal. - -## Key Features: -- **Real-Time Data Visualization**: Display multiple 1D signals from a monitor in real-time, with each new data set represented as a new curve. -- **Curve Management**: Control the number of curves displayed, set limits on the number of curves, and manage the buffer with options to flush old data. -- **Interactive Controls**: Highlight specific curves, adjust opacity, and interact with the plot using zoom and pan tools. -- **Customizable Appearance**: Customize the colormap, curve opacity, and highlight settings to enhance data visualization. -- **Data Export**: Export the displayed data for further analysis, including exporting to Matplotlib for advanced plotting. -- **Flexible Integration**: Can be integrated into [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. - -```` - -````{tab} Examples - CLI - -`BECMultiWaveform` can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. The command-line API is consistent across these contexts. - -## Example 1 - Using BECMultiWaveformWidget in BECDockArea - -You can add `BECMultiWaveformWidget` directly to a `BECDockArea`. This widget includes its own toolbar and controls for interacting with the multi waveform plot. - -```python -# Add a new MultiWaveform to the BECDockArea -dock_area = gui.new() -multi_waveform_widget = dock_area.new().new(gui.available_widgets.MultiWaveform) - -# Set the monitor from the command line -multi_waveform_widget.plot('waveform') - -# Optionally, adjust settings -multi_waveform_widget.opacity = 60 -``` - -## Example 2 - Customizing the Multi Waveform Plot - -You can customize various aspects of the plot, such as the colormap, opacity, and curve limit. - -```python -# Change the colormap to 'viridis' -multi_waveform_widget.color_palette = 'viridis' - -# Adjust the opacity of the curves to 70% -multi_waveform_widget.opacity = 60 - -# Limit the number of curves displayed to 50 -multi_waveform_widget.max_trace = 10 - -# Enable buffer flush when the curve limit is reached -multi_waveform_widget.flush_buffer = True -``` - -## Example 3 - Highlighting Curves - -You can highlight specific curves to emphasize important data. - -```python -# Disable automatic highlighting of the last curve -multi_waveform.highlight_last_curve = False - -# Highlight the third curve (indexing starts from 0) -multi_waveform.highlighted_index = 2 - -# Re-enable automatic highlighting of the last curve -multi_waveform.highlight_last_curve = True -``` - - -```` - -````{tab} API - - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.MultiWaveform - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/pdf_viewer/pdf_viewer_widget.md b/docs/user/widgets/pdf_viewer/pdf_viewer_widget.md deleted file mode 100644 index 6f8dfc31..00000000 --- a/docs/user/widgets/pdf_viewer/pdf_viewer_widget.md +++ /dev/null @@ -1,119 +0,0 @@ -(user.widgets.pdf_viewer_widget)= - -# PDF Viewer Widget - -````{tab} Overview - -The PDF Viewer Widget is a versatile tool designed for displaying and navigating PDF documents within your BEC applications. Directly integrated with the `BEC` framework, it provides a full-featured PDF viewing experience with zoom controls, page navigation, and customizable display options. - -## Key Features: -- **Flexible Integration**: The widget can be integrated into [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. -- **Full PDF Support**: Display any PDF document with full rendering support through Qt's PDF rendering engine. -- **Navigation Controls**: Built-in toolbar with page navigation, zoom controls, and document status indicators. -- **Customizable Display**: Adjustable page spacing, margins, and zoom levels for optimal viewing experience. -- **Document Management**: Load different PDF files dynamically during runtime with proper error handling. - -## User Interface Components: -- **Toolbar**: Contains all navigation and zoom controls - - Previous/Next page buttons - - Page number input field with total page count - - First/Last page navigation buttons - - Zoom in/out buttons - - Fit to width/page buttons - - Reset zoom button -- **PDF View Area**: Main display area for the PDF content - -```` - -````{tab} Examples - CLI - -`PdfViewerWidget` can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. The command-line API is the same for all cases. - -## Example 1 - Basic PDF Loading - -In this example, we demonstrate how to add a `PdfViewerWidget` to a [`BECDockArea`](user.widgets.bec_dock_area) and load a PDF document. - -```python -# Add a new dock with PDF viewer widget -dock_area = gui.new() -pdf_viewer = dock_area.new().new(gui.available_widgets.PdfViewerWidget) - -# Load a PDF file -pdf_viewer.load_pdf("/path/to/your/document.pdf") -``` - -## Example 2 - Customizing Display Properties - -This example shows how to customize the display properties of the PDF viewer for better presentation. - -```python -# Create PDF viewer -pdf_viewer = gui.new().new().new(gui.available_widgets.PdfViewerWidget) - -# Load PDF document -pdf_viewer.load_pdf("/path/to/report.pdf") -pdf_viewer.toggle_continuous_scroll(True) # Enable continuous scroll mode - -# Customize display properties -pdf_viewer.page_spacing = 20 # Increase spacing between pages -pdf_viewer.side_margins = 50 # Add horizontal margins - -# Navigate to specific page -pdf_viewer.jump_to_page(5) # Go to page 5 -``` - -## Example 3 - Navigation and Zoom Controls - -The PDF viewer provides programmatic access to all navigation and zoom functionality. - -```python -# Create and load PDF -pdf_viewer = gui.new().new().new(gui.available_widgets.PdfViewerWidget) -pdf_viewer.load_pdf("/path/to/manual.pdf") - -# Navigation examples -pdf_viewer.go_to_first_page() # Go to first page -pdf_viewer.go_to_last_page() # Go to last page -pdf_viewer.jump_to_page(10) # Jump to specific page - -# Zoom controls -pdf_viewer.zoom_in() # Increase zoom -pdf_viewer.zoom_out() # Decrease zoom -pdf_viewer.fit_to_width() # Fit document to window width -pdf_viewer.fit_to_page() # Fit entire page to window -pdf_viewer.reset_zoom() # Reset to 100% zoom - -# Check current status -current_page = pdf_viewer.current_page -print(f"Currently viewing page {current_page}") -``` - -## Example 4 - Dynamic Document Loading - -This example demonstrates how to switch between different PDF documents dynamically. - -```python -# Create PDF viewer -pdf_viewer = gui.new().new().new(gui.available_widgets.PdfViewerWidget) - -# Load first document -pdf_viewer.load_pdf("/path/to/document1.pdf") - -# Or simply set the current file path -pdf_viewer.current_file_path = "/path/to/document2.pdf" -# This automatically loads the new document - -# Check which file is currently loaded -current_file = pdf_viewer.current_file_path -print(f"Currently viewing: {current_file}") -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.PdfViewerWidget - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/position_indicator/position_indicator.md b/docs/user/widgets/position_indicator/position_indicator.md deleted file mode 100644 index aa07b639..00000000 --- a/docs/user/widgets/position_indicator/position_indicator.md +++ /dev/null @@ -1,102 +0,0 @@ -(user.widgets.position_indicator)= - -# Position Indicator Widget - -````{tab} Overview - -The `PositionIndicator` widget is a simple yet effective tool for visually indicating the position of a motor within its set limits. This widget is particularly useful in applications where it is important to provide a visual clue of the motor's current position relative to its minimum and maximum values. The `PositionIndicator` can be easily integrated into your GUI application either through direct code instantiation or by using `BEC Designer`. - -## Key Features: -- **Position Visualization**: Displays the current position of a motor on a linear scale, showing its location relative to the defined limits. -- **Customizable Range**: The widget allows you to set the minimum and maximum range, adapting to different motor configurations. -- **Real-Time Updates**: Responds to real-time updates, allowing the position indicator to move dynamically as the motor's position changes. -- **Compact Design**: The widget is designed to be compact and visually appealing, making it suitable for various GUI applications. -- **Customizable Appearance**: The appearance of the position indicator can be customized to match the overall design of your application, including colors, orientation, and size. -- **BEC Designer Integration**: Can be added directly in code or through `BEC Designer`, making it adaptable to various use cases. - - -## BEC Designer Customization -Within the BEC Designer's [property editor](https://doc.qt.io/qt-6/designer-widget-mode.html#the-property-editor/), the `PositionIndicator` widget can be customized to suit your application's requirements. The widget provides the following customization options: -- **minimum**: The minimum value of the position indicator. -- **maximum**: The maximum value of the position indicator. -- **value**: The current value of the position indicator. -- **vertical**: A boolean value indicating whether the position indicator is oriented vertically or horizontally. -- **indicator_width**: The width of the position indicator. -- **rounded_corners**: The radius of the rounded corners of the position indicator. -- **indicator_color**: The color of the position indicator. -- **background_color**: The color of the background of the position indicator. -- **use_color_palette**: A boolean value indicating whether to use the color palette for the position indicator or the custom colors. - -**BEC Designer properties:** -```{figure} ./position_indicator_designer_props.png -``` - - -```` - -````{tab} Examples - -The `PositionIndicator` widget can be embedded in a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. Below are examples demonstrating how to create and use the `PositionIndicator` from the CLI and also directly within Code. - -## Example 1 - Creating a Position Indicator in Code - -In this example, we demonstrate how to create a `PositionIndicator` widget in code and connect it to a slider to simulate position updates. - -```python -from qtpy.QtCore import Qt -from qtpy.QtWidgets import QApplication, QSlider, QVBoxLayout, QWidget -from bec_widgets.widgets.control.device_control.position_indicator.position_indicator import PositionIndicator - -app = QApplication([]) - -# Create the PositionIndicator widget -position_indicator = PositionIndicator() - -# Create a slider to simulate position changes -slider = QSlider(Qt.Horizontal) -slider.valueChanged.connect(lambda value: position_indicator.set_value(value)) - -# Create a layout and add the widgets -layout = QVBoxLayout() -layout.addWidget(position_indicator) -layout.addWidget(slider) - -# Set up the main widget -widget = QWidget() -widget.setLayout(layout) -widget.show() - -app.exec_() -``` - -## Example 2 - CLI Example, illustrating how to use the position_indicator API - -You can set the minimum and maximum range for the position indicator to reflect the actual limits of the motor. - -```python -# Create a new PositionIndicator widget -dock_area = gui.new() -position_indicator = dock_area.new("position_indicator").new(gui.available_widgets.PositionIndicator) - -# Set the range for the position indicator -position_indicator.set_range(min_value=0, max_value=200) -``` - -## Example 3 - Integrating the Position Indicator in BEC Designer - -The `PositionIndicator` can be added to your GUI layout using `BEC Designer`. Once added, you can connect it to the motor's position updates using the `on_position_update` slot. - -```python -# Example: Updating the position in a BEC Designer-based application -self.position_indicator.set_value(new_position_value) -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.PositionIndicator - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/position_indicator/position_indicator_designer_props.png b/docs/user/widgets/position_indicator/position_indicator_designer_props.png deleted file mode 100644 index 8e73280f..00000000 Binary files a/docs/user/widgets/position_indicator/position_indicator_designer_props.png and /dev/null differ diff --git a/docs/user/widgets/positioner_box/positioner_box.md b/docs/user/widgets/positioner_box/positioner_box.md deleted file mode 100644 index 3d203256..00000000 --- a/docs/user/widgets/positioner_box/positioner_box.md +++ /dev/null @@ -1,65 +0,0 @@ -(user.widgets.positioner_box)= - -# Positioner Box Widget - -````{tab} Overview - -The `PositionerBox` widget provides a graphical user interface to control a positioner device within the BEC environment. This widget allows users to interact with a positioner by setting setpoints, tweaking the motor position, and stopping motion. The device selection can be done via a small button under the device label, through `BEC Designer`, or by using the command line interface (CLI). This flexibility makes the `PositionerBox` an essential tool for tasks involving precise position control. - -## Key Features: -- **Device Selection**: Easily select a positioner device by clicking the button under the device label or by configuring the widget in `BEC Designer`. -- **Setpoint Control**: Directly set the positioner’s target setpoint and issue movement commands. -- **Tweak Controls**: Adjust the motor position incrementally using the tweak left/right buttons. -- **Real-Time Feedback**: Monitor the device’s current position and status, with live updates on whether the device is moving or idle. -- **Flexible Integration**: Can be integrated into a GUI through `BECDockArea` or used as a standalone component in `BEC Designer`. -```` - -````{tab} Examples - -The `PositionerBox` widget can be integrated within a GUI application either through direct code instantiation or by using `BEC Designer`. Below are examples demonstrating how to create and use the `PositionerBox` widget. - -## Example 1 - Creating a PositionerBox in Code - -In this example, we demonstrate how to create a `PositionerBox` widget in code and configure it for a specific device. - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.positioner_box import PositionerBox - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - - # Create and add the PositionerBox to the layout - self.positioner_box = PositionerBox(parent=self, device="motor1") - self.layout().addWidget(self.positioner_box) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 2 - Selecting a Device via GUI - -Users can select the positioner device by clicking the button under the device label, which opens a dialog for device selection. - -## Example 3 - Customizing PositionerBox in BEC Designer - -The `PositionerBox` widget can be added to a GUI through `BEC Designer`. Once integrated, you can configure the default device and customize the widget’s appearance and behavior directly within the designer. - -```python -# After adding the widget to a form in BEC Designer, you can configure the device: -self.positioner_box.set_positioner("motor2") -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.PositionerBox - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/positioner_box/positioner_box_2d.md b/docs/user/widgets/positioner_box/positioner_box_2d.md deleted file mode 100644 index 1d817dd2..00000000 --- a/docs/user/widgets/positioner_box/positioner_box_2d.md +++ /dev/null @@ -1,62 +0,0 @@ -(user.widgets.positioner_box_2d)= - -# Positioner Box 2D Widget - -````{tab} Overview - -The `PositionerBox2D` widget is very similar to the `PositionerBox` but allows controlling two positioners at the same time, in a horizontal and vertical orientation respectively. It is intended primarily for controlling axes which have a perpendicular relationship like that. In other cases, it may be better to use a `PositionerGroup` instead. - -The `PositionerBox2D` has the same features as the standard `PositionerBox`, but additionally, step buttons which move the positioner by the selected step size, and tweak buttons which move by a tenth of the selected step size. - -```` - -````{tab} Examples - -The `PositionerBox2D` widget can be integrated within a GUI application either through direct code instantiation or by using `BEC Designer`. Below are examples demonstrating how to create and use the `PositionerBox2D` widget. - -## Example 1 - Creating a PositionerBox in Code - -In this example, we demonstrate how to create a `PositionerBox2D` widget in code and configure it for a specific device. - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.positioner_box import PositionerBox2D - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - - # Create and add the PositionerBox to the layout - self.positioner_box_2d = PositionerBox(parent=self, device_hor="horizontal_motor", device_ver="vertical_motor") - self.layout().addWidget(self.positioner_box_2d) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 2 - Selecting a Device via GUI - -Users can select the positioner device by clicking the button under the device label, which opens a dialog for device selection. - -## Example 3 - Customizing PositionerBox in BEC Designer - -The `PositionerBox2D` widget can be added to a GUI through `BEC Designer`. Once integrated, you can configure the default device and customize the widget’s appearance and behavior directly within the designer. - -```python -# After adding the widget to a form in BEC Designer, you can configure the device: -self.positioner_box.set_positioner_hor("samx") -self.positioner_box.set_positioner_verr("samy") -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.PositionerBox2D - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/progress_bar/progress_bar.gif b/docs/user/widgets/progress_bar/progress_bar.gif deleted file mode 100644 index b9291f39..00000000 Binary files a/docs/user/widgets/progress_bar/progress_bar.gif and /dev/null differ diff --git a/docs/user/widgets/progress_bar/ring_progress_bar.md b/docs/user/widgets/progress_bar/ring_progress_bar.md deleted file mode 100644 index 1617e66a..00000000 --- a/docs/user/widgets/progress_bar/ring_progress_bar.md +++ /dev/null @@ -1,69 +0,0 @@ -(user.widgets.ring_progress_bar)= - -# Ring Progress Bar - -````{tab} Overview - -The `RingProgressBar` widget is a circular progress bar designed to visualize the progress of tasks in a clear and intuitive manner. This widget is particularly useful in applications where task progress needs to be represented as a percentage. The `Ring Progress Bar` can be controlled directly via its API or can be hooked up to track the progress of a device readback or scan, providing real-time visual feedback. - -## Key Features: -- **Circular Progress Visualization**: Displays a circular progress bar to represent task completion. -- **Device and Scan Integration**: Hooks into device readbacks or scans to automatically update the progress bar based on real-time data. -- **Multiple Rings**: Supports multiple progress rings within the same widget to track different tasks in parallel. -- **Customizable Visual Elements**: Allows customization of colors, line widths, and other visual elements for each progress ring. - -![RingProgressBar](./progress_bar.gif) - -```` - -````{tab} Example - -## Example 1 - Adding Ring Progress Bar to BECDockArea - -In this example, we demonstrate how to add a `RingProgressBar` widget to a `BECDockArea` to visualize the progress of a task. - -```python -# Add a new dock with a RingProgressBar widget -dock_area = gui.new() # Create a new dock area -progress = dock_area.new(gui.available_widgets.RingProgressBar) - -# Add a ring to the RingProgressBar -progress.add_ring() -ring = progress.rings[0] -ring.set_value(50) # Set the progress value to 50 -``` - -## Example 2 - Adding Multiple Rings to Track Parallel Tasks - -By default, the `RingProgressBar` widget displays a single ring. You can add additional rings to track multiple tasks simultaneously. - -```python -# Add a second ring to the RingProgressBar -progress.add_ring() - -# Customize the rings -progress.rings[1].set_value(30) # Set the second ring to 30 -``` - -## Example 3 - Integrating with Device Readback and Scans - -The `RingProgressBar` can automatically update based on the progress of scans or device readbacks. This example shows how to set up the progress rings to reflect these updates. - -```python -# Set the first ring to update based on scan progress -progress.rings[0].set_update("scan") - -# Set the second ring to update based on a device readback (e.g., samx) -progress.rings[1].set_update("device", "samx") -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.RingProgressBar - :members: - :show-inheritance: -``` -```` - diff --git a/docs/user/widgets/queue/queue.md b/docs/user/widgets/queue/queue.md deleted file mode 100644 index 340f8044..00000000 --- a/docs/user/widgets/queue/queue.md +++ /dev/null @@ -1,46 +0,0 @@ -(user.widgets.bec_queue)= - -# BEC Queue Widget - -````{tab} Overview - -The `BECQueue` widget provides a real-time display and control of the BEC scan queue, allowing users to monitor, manage, and control the status of ongoing and pending scans. The widget automatically updates to reflect the current state of the scan queue, displaying critical information such as scan numbers, types, and statuses. Additionally, it provides control options to stop individual scans, stop the entire queue, resume, and reset the queue, making it a powerful tool for managing scan operations in the BEC environment. - -## Key Features: -- **Real-Time Queue Monitoring**: Displays the current state of the BEC scan queue, with automatic updates as the queue changes. -- **Detailed Scan Information**: Provides a clear view of scan numbers, types, and statuses, helping users track the progress and state of each scan. -- **Queue Control**: Allows users to stop specific scans, stop the entire queue, resume paused scans, and reset the queue. -- **Interactive Table Layout**: The queue is presented in a table format, with customizable columns that stretch to fit the available space. -- **Flexible Integration**: The widget can be integrated into both [`BECDockArea`](user.widgets.bec_dock_area) and used as an individual component in your application through `BEC Designer`. - -```` - -````{tab} Examples - -The `BEC Queue Widget` can be embedded within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. Below are examples demonstrating how to create and use the `BEC Queue Widget`. - -## Example 1 - Adding BEC Queue Widget to BECDockArea - -In this example, we demonstrate how to add a `BECQueue` widget to a `BECDockArea`, allowing users to monitor the BEC scan queue directly from the GUI. - -```python -# Add a new dock with a BECQueue widget -dock_area = gui.new() -dock_area.new("queue").new(gui.available_widgets.BECQueue) -queue = dock_area.queue.BECQueue -``` - -```{hint} -The `BECQueue` widget automatically updates as the scan queue changes, providing real-time feedback on the status of each scan. -Once the widget is added, it will automatically display the current scan queue -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.BECQueue - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/scan_control/hide_scan_control.png b/docs/user/widgets/scan_control/hide_scan_control.png deleted file mode 100644 index a6c83bb0..00000000 Binary files a/docs/user/widgets/scan_control/hide_scan_control.png and /dev/null differ diff --git a/docs/user/widgets/scan_control/scan_control.gif b/docs/user/widgets/scan_control/scan_control.gif deleted file mode 100644 index 449b4d92..00000000 Binary files a/docs/user/widgets/scan_control/scan_control.gif and /dev/null differ diff --git a/docs/user/widgets/scan_control/scan_control.md b/docs/user/widgets/scan_control/scan_control.md deleted file mode 100644 index c72f787e..00000000 --- a/docs/user/widgets/scan_control/scan_control.md +++ /dev/null @@ -1,66 +0,0 @@ -(user.widgets.scan_control)= - -# Scan Control Widget - -````{tab} Overview - -The `ScanControl` widget provides a graphical user interface (GUI) to manage various scan operations in a BEC environment. It is designed to interact with the BEC server, enabling users to start and stop scans. The widget automatically creates the necessary input form based on the scan's signature and gui_config, making it highly adaptable to different scanning processes. - -## Key Features: -- **Automatic Interface Generation**: Automatically generates a control interface based on scan signatures and `gui_config`. -- **Dynamic Argument Bundling**: Supports the dynamic addition and removal of argument bundles such as positioner controls. -- **Visual Parameter Grouping**: Provides a visual representation of scan parameters, grouped by their functionality. -- **Integrated Scan Controls**: Includes start and stop controls for managing scan execution. -- **Persistent Scan Parameters**: Remembers scan parameters when switching between scans. If you configure scan 1 and switch to scan 2, scan 2 will inherit the same parameters if it has never been selected before. -- **Toggle to Reload Parameters from Last Executed Scan**: Includes a toggle to load scan parameters from the last executed scan from the BEC server, ensuring the user can quickly revert to previous configurations. - -```{note} -By default, this widget supports scans that are derived from the following base classes and have a defined `gui_config`: -- [ScanBase](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_server.scan_server.scans.ScanBase.html) -- [SyncFlyScanBase](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_server.scan_server.scans.SyncFlyScanBase.html) -- [AsyncFlyScanBase](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_server.scan_server.scans.AsyncFlyScanBase.html) -``` - -```{hint} -The full procedure how to design `gui_config` for your custom scan class is described in the [Scan GUI Configuration](https://bec.readthedocs.io/en/latest/developer/scans/tutorials/scan_gui_config.html) tutorial. -``` - -## BEC Designer Customization -Within the BEC Designer's [property editor](https://doc.qt.io/qt-6/designer-widget-mode.html#the-property-editor/), the `ScanControl` widget can be customized to suit your application's requirements. The widget provides the following customization options: -- **Hide Scan Control**: Allows you to hide the scan control buttons from the widget interface. This is useful when you want to place the control buttons in a different location. -- **Hide Scan Selection**: Allows you to hide the scan selection combobox from the widget interface. This is useful when you want to restrict the user to a specific scan type or implement a custom scan selection mechanism. -- **Hide Scan Remember Toggle**: Allows you to hide the toggle button that reloads scan parameters from the last executed scan. This is useful if you want to disable or restrict this functionality in specific scenarios. -- **Hide Bundle Buttons**: Allows you to hide the buttons that add or remove argument bundles from the widget interface. This is useful when you want to restrict the user from adding additional motor bundles to the scan by accident. - -**BEC Designer properties:** -```{figure} ./hide_scan_control.png -``` - -**Example of usage:** -```{figure} ./scan_control.gif -``` - -```` - -````{tab} Examples - -The `ScanControl` widget can be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. Below are examples demonstrating how to create and use the `ScanControl` widget. - -## Example 1 - Adding Scan Control Widget to BECDockArea - -In this example, we demonstrate how to add a `ScanControl` widget to a `BECDockArea`, enabling the user to control scan operations directly from the GUI. - -```python -# Add a new dock with a ScanControl widget -dock_area = gui.new() -scan_control = dock_area.new().new(gui.available_widgets.ScanControl) -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.ScanControl - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/scatter_waveform/scatter_2D.gif b/docs/user/widgets/scatter_waveform/scatter_2D.gif deleted file mode 100644 index 2bd0a8e5..00000000 Binary files a/docs/user/widgets/scatter_waveform/scatter_2D.gif and /dev/null differ diff --git a/docs/user/widgets/scatter_waveform/scatter_waveform.md b/docs/user/widgets/scatter_waveform/scatter_waveform.md deleted file mode 100644 index 10426cda..00000000 --- a/docs/user/widgets/scatter_waveform/scatter_waveform.md +++ /dev/null @@ -1,41 +0,0 @@ -(user.widgets.scatter_waveform_widget)= - -# Scatter Waveform Widget - -````{tab} Overview -The 2D scatter plot widget is designed for more complex data visualization. It employs a false color map to represent a third dimension (z-axis), making it an ideal tool for visualizing multidimensional data sets. - -## Key Features: -- **Real-Time Data Visualization**: Display 2D scatter plots with a third dimension represented by color. -- **Flexible Integration**: Can be integrated into [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. - -```` - -````{tab} Examples - CLI - -`ScatterWaveform` widget can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. The command-line API is consistent across these contexts. - -## Example - -```python -# Add a new dock_area, a new dock and a BECWaveForm to the dock -plt = gui.new().new().new(gui.available_widgets.ScatterWaveform) -plt.plot(device_x='samx', device_y='samy', device_z='bpm4i') - -``` - -![Scatter 2D](./scatter_2D.gif) - - -```{note} -The ScatterWaveform widget only plots the data points if both x and y axis motors are moving. Or more generally, if all signals are of readout type *monitored*. -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.ScatterWaveform - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/signal_input/signal_input.md b/docs/user/widgets/signal_input/signal_input.md deleted file mode 100644 index 0f8c4734..00000000 --- a/docs/user/widgets/signal_input/signal_input.md +++ /dev/null @@ -1,109 +0,0 @@ -(user.widgets.signal_input)= - -# Signal Input Widgets - -````{tab} Overview -The `Signal Input Widgets` consist of two primary widgets: `SignalLineEdit` and `SignalComboBox`. Both widgets are designed to facilitate the selection of the available signals for a selected device within the current BEC session. These widgets allow users to filter, search, and select signals dynamically. The widgets can either be integrated into a GUI through direct code instantiation or by using `BEC Designer`. - -## SignalLineEdit -The `SignalLineEdit` widget provides a line edit interface with autocomplete functionality for the available of signals associated with the selected device. This widget is ideal for users who prefer to type in the signal name directly. If no device is selected, the autocomplete will be empty. In addition, the widget will display a red border around the line edit if the input signal is invalid. - -## SignalComboBox -The `SignalComboBox` widget offers a dropdown interface for choosing a signal from the available signals of a device. It will further categorise the signals according to its `kind`: `hinted`, `normal` and `config`. For more information about `kind`, please check the [ophyd documentation](https://nsls-ii.github.io/ophyd/signals.html#kind). This widget is ideal for users who prefer to select signals from a list. - -## Key Features: -- **Signal Filtering**: Both widgets allow users to filter devices by signal types(`kind`). No selected filter will show all signals. -- **Real-Time Autocomplete (LineEdit)**: The `SignalLineEdit` widget supports real-time autocomplete, helping users find devices faster. -- **Real-Time Input Validation (LineEdit)**: User input is validated in real-time with a red border around the `SignalLineEdit` indicating an invalid input. -- **Dropdown Selection (SignalComboBox)**: The `SignalComboBox` widget displays the sorted signals of the device -- **BEC Designer Integration**: Both widgets can be added as custom widgets in `BEC Designer` or instantiated directly in code. - -## Screenshot - -```{figure} /assets/widget_screenshots/signal_inputs.png -``` - -```` - -````{tab} Examples - -Both `SignalLineEdit` and `SignalComboBox` can be integrated within a GUI application through direct code instantiation or by using `BEC Designer`. Below are examples demonstrating how to create and use these widgets. - - -## Example 1 - Creating a SignalLineEdit in Code - -In this example, we demonstrate how to create a `SignalLineEdit` widget in code and customize its behavior. -We will select `samx`, which is a motor in the BEC simulation device config, and filter the signals to `normal` and `hinted`. -Note, not specifying signal_filter will include all signals. - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.control.device_input.signal_line_edit.signal_line_edit import SignalLineEdit -from ophyd import Kind - -class MyGui(QWidget): - def __init__(self): - super().__init__() - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - # Create and add the SignalLineEdit to the layout - self.signal_line_edit = SignalLineEdit(device="samx", signal_filter=[Kind.normal, Kind.hinted]) - self.layout().addWidget(self.signal_line_edit) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 2 - Creating a SignalComboBox in Code - -A - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.control.device_input.signal_combobox.signal_combobox import SignalComboBox -from ophyd import Kind - -class MyGui(QWidget): - def __init__(self): - super().__init__() - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - # Create and add the SignalComboBox to the layout - self.signal_combobox = SignalComboBox(device="samx", signal_filter=[Kind.normal, Kind.hinted]) - self.layout().addWidget(self.signal_combobox) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 3 - Setting Default Device - -Both `SignalLineEdit` and `SignalComboBox` allow you to set a default device that will be selected when the widget is initialized. - -```python -# Set default device for DeviceLineEdit -self.signal_line_edit.set_device("motor1") - -# Set default device for DeviceComboBox -self.signal_combobox.set_device("motor2") -``` -```` -````{tab} BEC Designer -Both widgets are also available as plugins for the BEC Designer. We have included Qt properties for both widgets, allowing customization of filtering and default device settings directly from the designer. In addition to the common signals and slots for `SignalLineEdit` and `SignalComboBox`, the following slots are available: -- `set_device(str)` to set the default device -- `set_signal(str)` to set the default signal -- `update_signals_from_filters()` to refresh the devices list based on the current filters - -The following Qt properties are also included: -```{figure} ./signal_input_qproperties.png -``` - -```` - - - - diff --git a/docs/user/widgets/signal_input/signal_input_qproperties.png b/docs/user/widgets/signal_input/signal_input_qproperties.png deleted file mode 100644 index ae86d8e7..00000000 Binary files a/docs/user/widgets/signal_input/signal_input_qproperties.png and /dev/null differ diff --git a/docs/user/widgets/signal_label/designer_screenshot.png b/docs/user/widgets/signal_label/designer_screenshot.png deleted file mode 100644 index b9119ee0..00000000 Binary files a/docs/user/widgets/signal_label/designer_screenshot.png and /dev/null differ diff --git a/docs/user/widgets/signal_label/signal_label.md b/docs/user/widgets/signal_label/signal_label.md deleted file mode 100644 index 9117c9be..00000000 --- a/docs/user/widgets/signal_label/signal_label.md +++ /dev/null @@ -1,104 +0,0 @@ -(user.widgets.signal_label)= - -# Signal Label widget - -````{tab} Overview - -The `SignalLabel` displays the value of a signal from a device, with optional customization for labels, units, decimal formatting, and signal selection. It is designed for use in BEC (Beamline Experiment Control) GUIs to monitor values which beamline operators might want to keep an eye on, e.g. sample position, flux, hutch state... - -## Key Features: -- Display: Shows the current value of a device signal. -- Custom Label/Units: Optionally override the default label and units. -- Decimal Formatting: Control the number of decimal places shown. -- Signal Selection: (Optional) Button to open a dialog for selecting a device and signal. -- Live Updates: Subscribes to device updates and refreshes the display automatically. - - -```` - -````{tab} Examples - python - -The `SignalLabel` widget can be used inside another widget to build an overall GUI display. For example, to create a display -for the sample position like this: - - -```{figure} ./test_screenshot.png -``` - -You can simply add three of these signal displays as done here: - -```python -import sys - -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget - -from bec_widgets.utils.bec_widget import BECWidget -from bec_widgets.widgets.utility.signal_label.signal_label import SignalLabel - - -class SamplePositionWidget(BECWidget, QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout()) - self.samx_readback = SignalLabel( - device="samx", - signal="readback", - custom_label="Sample X:", - custom_units="mm", - show_select_button=False, - show_default_units=False, - ) - self.samy_readback = SignalLabel( - device="samy", - signal="readback", - custom_label="Sample Y:", - custom_units="mm", - show_select_button=False, - show_default_units=False, - ) - self.samz_readback = SignalLabel( - device="samz", - signal="readback", - custom_label="Sample Z:", - custom_units="mm", - show_select_button=False, - show_default_units=False, - ) - self.layout().addWidget(self.samx_readback) - self.layout().addWidget(self.samy_readback) - self.layout().addWidget(self.samz_readback) - - -if __name__ == "__main__": - app = QApplication() - w = SamplePositionWidget() - w.show() - sys.exit(app.exec_()) - -``` - -```` - -````{tab} Examples - BEC designer -The various properties can also be set when the SignalLabel widget is added to a UI in BEC designer: - -```{figure} ./designer_screenshot.png -``` -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.TextBox - :members: - :show-inheritance: -``` -```` - - - - - - - - - diff --git a/docs/user/widgets/signal_label/test_screenshot.png b/docs/user/widgets/signal_label/test_screenshot.png deleted file mode 100644 index b96e48d7..00000000 Binary files a/docs/user/widgets/signal_label/test_screenshot.png and /dev/null differ diff --git a/docs/user/widgets/spinner/spinner.md b/docs/user/widgets/spinner/spinner.md deleted file mode 100644 index e4d4209f..00000000 --- a/docs/user/widgets/spinner/spinner.md +++ /dev/null @@ -1,68 +0,0 @@ -(user.widgets.spinner)= - -# Spinner Widget - -````{tab} Overview - -The `SpinnerWidget` is a simple and versatile widget designed to indicate loading or movement within an application. It is commonly used to show that a device is in motion or that an operation is ongoing. The `SpinnerWidget` can be easily integrated into your GUI application either through direct code instantiation or by using `BEC Designer`. - -## Key Features: -- **Loading Indicator**: Provides a visual indication of ongoing operations or device movement. -- **Smooth Animation**: Features a smooth, continuous spinning animation to catch the user's attention. -- **Easy Integration**: Can be added directly in code or through `BEC Designer`, making it adaptable to various use cases. -- **Customizable Appearance**: Automatically adapts to the application's theme, ensuring visual consistency. - -```` - -````{tab} Examples - -The `SpinnerWidget` can be embedded within a GUI application through direct code instantiation or by using `BEC Designer`. Below are examples demonstrating how to create and use the `SpinnerWidget`. - -## Example 1 - Creating a Spinner Widget in Code - -In this example, we demonstrate how to create a `SpinnerWidget` in code and start the spinner to indicate an ongoing operation. - -```python -from qtpy.QtWidgets import QApplication, QMainWindow -from bec_widgets.widgets.utility.spinner.spinner import SpinnerWidget - -app = QApplication([]) - -# Create a main window -window = QMainWindow() - -# Create a SpinnerWidget instance -spinner = SpinnerWidget() - -# Start the spinner -spinner.start() - -# Set the spinner as the central widget -window.setCentralWidget(spinner) -window.show() - -app.exec_() -``` - -## Example 2 - Stopping the Spinner - -You can stop the spinner to indicate that an operation has completed. - -```python -# Stop the spinner -spinner.stop() -``` - -## Example 3 - Integrating the Spinner Widget in BEC Designer - -The `SpinnerWidget` can be added to your GUI layout using `BEC Designer`. Once added, you can assign the spinner to an attribute of your application, and then control the spinner using the `start` and `stop` methods, similar to the code examples above. - -```python -# Example: Start the spinner in a BEC Designer-based application -self.spinner_widget.start() - -# Example: Stop the spinner in a BEC Designer-based application -self.spinner_widget.stop() -``` - -```` \ No newline at end of file diff --git a/docs/user/widgets/text_box/text_box.md b/docs/user/widgets/text_box/text_box.md deleted file mode 100644 index 5e7b5573..00000000 --- a/docs/user/widgets/text_box/text_box.md +++ /dev/null @@ -1,61 +0,0 @@ -(user.widgets.text_box)= - -# Text Box Widget - -````{tab} Overview - -The {py:class}`~bec_widgets.cli.client.TextBox` is a versatile widget that allows users to display text within the BEC GUI. It supports both plain text and HTML, making it useful for displaying simple messages or more complex formatted content. This widget is particularly suited for integrating textual content directly into the user interface, whether as a standalone message box or as part of a larger application interface. - -## Key Features: -- **Text Display**: Display either plain text or HTML content, with automatic detection of the format. -- **Automatic styling**: The widget automatically adheres to BEC's style guides. No need to worry about background colors, font sizes, or other appearance settings. - -## BEC Designer Properties -```{figure} ../../../assets/widget_screenshots/text_box_properties.png -``` - -```` - -````{tab} Examples - CLI - -The `TextBox` widget can be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. The following examples demonstrate how to create and customize the `TextBox` widget in various scenarios. - -## Example 1 - Adding Text Box Widget to BECDockArea - -In this example, we demonstrate how to add a `TextBox` widget to a `BECDockArea` and set the text to be displayed. - -```python -# Add a new dock with a TextBox widget -text_box = gui.bec.new().new(widget=gui.available_widgets.TextBox) - -# Set the text to display -text_box.set_plain_text("Hello, World!") -``` - -## Example 2 - Displaying HTML Content - -The `TextBox` widget can also render HTML content. This example shows how to display formatted HTML text. - -```python -# Set the text to display as HTML -text_box.set_html_text("

Welcome to BEC Widgets

This is an example of displaying HTML text.

") -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.TextBox - :members: - :show-inheritance: -``` -```` - - - - - - - - - diff --git a/docs/user/widgets/toggle/toggle.md b/docs/user/widgets/toggle/toggle.md deleted file mode 100644 index dd074f22..00000000 --- a/docs/user/widgets/toggle/toggle.md +++ /dev/null @@ -1,66 +0,0 @@ -(user.widgets.toggle)= - -# Toggle Switch Widget - -````{tab} Overview - -The {py:class}`~bec_widgets.cli.client.ToggleSwitch` widget provides a simple, customizable toggle switch that can be used to represent binary states (e.g., on/off, true/false) within a GUI. This widget is designed to be used directly in code or added through `BEC Designer`, making it versatile for various applications where a user-friendly switch is needed. - -## Key Features: -- **Binary State Representation**: Represents a simple on/off state with a smooth toggle animation. -- **Customizable Appearance**: Allows customization of track and thumb colors for both active and inactive states. -- **Smooth Animation**: Includes a smooth animation when toggling between states, enhancing user interaction. -- **BEC Designer Integration**: Can be added directly through `BEC Designer` or instantiated in code. - -```` - -````{tab} Examples - -The `Toggle Switch` widget can be integrated within a GUI application either through direct code instantiation or by using `BEC Designer`. Below are examples demonstrating how to create and customize the `Toggle Switch` widget. - -## Example 1 - Creating a Toggle Switch in Code - -In this example, we demonstrate how to create a `ToggleSwitch` widget in code and customize its appearance. - -```python -from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget -from bec_widgets.widgets.toggle_switch import ToggleSwitch - -class MyGui(QWidget): - def __init__(self, parent=None): - super().__init__(parent=parent) - self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget - - # Create and add the ToggleSwitch to the layout - self.toggle_switch = ToggleSwitch(parent=self) - self.layout().addWidget(self.toggle_switch) - -# Example of how this custom GUI might be used: -app = QApplication([]) -my_gui = MyGui() -my_gui.show() -app.exec_() -``` - -## Example 2 - Customizing the Toggle Switch Appearance - -The `ToggleSwitch` widget allows you to customize its appearance by changing the track and thumb colors for both active and inactive states. Below is an example of how to set these properties. - -```python -# Set the active and inactive track and thumb colors -self.toggle_switch.active_track_color = QColor(0, 122, 204) # Active state track color (blue) -self.toggle_switch.inactive_track_color = QColor(200, 200, 200) # Inactive state track color (grey) -self.toggle_switch.active_thumb_color = QColor(255, 255, 255) # Active state thumb color (white) -self.toggle_switch.inactive_thumb_color = QColor(255, 255, 255) # Inactive state thumb color (white) -``` - -## Example 3 - Integrating the Toggle Switch in BEC Designer - -The `ToggleSwitch` can be added as a custom widget in `BEC Designer`. Once integrated, you can configure its properties through the designer's property editor. After adding the widget to a form in BEC Designer, you can manipulate it in your PyQt/PySide application: - -```python -# For instance: -self.toggle_switch.setChecked(True) -``` - -```` \ No newline at end of file diff --git a/docs/user/widgets/waveform/bec_figure_dap.gif b/docs/user/widgets/waveform/bec_figure_dap.gif deleted file mode 100644 index 3905b0a1..00000000 Binary files a/docs/user/widgets/waveform/bec_figure_dap.gif and /dev/null differ diff --git a/docs/user/widgets/waveform/w1D.gif b/docs/user/widgets/waveform/w1D.gif deleted file mode 100644 index 247d2b99..00000000 Binary files a/docs/user/widgets/waveform/w1D.gif and /dev/null differ diff --git a/docs/user/widgets/waveform/waveform_widget.md b/docs/user/widgets/waveform/waveform_widget.md deleted file mode 100644 index c1d68e96..00000000 --- a/docs/user/widgets/waveform/waveform_widget.md +++ /dev/null @@ -1,108 +0,0 @@ -(user.widgets.waveform_widget)= - -# Waveform Widget - -````{tab} Overview - -The Waveform Widget is used to display 1D detector signals. The widget is directly integrated with the `BEC` framework and can display real-time data from detectors loaded in the current `BEC` session as well as custom data from users. - -## Key Features: -- **Flexible Integration**: The widget can be integrated into [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. -- **Data Visualization**: Real-time plotting of positioner versus detector values from the BEC session, as well as static plotting of custom data. -- **Real-time Data Processing**: Add real-time Data Processing Pipeline (DAP) to the real-time acquisition. -- **Data Export**: Export data to CSV, H5, and other formats. -- **Customizable Visual Elements**: Customize visual elements such as line color and style. -- **Interactive Controls**: Interactive controls for zooming and panning through the data. - -![Waveform 1D](./w1D.gif) -```` - -````{tab} Examples - CLI - -`WaveformWidget` can be embedded in [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BEC Designer`. However, the command-line API is the same for all cases. - -## Example 1 - Adding Waveform Widget as a dock with BECDockArea - -Adding `Waveform` into a [`BECDockArea`](user.widgets.bec_dock_area) is similar to adding any other widget. - -```python -# Add new WaveformWidgets to the BECDockArea -dock_area = gui.new('my_new_dock_area') # Create a new dock area -plt1 = dock_area.new().new('Waveform') -plt2 = gui.my_new_dock_area.new().new(gui.available_widgets.Waveform) # as an alternative example via dynamic name space - -# Add signals to the WaveformWidget -plt1.plot(device_x='samx', device_y='bpm4i') -plt2.plot(device_x='samx', device_y='bpm3i') - -# set axis labels -plt1.title = "Gauss plots vs. samx" -plt1.x_label = "Motor X" -plt1.y_label = "Gauss Signal (A.U.)" - -``` - -```{note} -The return value of the simulated devices *bpm4i* and *bpm3i* may not be Gaussian signals, but they can be easily configured with the code snippet below. For more details, please check the documentation for the [simulation](https://bec.readthedocs.io/en/latest/developer/devices/bec_sim.html). -``` - -```python -# bpm4i uses GaussianModel and samx as a reference; default settings -dev.bpm4i.sim.select_sim_model("GaussianModel") - -# bpm3i uses StepModel and samx as a reference; default settings -dev.bpm3i.sim.select_sim_model("StepModel") -``` -## Example 2- Adding Data Processing Pipeline Curve with LMFit Models - -In addition to the scan curve, you can also add a second curve that fits the signal using a specified model from [LMFit](https://lmfit.github.io/lmfit-py/builtin_models.html). The following code snippet demonstrates how to create a 1D waveform curve with an attached DAP process, or how to add a DAP process to an existing curve using the BEC CLI. Please note that for this example, both devices were set as Gaussian signals. You can also add a region of interest (roi) to the plot which will respected by all running DAP processes. - -```python -# Add a new dock_area, dock and Waveform and plot bpm4i vs samx with a GaussianModel DAP -plt = gui.new().new().new('Waveform') -plt.plot(device_x='samx', device_y='bpm4i', dap="GaussianModel") - -# Add a second curve to the same plot without DAP -plt.plot(device_x='samx', device_y='bpm3a') - -# Add DAP to the second curve -plt.add_dap_curve(device_label='bpm3a-bpm3a', dap_name='GaussianModel') - -# Add ROI to the plot, this limits the DAP fit to the selected region x_min=-1, x_max=1 -# The fit will automatically update -plt.select_roi(region=(-1, 1)) - -``` - -To get the parameters of the fit, you need to retrieve the curve objects and call the `dap_params` property. - -```python -# Get the curve object by name from the legend -dap_bpm4i = plt.get_curve("bpm4i-bpm4i-GaussianModel") -dap_bpm3a = plt.get_curve("bpm3a-bpm3a-GaussianModel") - -# Get the parameters of the fit -print(dap_bpm4i.dap_params) -# Output -{'amplitude': 197.399639720862, - 'center': 5.013486095404885, - 'sigma': 0.9820868875739888} - -print(dap_bpm3a.dap_params) -# Output -{'amplitude': 698.3072786185278, - 'center': 0.9702840866173836, - 'sigma': 1.97139754785518} -``` - -![Waveform 1D_DAP](./bec_figure_dap.gif) - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.Waveform - :members: - :show-inheritance: -``` -```` \ No newline at end of file diff --git a/docs/user/widgets/website/website.md b/docs/user/widgets/website/website.md deleted file mode 100644 index 25ca4322..00000000 --- a/docs/user/widgets/website/website.md +++ /dev/null @@ -1,73 +0,0 @@ -(user.widgets.website)= - -# Website Widget - -````{tab} Overview - -The {py:class}`~bec_widgets.cli.client.WebsiteWidget` is a versatile tool that allows users to display websites directly within the BEC GUI. This widget is useful for embedding documentation, dashboards, or any web-based tools within the application interface. It is designed to be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. - -## Key Features: -- **URL Display**: Set and display any website URL within the widget. -- **Navigation Controls**: Navigate through the website’s history with back and forward controls. -- **Reload Functionality**: Reload the currently displayed website to ensure up-to-date content. - -```` - -````{tab} Examples - CLI - -The `WebsiteWidget` can be embedded within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BEC Designer`. The following examples demonstrate how to create and use the `WebsiteWidget` in different scenarios. - -## Example 1 - Adding Website Widget to BECDockArea - -In this example, we demonstrate how to add a `WebsiteWidget` to a `BECDockArea` and set the URL of the website to be displayed. - -```python -# Add a new dock with a WebsiteWidget -dock_area = gui.new() -web = dock_area.new().new(gui.available_widgets.WebsiteWidget) - -# Set the URL of the website to display -web.set_url("https://bec.readthedocs.io/en/latest/") -``` - -## Example 2 - Navigating within the Website Widget - -The `WebsiteWidget` allows users to navigate back and forward through the website’s history. This example shows how to implement these navigation controls. -If you click on a link in the website, you can use the back and forward buttons to navigate through the history. - -```python -# Go back in the website history -web.back() - -# Go forward in the website history -web.forward() -``` - -## Example 3 - Reloading the Website - -To ensure that the displayed website content is up-to-date, you can use the reload functionality. - -```python -# Reload the current website -web.reload() -``` - -## Example 4 - Retrieving the Current URL - -You may want to retrieve the current URL being displayed in the `WebsiteWidget`. The following example demonstrates how to access the current URL. - -```python -# Get the current URL of the WebsiteWidget -current_url = web.get_url() -print(f"The current URL is: {current_url}") -``` - -```` - -````{tab} API -```{eval-rst} -.. autoclass:: bec_widgets.cli.client.WebsiteWidget - :members: - :show-inheritance: -``` -```` diff --git a/docs/user/widgets/widgets.md b/docs/user/widgets/widgets.md deleted file mode 100644 index 8f16f711..00000000 --- a/docs/user/widgets/widgets.md +++ /dev/null @@ -1,321 +0,0 @@ -(user.widgets)= -# Widgets - -BEC Widgets offers a range of tools designed to make data visualization in beamline experiments easier and more -interactive. These widgets help users better understand their data by providing clear, intuitive displays that enhance -the overall experience. - -## Widget Containers - -Serves as containers to organise and display other widgets. - -````{grid} 3 -:gutter: 2 - -```{grid-item-card} BEC Dock Area -:link: user.widgets.bec_dock_area -:link-type: ref -:img-top: /assets/widget_screenshots/dock_area.png - -Quickly build dynamic GUI. - -``` -```` - -## Plotting Widgets - -Plotting widgets are used to display data in a graphical format. - -````{grid} 3 -:gutter: 2 - -```{grid-item-card} Waveform Widget -:link: user.widgets.waveform_widget -:link-type: ref -:img-top: /assets/widget_screenshots/waveform_widget.png - -Display 1D detector signals. -``` - -```{grid-item-card} Multi Waveform Widget -:link: user.widgets.multi_waveform_widget -:link-type: ref -:img-top: /assets/widget_screenshots/multi_waveform.png - -Display multiple 1D waveforms. -``` - -```{grid-item-card} Scatter Waveform Widget -:link: user.widgets.scatter_waveform_widget -:link-type: ref -:img-top: /assets/widget_screenshots/scatter_waveform.png - -Display a 1D waveforms with a third device on the z-axis. -``` - -```{grid-item-card} Image Widget -:link: user.widgets.image_widget -:link-type: ref -:img-top: /assets/widget_screenshots/image_widget.png - -Display signal from 2D detector. -``` - -```{grid-item-card} Heatmap Widget -:link: user.widgets.heatmap_widget -:link-type: ref -:img-top: /assets/widget_screenshots/heatmap_widget.png - -Display 2D grid data with color mapping. -``` - -```{grid-item-card} Motor Map Widget -:link: user.widgets.motor_map -:link-type: ref -:img-top: /assets/widget_screenshots/motor_map_widget.png - -Track position for motors. -``` - -```` - -## Device Control Widgets - -Control and monitor devices/scan in the BEC environment. - -````{grid} 3 -:gutter: 2 - -```{grid-item-card} Scan Control Widget -:link: user.widgets.scan_control -:link-type: ref -:img-top: /assets/widget_screenshots/scan_controller.png - -Launch scans. -``` - -```{grid-item-card} Device Browser -:link: user.widgets.device_browser -:link-type: ref -:img-top: /assets/widget_screenshots/device_browser.png - -Find and drag devices. -``` - -```{grid-item-card} Positioner Box -:link: user.widgets.positioner_box -:link-type: ref -:img-top: /assets/widget_screenshots/device_box.png - -Control individual device. -``` - -```{grid-item-card} Positioner Box 2D -:link: user.widgets.positioner_box_2d -:link-type: ref -:img-top: /assets/widget_screenshots/positioner_box_2d.png - -Control two individual devices on perpendicular axes. -``` - -```{grid-item-card} Ring Progress Bar -:link: user.widgets.ring_progress_bar -:link-type: ref -:img-top: /assets/widget_screenshots/ring_progress_bar.png - -Nested progress bar. -``` - -```` - -## BEC Service Widgets - -Visualise the status of BEC services. - -````{grid} 3 -:gutter: 2 - -```{grid-item-card} BEC Status Box -:link: user.widgets.bec_status_box -:link-type: ref -:img-top: /assets/widget_screenshots/status_box.png - -Display status of BEC services. -``` - -```{grid-item-card} BEC Queue Table -:link: user.widgets.bec_queue -:link-type: ref -:img-top: /assets/widget_screenshots/queue.png - -Display current scan queue. -``` -```` - -## BEC Utility Widgets - -Various utility widgets to enhance user experience. - -````{grid} 3 -:gutter: 2 - -```{grid-item-card} Buttons Appearance -:link: user.widgets.buttons_appearance -:link-type: ref -:img-top: /assets/widget_screenshots/buttons.png - -Various buttons which manage the appearance of the BEC GUI. -``` - -```{grid-item-card} Buttons Queue -:link: user.widgets.buttons_queue -:link-type: ref -:img-top: /assets/widget_screenshots/buttons_queue.png - -Various buttons which manage the control of the BEC Queue. -``` - -```{grid-item-card} Device Input Widgets -:link: user.widgets.device_input -:link-type: ref -:img-top: /assets/widget_screenshots/device_inputs.png - -Choose individual device from current session. -``` - -```{grid-item-card} Signal Label -:link: user.widgets.signal_label -:link-type: ref -:img-top: ./signal_label/test_screenshot.png - -Display the live value of a signal. -``` - -```{grid-item-card} Signal Input Widgets -:link: user.widgets.signal_input -:link-type: ref -:img-top: /assets/widget_screenshots/signal_inputs.png - -Choose individual signals available for a selected device. -``` - -```{grid-item-card} Text Box Widget -:link: user.widgets.text_box -:link-type: ref -:img-top: /assets/widget_screenshots/text_box.png - -Display custom text or HTML content. -``` - -```{grid-item-card} Website Widget -:link: user.widgets.website -:link-type: ref -:img-top: /assets/widget_screenshots/website.png - -Display website content. -``` - -```{grid-item-card} Toggle Widget -:link: user.widgets.toggle -:link-type: ref -:img-top: /assets/widget_screenshots/toggle.png - -Angular like toggle switch. -``` - -```{grid-item-card} Spinner -:link: user.widgets.spinner -:link-type: ref -:img-top: /assets/widget_screenshots/spinner.gif - -Display spinner widget for loading or device movement. -``` - -```{grid-item-card} BEC Progressbar -:link: user.widgets.bec_progressbar -:link-type: ref -:img-top: /assets/widget_screenshots/bec_progressbar.png - -Modern progress bar for BEC. -``` - -```{grid-item-card} Position Indicator -:link: user.widgets.position_indicator -:link-type: ref -:img-top: /assets/widget_screenshots/position_indicator.png - -Display position of motor within its limits. -``` - -```{grid-item-card} LMFit Dialog -:link: user.widgets.lmfit_dialog -:link-type: ref -:img-top: /assets/widget_screenshots/lmfit_dialog.png - -Display DAP summaries of LMFit models in a window. -``` - -```{grid-item-card} DAP ComboBox -:link: user.widgets.dap_combo_box -:link-type: ref -:img-top: /assets/widget_screenshots/dap_combo_box.png - -Select DAP model from a list of DAP processes. -``` - -```{grid-item-card} Log panel widget -:link: user.widgets.log_panel -:link-type: ref -:img-top: /user/widgets/log_panel/logpanel.png - -Show and filter logs from the BEC Redis server. -``` - -```{grid-item-card} PDF Viewer Widget -:link: user.widgets.pdf_viewer_widget -:link-type: ref -:img-top: /assets/widget_screenshots/pdf_viewer.png - -Display and navigate PDF documents. -``` -```` - -```{toctree} ---- -maxdepth: 1 -hidden: true ---- - -dock_area/bec_dock_area.md -waveform/waveform_widget.md -scatter_waveform/scatter_waveform.md -multi_waveform/multi_waveform.md -image/image_widget.md -heatmap/heatmap_widget.md -motor_map/motor_map.md -scan_control/scan_control.md -progress_bar/ring_progress_bar.md -bec_status_box/bec_status_box.md -queue/queue.md -buttons_appearance/buttons_appearance.md -buttons_queue/button_queue.md -device_browser/device_browser.md -positioner_box/positioner_box.md -positioner_box/positioner_box_2d.md -text_box/text_box.md -website/website.md -toggle/toggle.md -spinner/spinner.md -bec_progressbar/bec_progressbar.md -device_input/device_input.md -signal_input/signal_input.md -position_indicator/position_indicator.md -lmfit_dialog/lmfit_dialog.md -dap_combo_box/dap_combo_box.md -games/games.md -log_panel/log_panel.md -signal_label/signal_label.md -pdf_viewer/pdf_viewer_widget.md - - -``` \ No newline at end of file