bec-widgets 0.99.1__py3-none-any.whl → 0.99.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (250) hide show
  1. .gitlab-ci.yml +0 -1
  2. CHANGELOG.md +76 -70
  3. PKG-INFO +2 -2
  4. bec_widgets/cli/client.py +3 -3
  5. bec_widgets/qt_utils/toolbar.py +11 -5
  6. bec_widgets/utils/bec_widget.py +11 -2
  7. bec_widgets/utils/colors.py +18 -2
  8. bec_widgets/utils/plugin_templates/plugin.template +2 -2
  9. bec_widgets/widgets/bec_queue/bec_queue.py +2 -0
  10. bec_widgets/widgets/bec_queue/bec_queue_plugin.py +1 -1
  11. bec_widgets/widgets/bec_status_box/bec_status_box.py +2 -0
  12. bec_widgets/widgets/bec_status_box/bec_status_box_plugin.py +1 -1
  13. bec_widgets/widgets/color_button/color_button.py +2 -0
  14. bec_widgets/widgets/color_button/color_button_plugin.py +1 -1
  15. bec_widgets/widgets/colormap_selector/colormap_selector.py +1 -0
  16. bec_widgets/widgets/colormap_selector/colormap_selector_plugin.py +1 -1
  17. bec_widgets/widgets/dark_mode_button/dark_mode_button.py +12 -3
  18. bec_widgets/widgets/dark_mode_button/dark_mode_button_plugin.py +1 -1
  19. bec_widgets/widgets/device_browser/device_browser.py +2 -0
  20. bec_widgets/widgets/device_browser/device_browser_plugin.py +1 -1
  21. bec_widgets/widgets/device_combobox/device_combo_box_plugin.py +1 -1
  22. bec_widgets/widgets/device_combobox/device_combobox.py +2 -0
  23. bec_widgets/widgets/device_line_edit/device_line_edit.py +2 -0
  24. bec_widgets/widgets/device_line_edit/device_line_edit_plugin.py +1 -1
  25. bec_widgets/widgets/dock/dock.py +1 -0
  26. bec_widgets/widgets/dock/dock_area.py +30 -10
  27. bec_widgets/widgets/dock/dock_area_plugin.py +1 -1
  28. bec_widgets/widgets/figure/figure.py +1 -1
  29. bec_widgets/widgets/figure/plots/waveform/waveform.py +12 -7
  30. bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +3 -3
  31. bec_widgets/widgets/image/bec_image_widget_plugin.py +1 -1
  32. bec_widgets/widgets/image/image_widget.py +1 -0
  33. bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py +1 -1
  34. bec_widgets/widgets/motor_map/motor_map_widget.py +1 -0
  35. bec_widgets/widgets/position_indicator/position_indicator.py +2 -0
  36. bec_widgets/widgets/position_indicator/position_indicator_plugin.py +1 -1
  37. bec_widgets/widgets/positioner_box/positioner_box.py +1 -0
  38. bec_widgets/widgets/positioner_box/positioner_box_plugin.py +1 -1
  39. bec_widgets/widgets/positioner_box/positioner_control_line.py +2 -0
  40. bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +1 -1
  41. bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py +1 -0
  42. bec_widgets/widgets/ring_progress_bar/ring_progress_bar_plugin.py +1 -1
  43. bec_widgets/widgets/scan_control/scan_control.py +2 -0
  44. bec_widgets/widgets/scan_control/scan_control_plugin.py +1 -4
  45. bec_widgets/widgets/spinner/spinner.py +2 -0
  46. bec_widgets/widgets/spinner/spinner_widget_plugin.py +1 -1
  47. bec_widgets/widgets/stop_button/stop_button.py +2 -0
  48. bec_widgets/widgets/stop_button/stop_button_plugin.py +1 -1
  49. bec_widgets/widgets/text_box/text_box.py +1 -0
  50. bec_widgets/widgets/text_box/text_box_plugin.py +1 -1
  51. bec_widgets/widgets/toggle/toggle.py +1 -0
  52. bec_widgets/widgets/toggle/toggle_switch_plugin.py +1 -1
  53. bec_widgets/widgets/vscode/vs_code_editor_plugin.py +1 -1
  54. bec_widgets/widgets/vscode/vscode.py +1 -0
  55. bec_widgets/widgets/waveform/bec_waveform_widget_plugin.py +1 -1
  56. bec_widgets/widgets/waveform/waveform_popups/curve_dialog/curve_dialog.py +14 -13
  57. bec_widgets/widgets/waveform/waveform_widget.py +3 -2
  58. bec_widgets/widgets/website/website.py +42 -10
  59. bec_widgets/widgets/website/website_widget_plugin.py +1 -1
  60. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/METADATA +2 -2
  61. bec_widgets-0.99.9.dist-info/RECORD +231 -0
  62. pyproject.toml +7 -2
  63. bec_widgets/assets/toolbar_icons/add.svg +0 -3
  64. bec_widgets/assets/toolbar_icons/attach_all.svg +0 -3
  65. bec_widgets/assets/toolbar_icons/auto_range.svg +0 -3
  66. bec_widgets/assets/toolbar_icons/compare.svg +0 -3
  67. bec_widgets/assets/toolbar_icons/connection.svg +0 -4
  68. bec_widgets/assets/toolbar_icons/device_line_edit.svg +0 -3
  69. bec_widgets/assets/toolbar_icons/drag_pan_mode.svg +0 -3
  70. bec_widgets/assets/toolbar_icons/export.svg +0 -9
  71. bec_widgets/assets/toolbar_icons/fft.svg +0 -11
  72. bec_widgets/assets/toolbar_icons/fitting_parameters.svg +0 -3
  73. bec_widgets/assets/toolbar_icons/history.svg +0 -4
  74. bec_widgets/assets/toolbar_icons/image.svg +0 -3
  75. bec_widgets/assets/toolbar_icons/image_autorange.svg +0 -3
  76. bec_widgets/assets/toolbar_icons/import.svg +0 -9
  77. bec_widgets/assets/toolbar_icons/line_axis.svg +0 -3
  78. bec_widgets/assets/toolbar_icons/line_curve.svg +0 -3
  79. bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +0 -3
  80. bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
  81. bec_widgets/assets/toolbar_icons/motor_map.svg +0 -3
  82. bec_widgets/assets/toolbar_icons/photo_library.svg +0 -3
  83. bec_widgets/assets/toolbar_icons/positioner_box.svg +0 -3
  84. bec_widgets/assets/toolbar_icons/progress.svg +0 -3
  85. bec_widgets/assets/toolbar_icons/queue.svg +0 -3
  86. bec_widgets/assets/toolbar_icons/rectangle_mode.svg +0 -3
  87. bec_widgets/assets/toolbar_icons/remove.svg +0 -5
  88. bec_widgets/assets/toolbar_icons/reset_settings.svg +0 -3
  89. bec_widgets/assets/toolbar_icons/restore_state.svg +0 -3
  90. bec_widgets/assets/toolbar_icons/ring_progress.svg +0 -3
  91. bec_widgets/assets/toolbar_icons/rotate_left.svg +0 -3
  92. bec_widgets/assets/toolbar_icons/rotate_right.svg +0 -3
  93. bec_widgets/assets/toolbar_icons/save.svg +0 -3
  94. bec_widgets/assets/toolbar_icons/save_state.svg +0 -3
  95. bec_widgets/assets/toolbar_icons/scan_control.svg +0 -3
  96. bec_widgets/assets/toolbar_icons/settings.svg +0 -4
  97. bec_widgets/assets/toolbar_icons/status.svg +0 -3
  98. bec_widgets/assets/toolbar_icons/terminal.svg +0 -3
  99. bec_widgets/assets/toolbar_icons/transform.svg +0 -3
  100. bec_widgets/assets/toolbar_icons/waveform.svg +0 -3
  101. bec_widgets-0.99.1.dist-info/RECORD +0 -415
  102. docs/Makefile +0 -20
  103. docs/_static/custom.css +0 -170
  104. docs/_templates/custom-class-template.rst +0 -34
  105. docs/_templates/custom-module-template.rst +0 -66
  106. docs/api_reference/api_reference.md +0 -12
  107. docs/assets/apps_48dp.svg +0 -1
  108. docs/assets/display_settings_48dp.svg +0 -1
  109. docs/assets/index_api.svg +0 -97
  110. docs/assets/index_contribute.svg +0 -76
  111. docs/assets/index_getting_started.svg +0 -66
  112. docs/assets/index_user_guide.svg +0 -67
  113. docs/assets/rocket_launch_48dp.svg +0 -1
  114. docs/assets/widget_screenshots/buttons.png +0 -0
  115. docs/assets/widget_screenshots/device_box.png +0 -0
  116. docs/assets/widget_screenshots/device_browser.png +0 -0
  117. docs/assets/widget_screenshots/device_inputs.png +0 -0
  118. docs/assets/widget_screenshots/dock_area.png +0 -0
  119. docs/assets/widget_screenshots/figure.png +0 -0
  120. docs/assets/widget_screenshots/image_widget.png +0 -0
  121. docs/assets/widget_screenshots/motor_map_widget.png +0 -0
  122. docs/assets/widget_screenshots/position_indicator.png +0 -0
  123. docs/assets/widget_screenshots/queue.png +0 -0
  124. docs/assets/widget_screenshots/ring_progress_bar.png +0 -0
  125. docs/assets/widget_screenshots/scan_controller.png +0 -0
  126. docs/assets/widget_screenshots/spinner.gif +0 -0
  127. docs/assets/widget_screenshots/status_box.png +0 -0
  128. docs/assets/widget_screenshots/text_box.png +0 -0
  129. docs/assets/widget_screenshots/toggle.png +0 -0
  130. docs/assets/widget_screenshots/waveform_widget.png +0 -0
  131. docs/assets/widget_screenshots/website.png +0 -0
  132. docs/conf.py +0 -82
  133. docs/developer/developer.md +0 -52
  134. docs/developer/introduction/concepts.md +0 -14
  135. docs/developer/introduction/contributing.md +0 -28
  136. docs/developer/introduction/introduction.md +0 -16
  137. docs/developer/introduction/useful_links.md +0 -23
  138. docs/developer/widget_development/bec_dispatcher.md +0 -143
  139. docs/developer/widget_development/widget_development.md +0 -13
  140. docs/index.md +0 -74
  141. docs/introduction/introduction.md +0 -18
  142. docs/make.bat +0 -35
  143. docs/requirements.txt +0 -12
  144. docs/user/api_reference/api_reference.md +0 -11
  145. docs/user/applications/applications.md +0 -10
  146. docs/user/customisation.md +0 -123
  147. docs/user/getting_started/BECDockArea.png +0 -0
  148. docs/user/getting_started/auto_updates.md +0 -82
  149. docs/user/getting_started/getting_started.md +0 -15
  150. docs/user/getting_started/gui_complex_gui.gif +0 -0
  151. docs/user/getting_started/installation.md +0 -33
  152. docs/user/getting_started/quick_start.md +0 -110
  153. docs/user/getting_started/video_tutorials.md +0 -17
  154. docs/user/user.md +0 -71
  155. docs/user/widgets/bec_figure/BECFigure.png +0 -0
  156. docs/user/widgets/bec_figure/bec_figure.md +0 -105
  157. docs/user/widgets/bec_status_box/bec_status_box.gif +0 -0
  158. docs/user/widgets/bec_status_box/bec_status_box.md +0 -38
  159. docs/user/widgets/buttons/buttons.md +0 -63
  160. docs/user/widgets/buttons/dark_mode_disabled.png +0 -0
  161. docs/user/widgets/buttons/dark_mode_enabled.png +0 -0
  162. docs/user/widgets/device_browser/device_browser.md +0 -36
  163. docs/user/widgets/device_browser/device_browser.png +0 -0
  164. docs/user/widgets/device_input/device_input.md +0 -100
  165. docs/user/widgets/dock_area/BECDockArea.png +0 -0
  166. docs/user/widgets/dock_area/bec_dock_area.md +0 -107
  167. docs/user/widgets/image/image_plot.gif +0 -0
  168. docs/user/widgets/image/image_widget.md +0 -84
  169. docs/user/widgets/motor_map/motor.gif +0 -0
  170. docs/user/widgets/motor_map/motor_map.md +0 -80
  171. docs/user/widgets/position_indicator/position_indicator.md +0 -76
  172. docs/user/widgets/positioner_box/positioner_box.md +0 -63
  173. docs/user/widgets/progress_bar/progress_bar.gif +0 -0
  174. docs/user/widgets/progress_bar/ring_progress_bar.md +0 -103
  175. docs/user/widgets/queue/queue.md +0 -41
  176. docs/user/widgets/scan_control/hide_scan_control.png +0 -0
  177. docs/user/widgets/scan_control/scan_control.gif +0 -0
  178. docs/user/widgets/scan_control/scan_control.md +0 -54
  179. docs/user/widgets/spinner/spinner.md +0 -75
  180. docs/user/widgets/text_box/text_box.md +0 -74
  181. docs/user/widgets/toggle/toggle.md +0 -66
  182. docs/user/widgets/waveform/bec_figure_dap.gif +0 -0
  183. docs/user/widgets/waveform/scatter_2D.gif +0 -0
  184. docs/user/widgets/waveform/w1D.gif +0 -0
  185. docs/user/widgets/waveform/waveform_widget.md +0 -132
  186. docs/user/widgets/website/website.md +0 -69
  187. docs/user/widgets/widgets.md +0 -220
  188. tests/__init__.py +0 -0
  189. tests/end-2-end/__init__.py +0 -0
  190. tests/end-2-end/conftest.py +0 -53
  191. tests/end-2-end/test_bec_dock_rpc_e2e.py +0 -298
  192. tests/end-2-end/test_bec_figure_rpc_e2e.py +0 -212
  193. tests/end-2-end/test_rpc_register_e2e.py +0 -40
  194. tests/end-2-end/test_scan_control_e2e.py +0 -71
  195. tests/references/SpinnerWidget/SpinnerWidget_darwin.png +0 -0
  196. tests/references/SpinnerWidget/SpinnerWidget_linux.png +0 -0
  197. tests/references/SpinnerWidget/SpinnerWidget_started_darwin.png +0 -0
  198. tests/references/SpinnerWidget/SpinnerWidget_started_linux.png +0 -0
  199. tests/unit_tests/__init__.py +0 -0
  200. tests/unit_tests/client_mocks.py +0 -189
  201. tests/unit_tests/conftest.py +0 -64
  202. tests/unit_tests/test_bec_connector.py +0 -80
  203. tests/unit_tests/test_bec_dispatcher.py +0 -119
  204. tests/unit_tests/test_bec_dock.py +0 -155
  205. tests/unit_tests/test_bec_figure.py +0 -270
  206. tests/unit_tests/test_bec_image.py +0 -63
  207. tests/unit_tests/test_bec_image_widget.py +0 -217
  208. tests/unit_tests/test_bec_motor_map.py +0 -282
  209. tests/unit_tests/test_bec_queue.py +0 -111
  210. tests/unit_tests/test_bec_status_box.py +0 -123
  211. tests/unit_tests/test_client_utils.py +0 -76
  212. tests/unit_tests/test_color_map_selector.py +0 -42
  213. tests/unit_tests/test_color_validation.py +0 -75
  214. tests/unit_tests/test_configs/config_device.yaml +0 -33
  215. tests/unit_tests/test_configs/config_device_no_entry.yaml +0 -27
  216. tests/unit_tests/test_configs/config_scan.yaml +0 -82
  217. tests/unit_tests/test_crosshair.py +0 -143
  218. tests/unit_tests/test_dark_mode_button.py +0 -70
  219. tests/unit_tests/test_device_browser.py +0 -83
  220. tests/unit_tests/test_device_input_base.py +0 -76
  221. tests/unit_tests/test_device_input_widgets.py +0 -178
  222. tests/unit_tests/test_error_utils.py +0 -63
  223. tests/unit_tests/test_generate_cli_client.py +0 -123
  224. tests/unit_tests/test_generate_plugin.py +0 -155
  225. tests/unit_tests/test_motor_map_widget.py +0 -194
  226. tests/unit_tests/test_msgs/__init__.py +0 -0
  227. tests/unit_tests/test_msgs/available_scans_message.py +0 -989
  228. tests/unit_tests/test_plot_base.py +0 -95
  229. tests/unit_tests/test_plugin_utils.py +0 -13
  230. tests/unit_tests/test_positioner_box.py +0 -130
  231. tests/unit_tests/test_ring_progress_bar.py +0 -337
  232. tests/unit_tests/test_rpc_register.py +0 -52
  233. tests/unit_tests/test_rpc_server.py +0 -42
  234. tests/unit_tests/test_rpc_widget_handler.py +0 -7
  235. tests/unit_tests/test_scan_control.py +0 -324
  236. tests/unit_tests/test_scan_control_group_box.py +0 -160
  237. tests/unit_tests/test_setting_dialog.py +0 -96
  238. tests/unit_tests/test_spinner.py +0 -31
  239. tests/unit_tests/test_stop_button.py +0 -27
  240. tests/unit_tests/test_text_box_widget.py +0 -54
  241. tests/unit_tests/test_toggle.py +0 -38
  242. tests/unit_tests/test_vscode_widget.py +0 -75
  243. tests/unit_tests/test_waveform1d.py +0 -712
  244. tests/unit_tests/test_waveform_widget.py +0 -462
  245. tests/unit_tests/test_website_widget.py +0 -25
  246. tests/unit_tests/test_widget_io.py +0 -90
  247. tests/unit_tests/test_yaml_dialog.py +0 -163
  248. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/WHEEL +0 -0
  249. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/entry_points.txt +0 -0
  250. {bec_widgets-0.99.1.dist-info → bec_widgets-0.99.9.dist-info}/licenses/LICENSE +0 -0
