bec-widgets 0.99.8__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 (155) hide show
  1. CHANGELOG.md +6 -6
  2. PKG-INFO +1 -1
  3. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.9.dist-info}/METADATA +1 -1
  4. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.9.dist-info}/RECORD +8 -155
  5. pyproject.toml +6 -1
  6. docs/Makefile +0 -20
  7. docs/_static/custom.css +0 -170
  8. docs/_templates/custom-class-template.rst +0 -34
  9. docs/_templates/custom-module-template.rst +0 -66
  10. docs/api_reference/api_reference.md +0 -12
  11. docs/assets/apps_48dp.svg +0 -1
  12. docs/assets/display_settings_48dp.svg +0 -1
  13. docs/assets/index_api.svg +0 -97
  14. docs/assets/index_contribute.svg +0 -76
  15. docs/assets/index_getting_started.svg +0 -66
  16. docs/assets/index_user_guide.svg +0 -67
  17. docs/assets/rocket_launch_48dp.svg +0 -1
  18. docs/assets/widget_screenshots/buttons.png +0 -0
  19. docs/assets/widget_screenshots/device_box.png +0 -0
  20. docs/assets/widget_screenshots/device_browser.png +0 -0
  21. docs/assets/widget_screenshots/device_inputs.png +0 -0
  22. docs/assets/widget_screenshots/dock_area.png +0 -0
  23. docs/assets/widget_screenshots/figure.png +0 -0
  24. docs/assets/widget_screenshots/image_widget.png +0 -0
  25. docs/assets/widget_screenshots/motor_map_widget.png +0 -0
  26. docs/assets/widget_screenshots/position_indicator.png +0 -0
  27. docs/assets/widget_screenshots/queue.png +0 -0
  28. docs/assets/widget_screenshots/ring_progress_bar.png +0 -0
  29. docs/assets/widget_screenshots/scan_controller.png +0 -0
  30. docs/assets/widget_screenshots/spinner.gif +0 -0
  31. docs/assets/widget_screenshots/status_box.png +0 -0
  32. docs/assets/widget_screenshots/text_box.png +0 -0
  33. docs/assets/widget_screenshots/toggle.png +0 -0
  34. docs/assets/widget_screenshots/waveform_widget.png +0 -0
  35. docs/assets/widget_screenshots/website.png +0 -0
  36. docs/conf.py +0 -82
  37. docs/developer/developer.md +0 -52
  38. docs/developer/introduction/concepts.md +0 -14
  39. docs/developer/introduction/contributing.md +0 -28
  40. docs/developer/introduction/introduction.md +0 -16
  41. docs/developer/introduction/useful_links.md +0 -23
  42. docs/developer/widget_development/bec_dispatcher.md +0 -143
  43. docs/developer/widget_development/widget_base_class.md +0 -171
  44. docs/developer/widget_development/widget_development.md +0 -14
  45. docs/index.md +0 -74
  46. docs/introduction/introduction.md +0 -18
  47. docs/make.bat +0 -35
  48. docs/requirements.txt +0 -12
  49. docs/user/api_reference/api_reference.md +0 -11
  50. docs/user/applications/applications.md +0 -10
  51. docs/user/customisation.md +0 -123
  52. docs/user/getting_started/BECDockArea.png +0 -0
  53. docs/user/getting_started/auto_updates.md +0 -82
  54. docs/user/getting_started/getting_started.md +0 -15
  55. docs/user/getting_started/gui_complex_gui.gif +0 -0
  56. docs/user/getting_started/installation.md +0 -33
  57. docs/user/getting_started/quick_start.md +0 -110
  58. docs/user/getting_started/video_tutorials.md +0 -17
  59. docs/user/user.md +0 -71
  60. docs/user/widgets/bec_figure/BECFigure.png +0 -0
  61. docs/user/widgets/bec_figure/bec_figure.md +0 -105
  62. docs/user/widgets/bec_status_box/bec_status_box.gif +0 -0
  63. docs/user/widgets/bec_status_box/bec_status_box.md +0 -38
  64. docs/user/widgets/buttons/buttons.md +0 -90
  65. docs/user/widgets/buttons/dark_mode_disabled.png +0 -0
  66. docs/user/widgets/buttons/dark_mode_enabled.png +0 -0
  67. docs/user/widgets/device_browser/device_browser.md +0 -36
  68. docs/user/widgets/device_browser/device_browser.png +0 -0
  69. docs/user/widgets/device_input/device_input.md +0 -100
  70. docs/user/widgets/dock_area/BECDockArea.png +0 -0
  71. docs/user/widgets/dock_area/bec_dock_area.md +0 -109
  72. docs/user/widgets/image/image_plot.gif +0 -0
  73. docs/user/widgets/image/image_widget.md +0 -84
  74. docs/user/widgets/motor_map/motor.gif +0 -0
  75. docs/user/widgets/motor_map/motor_map.md +0 -80
  76. docs/user/widgets/position_indicator/position_indicator.md +0 -69
  77. docs/user/widgets/positioner_box/positioner_box.md +0 -63
  78. docs/user/widgets/progress_bar/progress_bar.gif +0 -0
  79. docs/user/widgets/progress_bar/ring_progress_bar.md +0 -103
  80. docs/user/widgets/queue/queue.md +0 -41
  81. docs/user/widgets/scan_control/hide_scan_control.png +0 -0
  82. docs/user/widgets/scan_control/scan_control.gif +0 -0
  83. docs/user/widgets/scan_control/scan_control.md +0 -54
  84. docs/user/widgets/spinner/spinner.md +0 -68
  85. docs/user/widgets/text_box/text_box.md +0 -74
  86. docs/user/widgets/toggle/toggle.md +0 -66
  87. docs/user/widgets/waveform/bec_figure_dap.gif +0 -0
  88. docs/user/widgets/waveform/scatter_2D.gif +0 -0
  89. docs/user/widgets/waveform/w1D.gif +0 -0
  90. docs/user/widgets/waveform/waveform_widget.md +0 -132
  91. docs/user/widgets/website/website.md +0 -69
  92. docs/user/widgets/widgets.md +0 -220
  93. tests/__init__.py +0 -0
  94. tests/end-2-end/__init__.py +0 -0
  95. tests/end-2-end/conftest.py +0 -53
  96. tests/end-2-end/test_bec_dock_rpc_e2e.py +0 -298
  97. tests/end-2-end/test_bec_figure_rpc_e2e.py +0 -212
  98. tests/end-2-end/test_rpc_register_e2e.py +0 -40
  99. tests/end-2-end/test_scan_control_e2e.py +0 -71
  100. tests/references/SpinnerWidget/SpinnerWidget_darwin.png +0 -0
  101. tests/references/SpinnerWidget/SpinnerWidget_linux.png +0 -0
  102. tests/references/SpinnerWidget/SpinnerWidget_started_darwin.png +0 -0
  103. tests/references/SpinnerWidget/SpinnerWidget_started_linux.png +0 -0
  104. tests/unit_tests/__init__.py +0 -0
  105. tests/unit_tests/client_mocks.py +0 -189
  106. tests/unit_tests/conftest.py +0 -64
  107. tests/unit_tests/test_bec_connector.py +0 -80
  108. tests/unit_tests/test_bec_dispatcher.py +0 -119
  109. tests/unit_tests/test_bec_dock.py +0 -155
  110. tests/unit_tests/test_bec_figure.py +0 -270
  111. tests/unit_tests/test_bec_image.py +0 -63
  112. tests/unit_tests/test_bec_image_widget.py +0 -217
  113. tests/unit_tests/test_bec_motor_map.py +0 -282
  114. tests/unit_tests/test_bec_queue.py +0 -111
  115. tests/unit_tests/test_bec_status_box.py +0 -123
  116. tests/unit_tests/test_client_utils.py +0 -76
  117. tests/unit_tests/test_color_map_selector.py +0 -42
  118. tests/unit_tests/test_color_validation.py +0 -75
  119. tests/unit_tests/test_configs/config_device.yaml +0 -33
  120. tests/unit_tests/test_configs/config_device_no_entry.yaml +0 -27
  121. tests/unit_tests/test_configs/config_scan.yaml +0 -82
  122. tests/unit_tests/test_crosshair.py +0 -143
  123. tests/unit_tests/test_dark_mode_button.py +0 -70
  124. tests/unit_tests/test_device_browser.py +0 -83
  125. tests/unit_tests/test_device_input_base.py +0 -76
  126. tests/unit_tests/test_device_input_widgets.py +0 -178
  127. tests/unit_tests/test_error_utils.py +0 -63
  128. tests/unit_tests/test_generate_cli_client.py +0 -123
  129. tests/unit_tests/test_generate_plugin.py +0 -155
  130. tests/unit_tests/test_motor_map_widget.py +0 -194
  131. tests/unit_tests/test_msgs/__init__.py +0 -0
  132. tests/unit_tests/test_msgs/available_scans_message.py +0 -989
  133. tests/unit_tests/test_plot_base.py +0 -95
  134. tests/unit_tests/test_plugin_utils.py +0 -13
  135. tests/unit_tests/test_positioner_box.py +0 -130
  136. tests/unit_tests/test_ring_progress_bar.py +0 -337
  137. tests/unit_tests/test_rpc_register.py +0 -52
  138. tests/unit_tests/test_rpc_server.py +0 -42
  139. tests/unit_tests/test_rpc_widget_handler.py +0 -7
  140. tests/unit_tests/test_scan_control.py +0 -324
  141. tests/unit_tests/test_scan_control_group_box.py +0 -160
  142. tests/unit_tests/test_setting_dialog.py +0 -96
  143. tests/unit_tests/test_spinner.py +0 -31
  144. tests/unit_tests/test_stop_button.py +0 -27
  145. tests/unit_tests/test_text_box_widget.py +0 -54
  146. tests/unit_tests/test_toggle.py +0 -38
  147. tests/unit_tests/test_vscode_widget.py +0 -75
  148. tests/unit_tests/test_waveform1d.py +0 -712
  149. tests/unit_tests/test_waveform_widget.py +0 -462
  150. tests/unit_tests/test_website_widget.py +0 -25
  151. tests/unit_tests/test_widget_io.py +0 -90
  152. tests/unit_tests/test_yaml_dialog.py +0 -163
  153. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.9.dist-info}/WHEEL +0 -0
  154. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.9.dist-info}/entry_points.txt +0 -0
  155. {bec_widgets-0.99.8.dist-info → bec_widgets-0.99.9.dist-info}/licenses/LICENSE +0 -0
@@ -1,54 +0,0 @@
1
- (user.widgets.scan_control)=
2
-
3
- # Scan Control Widget
4
-
5
- ````{tab} Overview
6
-
7
- The [`Scan Control`](/api_reference/_autosummary/bec_widgets.cli.client.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.
8
-
9
- ## Key Features:
10
- - **Automatic Interface Generation**: Automatically generates a control interface based on scan signatures and `gui_config`.
11
- - **Dynamic Argument Bundling**: Supports the dynamic addition and removal of argument bundles such as positioners controls.
12
- - **Visual Parameter Grouping**: Provides a visual representation of scan parameters, grouped by their functionality.
13
- - **Integrated Scan Controls**: Includes start abd stop controls for managing scan execution.
14
-
15
- ```{note}
16
- By default, this widget supports scans that are derived from the following base classes and have a defined `gui_config`:
17
- - [ScanBase](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_server.scan_server.scans.ScanBase.html)
18
- - [SyncFlyScanBase](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_server.scan_server.scans.SyncFlyScanBase.html)
19
- - [AsyncFlyScanBase](https://beamline-experiment-control.readthedocs.io/en/latest/api_reference/_autosummary/bec_server.scan_server.scans.AsyncFlyScanBase.html)
20
- ```
21
-
22
- ```{hint}
23
- 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/scan_gui_config.html) tutorial.
24
- ```
25
-
26
- ## BECDesigner Customization
27
- Within the BECDesigner'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:
28
- - **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.
29
- - **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.
30
-
31
- ```{figure} ./hide_scan_control.png
32
- ```
33
-
34
- ````
35
-
36
- ````{tab} Examples
37
-
38
- The `ScanControl` widget can be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `BECDesigner`. Below are examples demonstrating how to create and use the `ScanControl` widget.
39
-
40
- ## Example 1 - Adding Scan Control Widget to BECDockArea
41
-
42
- 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.
43
-
44
- ```python
45
- # Add a new dock with a ScanControl widget
46
- scan_control = gui.add_dock().add_widget("ScanControl")
47
- ```
48
- ````
49
-
50
- ````{tab} API
51
- ```{eval-rst}
52
- .. include:: /api_reference/_autosummary/bec_widgets.cli.client.ScanControl.rst
53
- ```
54
- ````
@@ -1,68 +0,0 @@
1
- (user.widgets.spinner)=
2
-
3
- # Spinner Widget
4
-
5
- ````{tab} Overview
6
-
7
- The [`SpinnerWidget`](/api_reference/_autosummary/bec_widgets.cli.client.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 `QtDesigner`.
8
-
9
- ## Key Features:
10
- - **Loading Indicator**: Provides a visual indication of ongoing operations or device movement.
11
- - **Smooth Animation**: Features a smooth, continuous spinning animation to catch the user's attention.
12
- - **Easy Integration**: Can be added directly in code or through `QtDesigner`, making it adaptable to various use cases.
13
- - **Customizable Appearance**: Automatically adapts to the application's theme, ensuring visual consistency.
14
-
15
- ````
16
-
17
- ````{tab} Examples
18
-
19
- The `SpinnerWidget` can be embedded within a GUI application through direct code instantiation or by using `QtDesigner`. Below are examples demonstrating how to create and use the `SpinnerWidget`.
20
-
21
- ## Example 1 - Creating a Spinner Widget in Code
22
-
23
- In this example, we demonstrate how to create a `SpinnerWidget` in code and start the spinner to indicate an ongoing operation.
24
-
25
- ```python
26
- from qtpy.QtWidgets import QApplication, QMainWindow
27
- from bec_widgets.widgets.spinner_widget import SpinnerWidget
28
-
29
- app = QApplication([])
30
-
31
- # Create a main window
32
- window = QMainWindow()
33
-
34
- # Create a SpinnerWidget instance
35
- spinner = SpinnerWidget()
36
-
37
- # Start the spinner
38
- spinner.start()
39
-
40
- # Set the spinner as the central widget
41
- window.setCentralWidget(spinner)
42
- window.show()
43
-
44
- app.exec_()
45
- ```
46
-
47
- ## Example 2 - Stopping the Spinner
48
-
49
- You can stop the spinner to indicate that an operation has completed.
50
-
51
- ```python
52
- # Stop the spinner
53
- spinner.stop()
54
- ```
55
-
56
- ## Example 3 - Integrating the Spinner Widget in QtDesigner
57
-
58
- The `SpinnerWidget` can be added to your GUI layout using `QtDesigner`. Once added, you can control the spinner using the `start` and `stop` methods, similar to the code examples above.
59
-
60
- ```python
61
- # Example: Start the spinner in a QtDesigner-based application
62
- self.spinner_widget.start()
63
-
64
- # Example: Stop the spinner in a QtDesigner-based application
65
- self.spinner_widget.stop()
66
- ```
67
-
68
- ````
@@ -1,74 +0,0 @@
1
- (user.widgets.text_box)=
2
-
3
- # Text Box Widget
4
-
5
- ````{tab} Overview
6
-
7
- The [`Text Box Widget`](/api_reference/_autosummary/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.
8
-
9
- ## Key Features:
10
- - **Text Display**: Display either plain text or HTML content, with automatic detection of the format.
11
- - **Customizable Appearance**: Set the background and font colors to match the design of your application.
12
- - **Font Size Adjustment**: Customize the font size of the displayed text for better readability.
13
-
14
- ````
15
-
16
- ````{tab} Examples - CLI
17
-
18
- The `TextBox` widget can be integrated within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `QtDesigner`. The following examples demonstrate how to create and customize the `TextBox` widget in various scenarios.
19
-
20
- ## Example 1 - Adding Text Box Widget to BECDockArea
21
-
22
- In this example, we demonstrate how to add a `TextBox` widget to a `BECDockArea` and set the text to be displayed.
23
-
24
- ```python
25
- # Add a new dock with a TextBox widget
26
- text_box = gui.add_dock().add_widget("TextBox")
27
-
28
- # Set the text to display
29
- text_box.set_text("Hello, World!")
30
- ```
31
-
32
- ## Example 2 - Displaying HTML Content
33
-
34
- The `TextBox` widget can automatically detect and render HTML content. This example shows how to display formatted HTML text.
35
-
36
- ```python
37
- # Set the text to display as HTML
38
- text_box.set_text("<h1>Welcome to BEC Widgets</h1><p>This is an example of displaying <strong>HTML</strong> text.</p>")
39
- ```
40
-
41
- ## Example 3 - Customizing Appearance
42
-
43
- The `TextBox` widget allows you to customize the background and font colors to fit your application's design. Below is an example of how to set these properties.
44
-
45
- ```python
46
- # Set the background color to white and the font color to black
47
- text_box.set_color(background_color="#FFF", font_color="#000")
48
- ```
49
-
50
- ## Example 4 - Adjusting Font Size
51
-
52
- To improve readability or fit more text within the widget, you can adjust the font size.
53
-
54
- ```python
55
- # Set the font size to 14 pixels
56
- text_box.set_font_size(14)
57
- ```
58
-
59
- ````
60
-
61
- ````{tab} API
62
- ```{eval-rst}
63
- .. include:: /api_reference/_autosummary/bec_widgets.cli.client.TextBox.rst
64
- ```
65
- ````
66
-
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
@@ -1,66 +0,0 @@
1
- (user.widgets.toggle)=
2
-
3
- # Toggle Switch Widget
4
-
5
- ````{tab} Overview
6
-
7
- The [`Toggle Switch`](/api_reference/_autosummary/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 `QtDesigner`, making it versatile for various applications where a user-friendly switch is needed.
8
-
9
- ## Key Features:
10
- - **Binary State Representation**: Represents a simple on/off state with a smooth toggle animation.
11
- - **Customizable Appearance**: Allows customization of track and thumb colors for both active and inactive states.
12
- - **Smooth Animation**: Includes a smooth animation when toggling between states, enhancing user interaction.
13
- - **QtDesigner Integration**: Can be added directly through `QtDesigner` or instantiated in code.
14
-
15
- ````
16
-
17
- ````{tab} Examples
18
-
19
- The `Toggle Switch` widget can be integrated within a GUI application either through direct code instantiation or by using `QtDesigner`. Below are examples demonstrating how to create and customize the `Toggle Switch` widget.
20
-
21
- ## Example 1 - Creating a Toggle Switch in Code
22
-
23
- In this example, we demonstrate how to create a `ToggleSwitch` widget in code and customize its appearance.
24
-
25
- ```python
26
- from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget
27
- from bec_widgets.widgets.toggle_switch import ToggleSwitch
28
-
29
- class MyGui(QWidget):
30
- def __init__(self):
31
- super().__init__()
32
- self.setLayout(QVBoxLayout(self)) # Initialize the layout for the widget
33
-
34
- # Create and add the ToggleSwitch to the layout
35
- self.toggle_switch = ToggleSwitch()
36
- self.layout().addWidget(self.toggle_switch)
37
-
38
- # Example of how this custom GUI might be used:
39
- app = QApplication([])
40
- my_gui = MyGui()
41
- my_gui.show()
42
- app.exec_()
43
- ```
44
-
45
- ## Example 2 - Customizing the Toggle Switch Appearance
46
-
47
- 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.
48
-
49
- ```python
50
- # Set the active and inactive track and thumb colors
51
- self.toggle_switch.active_track_color = QColor(0, 122, 204) # Active state track color (blue)
52
- self.toggle_switch.inactive_track_color = QColor(200, 200, 200) # Inactive state track color (grey)
53
- self.toggle_switch.active_thumb_color = QColor(255, 255, 255) # Active state thumb color (white)
54
- self.toggle_switch.inactive_thumb_color = QColor(255, 255, 255) # Inactive state thumb color (white)
55
- ```
56
-
57
- ## Example 3 - Integrating the Toggle Switch in QtDesigner
58
-
59
- The `ToggleSwitch` can be added as a custom widget in `QtDesigner`. Once integrated, you can configure its properties through the designer's property editor. After adding the widget to a form in QtDesigner, you can manipulate it in your PyQt/PySide application:
60
-
61
- ```python
62
- # For instance:
63
- self.toggle_switch.setChecked(True)
64
- ```
65
-
66
- ````
Binary file
Binary file
@@ -1,132 +0,0 @@
1
- (user.widgets.waveform_widget)=
2
-
3
- # Waveform Widget
4
-
5
- ````{tab} Overview
6
-
7
- 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.
8
-
9
- ## Key Features:
10
- - **Flexible Integration**: The widget can be integrated into both [`BECFigure`](user.widgets.bec_figure) and [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BECDesigner`.
11
- - **Data Visualization**: Real-time plotting of positioner versus detector values from the BEC session, as well as static plotting of custom data.
12
- - **Real-time Data Processing**: Add real-time Data Processing Pipeline (DAP) to the real-time acquisition.
13
- - **Data Export**: Export data to CSV, H5, and other formats.
14
- - **Customizable Visual Elements**: Customize visual elements such as line color and style.
15
- - **Interactive Controls**: Interactive controls for zooming and panning through the data.
16
-
17
- ![Waveform 1D](./w1D.gif)
18
- ````
19
-
20
- ````{tab} Examples - CLI
21
-
22
- `WaveformWidget` can be embedded in both [`BECFigure`](user.widgets.bec_figure) and [`BECDockArea`](user.widgets.bec_dock_area), or used as an individual component in your application through `BECDesigner`. However, the command-line API is the same for all cases.
23
-
24
- ## Example 1 - Adding Waveform Widget to BECFigure
25
-
26
- In this example, we will demonstrate how to add two different `WaveformWidgets` into a single [`BECFigure`](user.widgets.bec_figure) widget.
27
-
28
- ```python
29
- # Add new dock with BECFigure widget
30
- fig = gui.add_dock().add_widget('BECFigure')
31
-
32
- # Add two WaveformWidgets to the BECFigure
33
- plt1 = fig.plot(x_name='samx', y_name='bpm4i')
34
- plt2 = fig.plot(x_name='samx', y_name='bpm3i')
35
- ```
36
-
37
- ## Example 2 - Adding Waveform Widget as a dock with BECDockArea
38
-
39
- Adding `WaveformWidget` into a [`BECDockArea`](user.widgets.bec_dock_area) is similar to adding any other widget. The widget has the same API as the one in BECFigure; however, as an independent widget outside BECFigure, it has its own toolbar, allowing users to configure the widget without needing CLI commands.
40
-
41
- ```python
42
- # Add new WaveformWidgets to the BECDockArea
43
- plt1 = gui.add_dock().add_widget('BECWaveformWidget')
44
- plt2 = gui.add_dock().add_widget('BECWaveformWidget')
45
-
46
- # Add signals to the WaveformWidget
47
- plt1.plot(x_name='samx', y_name='bpm4i')
48
- plt2.plot(x_name='samx', y_name='bpm3i')
49
- ```
50
-
51
- ## Example 3 - Adding Waveform Widget with curves
52
- ```python
53
- # adds a new dock, a new BECFigure and a BECWaveForm to the dock
54
- plt = gui.add_dock().add_widget('BECFigure').plot(x_name='samx', y_name='bpm4i')
55
-
56
- # add a second curve to the same plot
57
- plt.plot(x_name='samx', y_name='bpm3i')
58
-
59
- # set axis labels
60
- plt.set_title("Gauss plots vs. samx")
61
- plt.set_x_label("Motor X")
62
- plt.set_y_label("Gauss Signal (A.U.")
63
- ```
64
-
65
- ```{note}
66
- 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).
67
- ```
68
-
69
- ```python
70
- # bpm4i uses GaussianModel and samx as a reference; default settings
71
- dev.bpm4i.sim.select_sim_model("GaussianModel")
72
-
73
- # bpm3i uses StepModel and samx as a reference; default settings
74
- dev.bpm3i.sim.select_sim_model("StepModel")
75
- ```
76
- ## Example 4 - Adding Data Processing Pipeline Curve with LMFit Models
77
-
78
- 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.
79
-
80
- ```python
81
- # Add a new dock, a new BECFigure, and a BECWaveForm to the dock with a GaussianModel DAP
82
- plt = gui.add_dock().add_widget('BECFigure').plot(x_name='samx', y_name='bpm4i', dap="GaussianModel")
83
-
84
- # Add a second curve to the same plot without DAP
85
- plt.plot(x_name='samx', y_name='bpm3a')
86
-
87
- # Add DAP to the second curve
88
- plt.add_dap(x_name='samx', y_name='bpm3a', dap="GaussianModel")
89
-
90
- ```
91
-
92
- To get the parameters of the fit, you need to retrieve the curve objects and call the `dap_params` property.
93
-
94
- ```python
95
- # Get the curve object by name from the legend
96
- dap_bpm4i = plt.get_curve("bpm4i-bpm4i-GaussianModel")
97
- dap_bpm3a = plt.get_curve("bpm3a-bpm3a-GaussianModel")
98
-
99
- # Get the parameters of the fit
100
- print(dap_bpm4i.dap_params)
101
- # Output
102
- {'amplitude': 197.399639720862,
103
- 'center': 5.013486095404885,
104
- 'sigma': 0.9820868875739888}
105
-
106
- print(dap_bpm3a.dap_params)
107
- # Output
108
- {'amplitude': 698.3072786185278,
109
- 'center': 0.9702840866173836,
110
- 'sigma': 1.97139754785518}
111
- ```
112
-
113
- ![Waveform 1D_DAP](./bec_figure_dap.gif)
114
-
115
- ## Example 5 - 2D Waveform Scatter Plot
116
-
117
- 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.
118
-
119
- ```python
120
- # adds a new dock, a new BECFigure and a BECWaveForm to the dock
121
- plt = gui.add_dock().add_widget('BECFigure').add_plot(x_name='samx', y_name='samy', z_name='bpm4i')
122
- ```
123
-
124
- ![Scatter 2D](./scatter_2D.gif)
125
-
126
- ````
127
-
128
- ````{tab} API
129
- ```{eval-rst}
130
- .. include:: /api_reference/_autosummary/bec_widgets.cli.client.BECWaveform.rst
131
- ```
132
- ````
@@ -1,69 +0,0 @@
1
- (user.widgets.website)=
2
-
3
- # Website Widget
4
-
5
- ````{tab} Overview
6
-
7
- The [`Website Widget`](/api_reference/_autosummary/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 `QtDesigner`.
8
-
9
- ## Key Features:
10
- - **URL Display**: Set and display any website URL within the widget.
11
- - **Navigation Controls**: Navigate through the website’s history with back and forward controls.
12
- - **Reload Functionality**: Reload the currently displayed website to ensure up-to-date content.
13
-
14
- ````
15
-
16
- ````{tab} Examples - CLI
17
-
18
- The `WebsiteWidget` can be embedded within a [`BECDockArea`](user.widgets.bec_dock_area) or used as an individual component in your application through `QtDesigner`. The following examples demonstrate how to create and use the `WebsiteWidget` in different scenarios.
19
-
20
- ## Example 1 - Adding Website Widget to BECDockArea
21
-
22
- In this example, we demonstrate how to add a `WebsiteWidget` to a `BECDockArea` and set the URL of the website to be displayed.
23
-
24
- ```python
25
- # Add a new dock with a WebsiteWidget
26
- web = gui.add_dock().add_widget("WebsiteWidget")
27
-
28
- # Set the URL of the website to display
29
- web.set_url("https://bec.readthedocs.io/en/latest/")
30
- ```
31
-
32
- ## Example 2 - Navigating within the Website Widget
33
-
34
- The `WebsiteWidget` allows users to navigate back and forward through the website’s history. This example shows how to implement these navigation controls.
35
-
36
- ```python
37
- # Go back in the website history
38
- web.back()
39
-
40
- # Go forward in the website history
41
- web.forward()
42
- ```
43
-
44
- ## Example 3 - Reloading the Website
45
-
46
- To ensure that the displayed website content is up-to-date, you can use the reload functionality.
47
-
48
- ```python
49
- # Reload the current website
50
- web.reload()
51
- ```
52
-
53
- ## Example 4 - Retrieving the Current URL
54
-
55
- You may want to retrieve the current URL being displayed in the `WebsiteWidget`. The following example demonstrates how to access the current URL.
56
-
57
- ```python
58
- # Get the current URL of the WebsiteWidget
59
- current_url = web.get_url()
60
- print(f"The current URL is: {current_url}")
61
- ```
62
-
63
- ````
64
-
65
- ````{tab} API
66
- ```{eval-rst}
67
- .. include:: /api_reference/_autosummary/bec_widgets.cli.client.WebsiteWidget.rst
68
- ```
69
- ````
@@ -1,220 +0,0 @@
1
- (user.widgets)=
2
- # Widgets
3
-
4
- BEC Widgets offers a range of tools designed to make data visualization in beamline experiments easier and more
5
- interactive. These widgets help users better understand their data by providing clear, intuitive displays that enhance
6
- the overall experience.
7
-
8
- ## Widget Containers
9
-
10
- Serves as containers to organise and display other widgets.
11
-
12
- ````{grid} 3
13
- :gutter: 2
14
-
15
- ```{grid-item-card} BEC Dock Area
16
- :link: user.widgets.bec_dock_area
17
- :link-type: ref
18
- :img-top: /assets/widget_screenshots/dock_area.png
19
-
20
- Quickly build dynamic GUI.
21
-
22
- ```
23
-
24
- ```{grid-item-card} BEC Figure
25
- :link: user.widgets.bec_figure
26
- :link-type: ref
27
- :img-top: /assets/widget_screenshots/figure.png
28
-
29
- Display 1D and 2D data.
30
- ```
31
- ````
32
-
33
- ## Plotting Widgets
34
-
35
- Plotting widgets are used to display data in a graphical format.
36
-
37
- ````{grid} 3
38
- :gutter: 2
39
-
40
- ```{grid-item-card} Waveform Widget
41
- :link: user.widgets.waveform_widget
42
- :link-type: ref
43
- :img-top: /assets/widget_screenshots/waveform_widget.png
44
-
45
- Display 1D detector signals.
46
- ```
47
-
48
- ```{grid-item-card} Image Widget
49
- :link: user.widgets.image_widget
50
- :link-type: ref
51
- :img-top: /assets/widget_screenshots/image_widget.png
52
-
53
- Display signal from 2D detector.
54
- ```
55
-
56
- ```{grid-item-card} Motor Map Widget
57
- :link: user.widgets.motor_map
58
- :link-type: ref
59
- :img-top: /assets/widget_screenshots/motor_map_widget.png
60
-
61
- Track position for motors.
62
- ```
63
-
64
- ````
65
-
66
- ## Device Control Widgets
67
-
68
- Control and monitor devices/scan in the BEC environment.
69
-
70
- ````{grid} 3
71
- :gutter: 2
72
-
73
- ```{grid-item-card} Scan Control Widget
74
- :link: user.widgets.scan_control
75
- :link-type: ref
76
- :img-top: /assets/widget_screenshots/scan_controller.png
77
-
78
- Launch scans.
79
- ```
80
-
81
- ```{grid-item-card} Device Browser
82
- :link: user.widgets.device_browser
83
- :link-type: ref
84
- :img-top: /assets/widget_screenshots/device_browser.png
85
-
86
- Find and drag devices.
87
- ```
88
-
89
- ```{grid-item-card} Positioner Box
90
- :link: user.widgets.positioner_box
91
- :link-type: ref
92
- :img-top: /assets/widget_screenshots/device_box.png
93
-
94
- Control individual device.
95
- ```
96
-
97
- ```{grid-item-card} Ring Progress Bar
98
- :link: user.widgets.ring_progress_bar
99
- :link-type: ref
100
- :img-top: /assets/widget_screenshots/ring_progress_bar.png
101
-
102
- Nested progress bar.
103
- ```
104
-
105
- ````
106
-
107
- ## BEC Service Widgets
108
-
109
- Visualise the status of BEC services.
110
-
111
- ````{grid} 3
112
- :gutter: 2
113
-
114
- ```{grid-item-card} BEC Status Box
115
- :link: user.widgets.bec_status_box
116
- :link-type: ref
117
- :img-top: /assets/widget_screenshots/status_box.png
118
-
119
- Display status of BEC services.
120
- ```
121
-
122
- ```{grid-item-card} BEC Queue Table
123
- :link: user.widgets.bec_queue
124
- :link-type: ref
125
- :img-top: /assets/widget_screenshots/queue.png
126
-
127
- Display current scan queue.
128
- ```
129
- ````
130
-
131
- ## BEC Utility Widgets
132
-
133
- Various utility widgets to enhance user experience.
134
-
135
- ````{grid} 3
136
- :gutter: 2
137
-
138
- ```{grid-item-card} Buttons
139
- :link: user.widgets.buttons
140
- :link-type: ref
141
- :img-top: /assets/widget_screenshots/buttons.png
142
-
143
- Various service buttons.
144
- ```
145
-
146
- ```{grid-item-card} Device Input Widgets
147
- :link: user.widgets.device_input
148
- :link-type: ref
149
- :img-top: /assets/widget_screenshots/device_inputs.png
150
-
151
- Choose individual device from current session.
152
- ```
153
-
154
- ```{grid-item-card} Text Box Widget
155
- :link: user.widgets.text_box
156
- :link-type: ref
157
- :img-top: /assets/widget_screenshots/text_box.png
158
-
159
- Display custom text or HTML content.
160
- ```
161
-
162
- ```{grid-item-card} Website Widget
163
- :link: user.widgets.website
164
- :link-type: ref
165
- :img-top: /assets/widget_screenshots/website.png
166
-
167
- Display website content.
168
- ```
169
-
170
- ```{grid-item-card} Toogle Widget
171
- :link: user.widgets.toggle
172
- :link-type: ref
173
- :img-top: /assets/widget_screenshots/toggle.png
174
-
175
- Angular like toggle switch.
176
- ```
177
-
178
- ```{grid-item-card} Spinner
179
- :link: user.widgets.spinner
180
- :link-type: ref
181
- :img-top: /assets/widget_screenshots/spinner.gif
182
-
183
- Display spinner widget for loading or device movement.
184
- ```
185
-
186
- ```{grid-item-card} Position Indicator
187
- :link: user.widgets.position_indicator
188
- :link-type: ref
189
- :img-top: /assets/widget_screenshots/position_indicator.png
190
-
191
- Display position of motor withing its limits.
192
- ```
193
- ````
194
-
195
- ```{toctree}
196
- ---
197
- maxdepth: 1
198
- hidden: true
199
- ---
200
-
201
- dock_area/bec_dock_area.md
202
- bec_figure/bec_figure.md
203
- waveform/waveform_widget.md
204
- image/image_widget.md
205
- motor_map/motor_map.md
206
- scan_control/scan_control.md
207
- progress_bar/ring_progress_bar.md
208
- bec_status_box/bec_status_box.md
209
- queue/queue.md
210
- buttons/buttons.md
211
- device_browser/device_browser.md
212
- positioner_box/positioner_box.md
213
- text_box/text_box.md
214
- website/website.md
215
- toggle/toggle.md
216
- spinner/spinner.md
217
- device_input/device_input.md
218
- position_indicator/position_indicator.md
219
-
220
- ```
tests/__init__.py DELETED
File without changes