Binary file
Binary file
Binary file
Binary file
docs/conf.py DELETED
@@ -1,82 +0,0 @@
1
- # Configuration file for the Sphinx documentation builder.
2
- #
3
- # For the full list of built-in configuration values, see the documentation:
4
- # https://www.sphinx-doc.org/en/master/usage/configuration.html
5
-
6
- # -- Project information -----------------------------------------------------
7
- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8
-
9
- import os
10
- import pathlib
11
-
12
- import tomli
13
-
14
- project = "BEC Widgets"
15
- copyright = "2023, Paul Scherrer Institute"
16
- author = "Paul Scherrer Institute"
17
-
18
- # -- General configuration ---------------------------------------------------
19
- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
20
-
21
- current_path = pathlib.Path(__file__).parent.parent.resolve()
22
- version_path = f"{current_path}/pyproject.toml"
23
-
24
-
25
- def get_version():
26
- """load the version from the version file"""
27
- with open(version_path, "r", encoding="utf-8") as file:
28
- res = tomli.loads(file.read())
29
- return res["project"]["version"]
30
-
31
-
32
- release = get_version()
33
-
34
- extensions = [
35
- "sphinx.ext.autodoc",
36
- "sphinx.ext.autosummary",
37
- # "sphinx.ext.coverage",
38
- "sphinx.ext.viewcode",
39
- "sphinx.ext.napoleon",
40
- "sphinx_toolbox.collapse",
41
- "sphinx_copybutton",
42
- "myst_parser",
43
- "sphinx_design",
44
- "sphinx_inline_tabs",
45
- ]
46
-
47
- myst_enable_extensions = [
48
- "amsmath",
49
- "attrs_inline",
50
- "colon_fence",
51
- "deflist",
52
- "dollarmath",
53
- "fieldlist",
54
- "html_admonition",
55
- "html_image",
56
- "replacements",
57
- "smartquotes",
58
- "strikethrough",
59
- "substitution",
60
- "tasklist",
61
- ]
62
-
63
- autosummary_generate = True # Turn on sphinx.ext.autosummary
64
- add_module_names = False # Remove namespaces from class/method signatures
65
- autodoc_inherit_docstrings = True # If no docstring, inherit from base class
66
- set_type_checking_flag = True # Enable 'expensive' imports for sphinx_autodoc_typehints
67
- autoclass_content = "both" # Include both class docstring and __init__
68
- autodoc_mock_imports = ["pyqtgraph", "qtpy", "PySide6"]
69
-
70
- # Add any paths that contain templates here, relative to this directory.
71
- templates_path = ["_templates"]
72
- exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
73
-
74
- language = "Python"
75
-
76
- # -- Options for HTML output -------------------------------------------------
77
- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
78
-
79
- html_theme = "pydata_sphinx_theme"
80
- html_static_path = ["_static"]
81
- html_css_files = ["custom.css"]
82
- html_logo = "../bec_widgets/assets/app_icons/bec_widgets_icon.png"
@@ -1,52 +0,0 @@
1
- (developer)=
2
- # Developer
3
-
4
- 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.
5
-
6
- 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).
7
-
8
- ```{toctree}
9
- ---
10
- maxdepth: 2
11
- hidden: true
12
- ---
13
-
14
- introduction/introduction.md
15
- widget_development/widget_development.md
16
- api_reference/api_reference.md
17
- ```
18
-
19
-
20
- ***
21
-
22
- ````{grid} 2
23
- :gutter: 5
24
-
25
- ```{grid-item-card}
26
- :link: developer.introduction
27
- :link-type: ref
28
- :img-top: /assets/rocket_launch_48dp.svg
29
- :text-align: center
30
- :class-item: index-card
31
-
32
- ## Introduction
33
-
34
- An introduction into the single-resposibility principle and the modular design of BEC Widgets.
35
- ```
36
-
37
- ```{grid-item-card}
38
- :link: developer.widget_development
39
- :link-type: ref
40
- :img-top: /assets/apps_48dp.svg
41
- :text-align: center
42
- :class-item: index-card
43
-
44
- ## Widget Development
45
-
46
- Learn how to develop a new modular widget for BEC Widgets.
47
- ```
48
-
49
- ````{grid} 2
50
-
51
-
52
-
@@ -1,14 +0,0 @@
1
- (developer.concepts)=
2
- # Concepts
3
- This section provides an overview of the core concepts of BEC Widgets, which are based on the single-responsibility principle and modular design.
4
-
5
- ## Moduler Design
6
- 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.
7
-
8
- We offer up to three different options for composing larger GUIs from these modular widgets: BECDesigner, 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).
9
-
10
- ## Client-Server Architecture
11
-
12
- 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.
13
- In the context of BEC Widgets, the [`BECDispatcher`](/api_reference/_autosummary/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.
14
-
@@ -1,28 +0,0 @@
1
- (developer.contributing)=
2
- # Contributing
3
-
4
- If you like to contribute to the development of BEC Widgets, you can follow the steps below to set up your development environment.
5
- BEC Widgets works in conjunction with [BEC](https://bec.readthedocs.io/en/latest/).
6
- 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.
7
-
8
- If you already have a BEC environment set up, you can install BEC Widgets in editable mode into your BEC Python environment.
9
-
10
- **Prerequisites**
11
- 1. **Python Version:** BEC Widgets requires Python version 3.10 or higher. Verify your Python version to ensure compatibility.
12
- 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/).
13
- 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.
14
-
15
- **Clone the Repository**:
16
- ```bash
17
- git clone https://gitlab.psi.ch/bec/bec_widgets
18
- cd bec_widgets
19
- ```
20
- **Install in Editable Mode**:
21
-
22
- Please install the package in editable mode into your BEC Python environemnt.
23
- ```bash
24
- pip install -e '.[dev,pyside6]'
25
- ```
26
- This installs the package together with [PySide6](https://doc.qt.io/qtforpython-6/quickstart.html).
27
-
28
-
@@ -1,16 +0,0 @@
1
- (developer.introduction)=
2
- # Introduction
3
- 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.
4
- These widgets provide data visualisation tools and experimental control interfaces by triggering actions within BEC.
5
- 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.
6
-
7
- ```{toctree}
8
- ---
9
- maxdepth: 2
10
- hidden: false
11
- ---
12
-
13
- concepts/
14
- contributing/
15
- useful_links/
16
- ```
@@ -1,23 +0,0 @@
1
- (developer.useful_links)=
2
-
3
- # Useful Links
4
-
5
- If you're new to the Qt framework, here are some helpful resources to get you started. In BEC Widgets, we use Qt
6
- distributions based on Qt6, specifically PyQt6 and PySide6. However, all code should be written using
7
- the [`qtpy`](https://pypi.org/project/QtPy/) abstraction layer, which allows compatibility with both. While both PyQt6
8
- and PySide6 are supported, we prefer PySide6 as it is the official Python binding from the Qt Company. It offers
9
- advantages like bundling all necessary libraries in a single package with pip installation and staying more up-to-date
10
- compared to PyQt6.
11
-
12
- Below is a list of useful links to help you start developing with Qt and QtDesigner:
13
-
14
- - [Python GUIs](https://www.pythonguis.com): A great resource with tutorials and examples for creating GUIs in Python
15
- using various frameworks.
16
- - [PySide6 Quick Start Guide](https://doc.qt.io/qtforpython-6/index.html): The official documentation for PySide6,
17
- including quick start guides and tutorials.
18
- - [QtDesigner Official Documentation](https://doc.qt.io/qt-6/qtdesigner-manual.html): Comprehensive documentation for
19
- QtDesigner.
20
- - [Simple PyQt Tutorial from RealPython](https://realpython.com/python-pyqt-gui-calculator/): A beginner-friendly
21
- tutorial on creating your first GUI application with PyQt.
22
- - [PyQtGraph Documentation](https://pyqtgraph.readthedocs.io/en/latest/): BEC Widgets relies on PyQtGraph for plotting;
23
- this is the official documentation.
@@ -1,143 +0,0 @@
1
- (developer.bec_dispatcher)=
2
-
3
- # BECDispatcher
4
-
5
- ## Overview
6
-
7
- 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)
8
- is a powerful tool that
9
- simplifies the process of connecting Qt slots to message updates from the BEC server. It enables real-time communication
10
- between your widget and the BEC server by listening to specific message channels and triggering callbacks when new data
11
- is received.
12
-
13
- This tool is especially useful for creating widgets that need to respond to dynamic data, such as device readbacks or
14
- scan updates. By
15
- 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),
16
- you
17
- can create callback functions that react to incoming messages and update your widget's state or perform other tasks
18
- based on the data received.
19
-
20
- ## How It Works
21
-
22
- When you create a widget that needs to respond to updates from the BEC server, you can use
23
- 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)
24
- to
25
- connect specific Qt slots (callback functions) to message endpoints. These endpoints are defined within the BEC system
26
- and represent specific channels of information (
27
- 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),
28
- [`scan_segment`](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_lib.endpoints.MessageEndpoints.html#bec_lib.endpoints.MessageEndpoints.scan_segment),
29
- etc.).
30
-
31
- ### Step-by-Step Guide
32
-
33
- 1. **Create a Callback Function**: Define a function within your widget that will handle the data received from the BEC
34
- server. This function should usually accept two parameters: `msg_content` (the message content) and `metadata` (
35
- additional
36
- information about the message).
37
-
38
- ```python
39
- # Example for a callback function that updates a widget display based on motor readback data
40
- from qtpy.QtCore import Slot
41
-
42
- @Slot(dict, dict)
43
- def on_device_readback(self, msg_content, metadata):
44
- # Process the incoming data
45
- new_value = msg_content["signals"]['motor_x']["value"]
46
- # Update the widget's display or perform another action
47
- self.update_display(new_value)
48
- ```
49
-
50
- 2. **Connect the Slot to an Endpoint**: Use
51
- 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)
52
- to connect your callback function to a specific
53
- endpoint. The endpoint represents the type of data or message you're interested in.
54
-
55
- ```python
56
- from bec_lib.endpoints import MessageEndpoints
57
-
58
- self.bec_dispatcher.connect_slot(self.on_device_readback, MessageEndpoints.device_readback("motor_x"))
59
- ```
60
-
61
- 3. **Handle Incoming Data**: Your callback function will be triggered automatically whenever a new message is received
62
- on the connected endpoint. Use the data in `msg_content` to update your widget or perform other actions.
63
-
64
- 4. **Clean Up Connections**: If your widget is being destroyed or you no longer need to listen for updates, make sure to
65
- disconnect your slots from
66
- 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)
67
- to avoid memory or thread leaks.
68
-
69
- ```python
70
- self.bec_dispatcher.disconnect_slot(self.on_device_readback, MessageEndpoints.device_readback("motor_x"))
71
- ```
72
-
73
- ### Example: Motor Map Widget
74
-
75
- 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)
76
- widget is a great example of
77
- 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)
78
- can be used to handle real-time data updates. This
79
- widget listens for updates on specific motor positions and dynamically updates the motor map display.
80
-
81
- Here's a breakdown of
82
- 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)
83
- is used in
84
- 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)
85
- widget:
86
-
87
- 1. **Connecting to Motor Readbacks**:
88
- The widget connects to
89
- 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)
90
- endpoints using
91
- 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)
92
- method
93
- 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).
94
- This allows
95
- the widget to receive real-time updates about the motor positions.
96
-
97
- ```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py
98
- :language: python
99
- :pyobject: BECMotorMap._connect_motor_to_slots
100
- :dedent: 4
101
- ```
102
-
103
- 2. **Handling Readback Data**:
104
- The `on_device_readback` slot is called whenever new data is received from the motor readback. This slot processes
105
- the data and updates the motor map plot accordingly.
106
-
107
- ```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py
108
- :language: python
109
- :pyobject: BECMotorMap.on_device_readback
110
- :dedent: 4
111
- ```
112
-
113
- 3. **Updating the Plot**:
114
- The motor map plot is updated in response to the new data, providing a real-time visualization of the motor's
115
- position.
116
-
117
- ```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py
118
- :language: python
119
- :pyobject: BECMotorMap._update_plot
120
- :dedent: 4
121
- ```
122
-
123
- 4. **Disconnecting When No Longer Needed**:
124
- The widget ensures that connections are properly cleaned up when no longer needed.
125
-
126
- ```{literalinclude} ../../../bec_widgets/widgets/figure/plots/motor_map/motor_map.py
127
- :language: python
128
- :pyobject: BECMotorMap._update_plot
129
- :dedent: 4
130
- ```
131
-
132
- ## Conclusion
133
-
134
- 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)
135
- is a key tool for developing interactive and responsive widgets within the BEC framework. By
136
- leveraging this tool, you can create widgets that automatically respond to real-time data updates from the BEC server,
137
- enhancing the interactivity and functionality of your user interface.
138
-
139
- In next tutorials we will cover how to create a custom widget using the BECDispatcher and BECWidget base class.
140
-
141
- ```{note}
142
- 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).
143
- ```
@@ -1,13 +0,0 @@
1
- (developer.widget_development)=
2
- # Widget development
3
- 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)
4
-
5
- ```{toctree}
6
- ---
7
- maxdepth: 2
8
- hidden: false
9
- ---
10
-
11
- bec_dispatcher
12
-
13
- ```
docs/index.md DELETED
@@ -1,74 +0,0 @@
1
- # BEC Widgets documentation
2
-
3
- A flexible and extensible framework for building graphical user interfaces in Python, optimized for use in the BEC environment.
4
-
5
- <br><br>
6
-
7
- <br><br>
8
-
9
- ````{grid} 2
10
- :gutter: 5
11
-
12
- ```{grid-item-card}
13
- :link: introduction
14
- :link-type: ref
15
- :img-top: /assets/index_getting_started.svg
16
- :text-align: center
17
- :class-item: index-card
18
-
19
- ## Introduction
20
-
21
- General information about BEC Widgets.
22
- ```
23
-
24
- ```{grid-item-card}
25
- :link: user
26
- :link-type: ref
27
- :img-top: /assets/index_user_guide.svg
28
- :text-align: center
29
- :class-item: index-card
30
-
31
- ## User guide
32
-
33
- Information for users of BEC Widgets.
34
- ```
35
-
36
- ```{grid-item-card}
37
- :link: developer
38
- :link-type: ref
39
- :img-top: /assets/index_contribute.svg
40
- :text-align: center
41
- :class-item: index-card
42
-
43
- ## Developer guide
44
-
45
- Information for developers of BEC Widgets.
46
- ```
47
-
48
- ```{grid-item-card}
49
- :link: api_reference
50
- :link-type: ref
51
- :img-top: /assets/index_api.svg
52
- :text-align: center
53
- :class-item: index-card
54
-
55
- ## API reference
56
-
57
- Comprehensive reference of all BEC Widget classes, functions, and methods.
58
- ```
59
-
60
- ````
61
-
62
-
63
- ```{toctree}
64
- ---
65
- numbered: true
66
- maxdepth: 2
67
- hidden: true
68
- ---
69
-
70
- introduction/introduction
71
- user/user
72
- developer/developer
73
- api_reference/api_reference
74
- ```
@@ -1,18 +0,0 @@
1
- (introduction)=
2
- # Introduction
3
-
4
- ## Overview
5
-
6
- 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.
7
-
8
- 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.
9
-
10
- **Key Features**:
11
-
12
- - **Integration:** Seamlessly integrates with [BEC (Beamline Experiment Control)](https://gitlab.psi.ch/bec/bec), ensuring a cohesive and efficient experiment control experience.
13
- - **Support for Pyside6 and PyQt6:** Provides compatibility with both Pyside6 and PyQt6, offering versatility in your development environment.
14
- - **Widget Modularity:** Features modular widgets that can be easily combined to create customized applications, perfectly aligning with the diverse needs of beamline experiments.
15
-
16
- ## Getting Started
17
-
18
- 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.
docs/make.bat DELETED
@@ -1,35 +0,0 @@
1
- @ECHO OFF
2
-
3
- pushd %~dp0
4
-
5
- REM Command file for Sphinx documentation
6
-
7
- if "%SPHINXBUILD%" == "" (
8
- set SPHINXBUILD=sphinx-build
9
- )
10
- set SOURCEDIR=.
11
- set BUILDDIR=_build
12
-
13
- %SPHINXBUILD% >NUL 2>NUL
14
- if errorlevel 9009 (
15
- echo.
16
- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
- echo.installed, then set the SPHINXBUILD environment variable to point
18
- echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
- echo.may add the Sphinx directory to PATH.
20
- echo.
21
- echo.If you don't have Sphinx installed, grab it from
22
- echo.https://www.sphinx-doc.org/
23
- exit /b 1
24
- )
25
-
26
- if "%1" == "" goto help
27
-
28
- %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
- goto end
30
-
31
- :help
32
- %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
-
34
- :end
35
- popd
docs/requirements.txt DELETED
@@ -1,12 +0,0 @@
1
- sphinx
2
- sphinx_copybutton
3
- recommonmark
4
- sphinx-toolbox
5
- pydata-sphinx-theme
6
- sphinx-copybutton
7
- sphinx-inline-tabs
8
- myst-parser
9
- sphinx-design
10
- PySide6
11
- bec-widgets
12
- tomli
@@ -1,11 +0,0 @@
1
- (user.api_reference)=
2
- # User API Reference
3
-
4
- ```{eval-rst}
5
- .. autosummary::
6
- :toctree: _autosummary
7
- :template: custom-module-template.rst
8
-
9
- bec_widgets.cli.client
10
-
11
- ```
@@ -1,10 +0,0 @@
1
- (user.applications)=
2
- # Applications
3
-
4
- **Coming soon**
5
-
6
- ```{toctree}
7
- ---
8
- maxdepth: 1
9
- hidden: true
10
- ---