bec-widgets 1.25.0__py3-none-any.whl → 2.0.0__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 (197) hide show
  1. .gitlab-ci.yml +11 -6
  2. CHANGELOG.md +650 -0
  3. PKG-INFO +3 -3
  4. bec_widgets/__init__.py +4 -0
  5. bec_widgets/applications/bw_launch.py +23 -0
  6. bec_widgets/applications/launch_window.py +430 -0
  7. bec_widgets/assets/app_icons/auto_update.png +0 -0
  8. bec_widgets/assets/app_icons/ui_loader_tile.png +0 -0
  9. bec_widgets/cli/__init__.py +0 -1
  10. bec_widgets/cli/client.py +1779 -2064
  11. bec_widgets/cli/client_utils.py +346 -174
  12. bec_widgets/cli/generate_cli.py +143 -37
  13. bec_widgets/cli/rpc/rpc_base.py +152 -21
  14. bec_widgets/cli/rpc/rpc_register.py +113 -6
  15. bec_widgets/cli/rpc/rpc_widget_handler.py +13 -11
  16. bec_widgets/cli/server.py +125 -239
  17. bec_widgets/examples/jupyter_console/jupyter_console_window.py +97 -145
  18. bec_widgets/examples/plugin_example_pyside/tictactoetaskmenu.py +1 -1
  19. bec_widgets/utils/bec_connector.py +190 -21
  20. bec_widgets/utils/bec_designer.py +7 -0
  21. bec_widgets/utils/bec_dispatcher.py +71 -4
  22. bec_widgets/utils/bec_plugin_helper.py +89 -0
  23. bec_widgets/utils/bec_signal_proxy.py +1 -1
  24. bec_widgets/utils/bec_widget.py +26 -10
  25. bec_widgets/utils/colors.py +1 -1
  26. bec_widgets/{qt_utils → utils}/compact_popup.py +2 -0
  27. bec_widgets/utils/container_utils.py +37 -12
  28. bec_widgets/utils/crosshair.py +25 -8
  29. bec_widgets/utils/entry_validator.py +3 -1
  30. bec_widgets/{qt_utils → utils}/error_popups.py +18 -0
  31. bec_widgets/{qt_utils → utils}/expandable_frame.py +2 -2
  32. bec_widgets/utils/forms_from_types/forms.py +182 -0
  33. bec_widgets/{widgets/editors/scan_metadata/_metadata_widgets.py → utils/forms_from_types/items.py} +41 -30
  34. bec_widgets/utils/generate_designer_plugin.py +40 -36
  35. bec_widgets/utils/linear_region_selector.py +2 -0
  36. bec_widgets/utils/name_utils.py +16 -0
  37. bec_widgets/{qt_utils → utils}/palette_viewer.py +2 -2
  38. bec_widgets/utils/plot_indicator_items.py +2 -5
  39. bec_widgets/utils/plugin_utils.py +47 -1
  40. bec_widgets/{qt_utils → utils}/round_frame.py +14 -14
  41. bec_widgets/utils/rpc_server.py +277 -0
  42. bec_widgets/utils/serialization.py +44 -0
  43. bec_widgets/{qt_utils → utils}/settings_dialog.py +26 -1
  44. bec_widgets/{qt_utils → utils}/side_panel.py +17 -10
  45. bec_widgets/{qt_utils → utils}/toolbar.py +69 -25
  46. bec_widgets/utils/ui_loader.py +8 -8
  47. bec_widgets/utils/widget_io.py +166 -25
  48. bec_widgets/widgets/containers/auto_update/auto_updates.py +364 -0
  49. bec_widgets/widgets/containers/dock/dock.py +157 -49
  50. bec_widgets/widgets/containers/dock/dock_area.py +186 -138
  51. bec_widgets/widgets/containers/layout_manager/layout_manager.py +2 -1
  52. bec_widgets/widgets/containers/main_window/addons/web_links.py +15 -0
  53. bec_widgets/widgets/containers/main_window/main_window.py +189 -41
  54. bec_widgets/widgets/control/buttons/button_abort/button_abort.py +3 -4
  55. bec_widgets/widgets/control/buttons/button_reset/button_reset.py +3 -4
  56. bec_widgets/widgets/control/buttons/button_resume/button_resume.py +3 -3
  57. bec_widgets/widgets/control/buttons/stop_button/stop_button.py +18 -7
  58. bec_widgets/widgets/control/device_control/position_indicator/position_indicator.py +22 -3
  59. bec_widgets/widgets/control/device_control/positioner_box/_base/positioner_box_base.py +37 -18
  60. bec_widgets/widgets/control/device_control/positioner_box/positioner_box/positioner_box.py +28 -4
  61. bec_widgets/widgets/control/device_control/positioner_box/positioner_box/positioner_box.ui +27 -4
  62. bec_widgets/widgets/control/device_control/positioner_box/positioner_box_2d/positioner_box_2d.py +5 -2
  63. bec_widgets/widgets/control/device_control/positioner_box/positioner_box_2d/positioner_box_2d.ui +97 -31
  64. bec_widgets/widgets/control/device_control/positioner_box/positioner_control_line/positioner_control_line.ui +11 -4
  65. bec_widgets/widgets/control/device_control/positioner_group/positioner_group.py +2 -3
  66. bec_widgets/widgets/control/device_input/base_classes/device_input_base.py +29 -4
  67. bec_widgets/widgets/control/device_input/base_classes/device_signal_input_base.py +1 -0
  68. bec_widgets/widgets/control/device_input/device_combobox/device_combobox.py +2 -2
  69. bec_widgets/widgets/control/device_input/device_line_edit/device_line_edit.py +2 -2
  70. bec_widgets/widgets/control/device_input/signal_combobox/signal_combobox.py +1 -2
  71. bec_widgets/widgets/control/device_input/signal_line_edit/signal_line_edit.py +1 -2
  72. bec_widgets/widgets/control/scan_control/scan_control.py +7 -5
  73. bec_widgets/widgets/control/scan_control/scan_group_box.py +28 -5
  74. bec_widgets/widgets/dap/dap_combo_box/dap_combo_box.py +1 -2
  75. bec_widgets/widgets/dap/lmfit_dialog/lmfit_dialog.py +3 -4
  76. bec_widgets/widgets/dap/lmfit_dialog/lmfit_dialog_vertical.ui +14 -8
  77. bec_widgets/widgets/editors/console/console.py +1 -1
  78. bec_widgets/widgets/editors/{scan_metadata/additional_metadata_table.py → dict_backed_table.py} +29 -6
  79. bec_widgets/widgets/editors/scan_metadata/__init__.py +0 -7
  80. bec_widgets/widgets/editors/scan_metadata/_util.py +1 -1
  81. bec_widgets/widgets/{plots/motor_map/register_bec_motor_map_widget.py → editors/scan_metadata/register_scan_metadata.py} +2 -4
  82. bec_widgets/widgets/editors/scan_metadata/scan_metadata.py +42 -136
  83. bec_widgets/widgets/editors/scan_metadata/scan_metadata.pyproject +1 -0
  84. bec_widgets/widgets/{plots/multi_waveform/bec_multi_waveform_widget_plugin.py → editors/scan_metadata/scan_metadata_plugin.py} +9 -9
  85. bec_widgets/widgets/editors/text_box/text_box.py +2 -3
  86. bec_widgets/widgets/editors/website/website.py +2 -2
  87. bec_widgets/widgets/games/minesweeper.py +3 -2
  88. bec_widgets/widgets/plots/image/image.py +960 -0
  89. bec_widgets/widgets/plots/image/image.pyproject +1 -0
  90. bec_widgets/widgets/plots/image/image_item.py +279 -0
  91. bec_widgets/widgets/plots/{motor_map/bec_motor_map_widget_plugin.py → image/image_plugin.py} +11 -13
  92. bec_widgets/widgets/{containers/figure/plots → plots}/image/image_processor.py +31 -64
  93. bec_widgets/widgets/plots/image/{register_bec_image_widget.py → register_image.py} +2 -2
  94. bec_widgets/widgets/plots/image/toolbar_bundles/image_selection.py +59 -0
  95. bec_widgets/widgets/plots/image/toolbar_bundles/processing.py +79 -0
  96. bec_widgets/widgets/plots/motor_map/motor_map.py +832 -0
  97. bec_widgets/widgets/plots/motor_map/motor_map.pyproject +1 -0
  98. bec_widgets/widgets/plots/motor_map/motor_map_plugin.py +54 -0
  99. bec_widgets/widgets/plots/{multi_waveform/register_bec_multi_waveform_widget.py → motor_map/register_motor_map.py} +2 -4
  100. bec_widgets/widgets/plots/motor_map/settings/motor_map_settings.py +129 -0
  101. bec_widgets/widgets/plots/motor_map/settings/motor_map_settings.ui +120 -0
  102. bec_widgets/widgets/plots/motor_map/toolbar_bundles/motor_selection.py +70 -0
  103. bec_widgets/widgets/plots/multi_waveform/multi_waveform.py +508 -0
  104. bec_widgets/widgets/plots/multi_waveform/multi_waveform.pyproject +1 -0
  105. bec_widgets/widgets/plots/multi_waveform/multi_waveform_plugin.py +54 -0
  106. bec_widgets/widgets/plots/multi_waveform/register_multi_waveform.py +15 -0
  107. bec_widgets/widgets/plots/multi_waveform/settings/control_panel.py +144 -0
  108. bec_widgets/widgets/plots/multi_waveform/settings/multi_waveform_controls.ui +164 -0
  109. bec_widgets/widgets/plots/multi_waveform/toolbar_bundles/monitor_selection.py +65 -0
  110. bec_widgets/widgets/{plots_next_gen → plots}/plot_base.py +321 -40
  111. bec_widgets/widgets/plots/{waveform/register_bec_waveform_widget.py → scatter_waveform/register_scatter_waveform.py} +3 -3
  112. bec_widgets/widgets/plots/scatter_waveform/scatter_curve.py +197 -0
  113. bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.py +553 -0
  114. bec_widgets/widgets/plots/scatter_waveform/scatter_waveform.pyproject +1 -0
  115. bec_widgets/widgets/plots/{image/bec_image_widget_plugin.py → scatter_waveform/scatter_waveform_plugin.py} +9 -13
  116. bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_setting.py +138 -0
  117. bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_settings_horizontal.ui +195 -0
  118. bec_widgets/widgets/plots/scatter_waveform/settings/scatter_curve_settings_vertical.ui +204 -0
  119. bec_widgets/widgets/{plots_next_gen → plots}/setting_menus/axis_settings.py +8 -8
  120. bec_widgets/widgets/{plots_next_gen → plots}/toolbar_bundles/mouse_interactions.py +4 -18
  121. bec_widgets/widgets/{plots_next_gen → plots}/toolbar_bundles/plot_export.py +14 -3
  122. bec_widgets/widgets/{plots_next_gen → plots}/toolbar_bundles/roi_bundle.py +6 -1
  123. bec_widgets/widgets/{plots_next_gen → plots}/toolbar_bundles/save_state.py +2 -2
  124. bec_widgets/widgets/{containers/figure/plots/waveform/waveform_curve.py → plots/waveform/curve.py} +119 -49
  125. bec_widgets/widgets/plots/waveform/register_waveform.py +15 -0
  126. bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_setting.py +125 -0
  127. bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py +576 -0
  128. bec_widgets/widgets/plots/waveform/utils/__init__.py +0 -0
  129. bec_widgets/widgets/plots/waveform/utils/roi_manager.py +84 -0
  130. bec_widgets/widgets/plots/waveform/waveform.py +1794 -0
  131. bec_widgets/widgets/plots/waveform/waveform.pyproject +1 -0
  132. bec_widgets/widgets/plots/waveform/{bec_waveform_widget_plugin.py → waveform_plugin.py} +9 -13
  133. bec_widgets/widgets/progress/bec_progressbar/bec_progressbar.py +1 -2
  134. bec_widgets/widgets/progress/ring_progress_bar/ring.py +11 -10
  135. bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py +24 -14
  136. bec_widgets/widgets/services/bec_queue/bec_queue.py +13 -11
  137. bec_widgets/widgets/services/bec_status_box/bec_status_box.py +3 -4
  138. bec_widgets/widgets/services/device_browser/device_browser.py +5 -2
  139. bec_widgets/widgets/services/device_browser/device_item/device_item.py +1 -1
  140. bec_widgets/widgets/utility/logpanel/logpanel.py +36 -17
  141. bec_widgets/widgets/utility/spinbox/decimal_spinbox.py +3 -3
  142. bec_widgets/widgets/utility/spinner/spinner.py +2 -2
  143. bec_widgets/widgets/utility/visual/color_button/color_button.py +1 -1
  144. bec_widgets/widgets/utility/visual/colormap_widget/colormap_widget.py +4 -6
  145. bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py +4 -8
  146. {bec_widgets-1.25.0.dist-info → bec_widgets-2.0.0.dist-info}/METADATA +3 -3
  147. {bec_widgets-1.25.0.dist-info → bec_widgets-2.0.0.dist-info}/RECORD +169 -154
  148. pyproject.toml +3 -3
  149. bec_widgets/applications/alignment/alignment_1d/alignment_1d.py +0 -198
  150. bec_widgets/applications/alignment/alignment_1d/alignment_1d.ui +0 -615
  151. bec_widgets/applications/bec_app.py +0 -84
  152. bec_widgets/cli/auto_updates.py +0 -168
  153. bec_widgets/widgets/containers/figure/__init__.py +0 -1
  154. bec_widgets/widgets/containers/figure/figure.py +0 -796
  155. bec_widgets/widgets/containers/figure/plots/axis_settings.py +0 -91
  156. bec_widgets/widgets/containers/figure/plots/axis_settings.ui +0 -256
  157. bec_widgets/widgets/containers/figure/plots/image/image.py +0 -772
  158. bec_widgets/widgets/containers/figure/plots/image/image_item.py +0 -337
  159. bec_widgets/widgets/containers/figure/plots/motor_map/motor_map.py +0 -525
  160. bec_widgets/widgets/containers/figure/plots/multi_waveform/multi_waveform.py +0 -340
  161. bec_widgets/widgets/containers/figure/plots/plot_base.py +0 -505
  162. bec_widgets/widgets/containers/figure/plots/waveform/waveform.py +0 -1563
  163. bec_widgets/widgets/plots/image/bec_image_widget.pyproject +0 -1
  164. bec_widgets/widgets/plots/image/image_widget.py +0 -515
  165. bec_widgets/widgets/plots/motor_map/bec_motor_map_widget.pyproject +0 -1
  166. bec_widgets/widgets/plots/motor_map/motor_map_dialog/motor_map_settings.py +0 -56
  167. bec_widgets/widgets/plots/motor_map/motor_map_dialog/motor_map_settings.ui +0 -108
  168. bec_widgets/widgets/plots/motor_map/motor_map_widget.py +0 -234
  169. bec_widgets/widgets/plots/multi_waveform/bec_multi_waveform_widget.pyproject +0 -1
  170. bec_widgets/widgets/plots/multi_waveform/multi_waveform_controls.ui +0 -99
  171. bec_widgets/widgets/plots/multi_waveform/multi_waveform_widget.py +0 -536
  172. bec_widgets/widgets/plots/waveform/bec_waveform_widget.pyproject +0 -1
  173. bec_widgets/widgets/plots/waveform/waveform_popups/curve_dialog/curve_dialog.py +0 -336
  174. bec_widgets/widgets/plots/waveform/waveform_popups/curve_dialog/curve_dialog.ui +0 -372
  175. bec_widgets/widgets/plots/waveform/waveform_popups/dap_summary_dialog/dap_summary_dialog.py +0 -25
  176. bec_widgets/widgets/plots/waveform/waveform_widget.py +0 -751
  177. /bec_widgets/{qt_utils → utils}/collapsible_panel_manager.py +0 -0
  178. /bec_widgets/{applications/alignment → utils/forms_from_types}/__init__.py +0 -0
  179. /bec_widgets/{qt_utils → utils}/redis_message_waiter.py +0 -0
  180. /bec_widgets/{applications/alignment/alignment_1d → widgets/containers/auto_update}/__init__.py +0 -0
  181. /bec_widgets/{qt_utils → widgets/containers/main_window/addons}/__init__.py +0 -0
  182. /bec_widgets/widgets/{containers/figure/plots → plots/image/toolbar_bundles}/__init__.py +0 -0
  183. /bec_widgets/widgets/{containers/figure/plots/image → plots/motor_map/settings}/__init__.py +0 -0
  184. /bec_widgets/widgets/{containers/figure/plots/motor_map → plots/motor_map/toolbar_bundles}/__init__.py +0 -0
  185. /bec_widgets/widgets/{containers/figure/plots/multi_waveform → plots/multi_waveform/settings}/__init__.py +0 -0
  186. /bec_widgets/widgets/{containers/figure/plots/waveform → plots/multi_waveform/toolbar_bundles}/__init__.py +0 -0
  187. /bec_widgets/widgets/plots/{motor_map/motor_map_dialog → scatter_waveform}/__init__.py +0 -0
  188. /bec_widgets/widgets/plots/{waveform/waveform_popups → scatter_waveform/settings}/__init__.py +0 -0
  189. /bec_widgets/widgets/plots/{waveform/waveform_popups/curve_dialog → setting_menus}/__init__.py +0 -0
  190. /bec_widgets/widgets/{plots_next_gen → plots}/setting_menus/axis_settings_horizontal.ui +0 -0
  191. /bec_widgets/widgets/{plots_next_gen → plots}/setting_menus/axis_settings_vertical.ui +0 -0
  192. /bec_widgets/widgets/plots/{waveform/waveform_popups/dap_summary_dialog → toolbar_bundles}/__init__.py +0 -0
  193. /bec_widgets/widgets/{plots_next_gen/setting_menus → plots/waveform/settings}/__init__.py +0 -0
  194. /bec_widgets/widgets/{plots_next_gen/toolbar_bundles → plots/waveform/settings/curve_settings}/__init__.py +0 -0
  195. {bec_widgets-1.25.0.dist-info → bec_widgets-2.0.0.dist-info}/WHEEL +0 -0
  196. {bec_widgets-1.25.0.dist-info → bec_widgets-2.0.0.dist-info}/entry_points.txt +0 -0
  197. {bec_widgets-1.25.0.dist-info → bec_widgets-2.0.0.dist-info}/licenses/LICENSE +0 -0
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "1.25.0"
7
+ version = "2.0.0"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -14,13 +14,13 @@ classifiers = [
14
14
  ]
15
15
  dependencies = [
16
16
  "bec_ipython_client>=2.21.4, <=4.0", # needed for jupyter console
17
- "bec_lib>=2.21.4, <=4.0",
17
+ "bec_lib>=3.29, <=4.0",
18
18
  "bec_qthemes~=0.7, >=0.7",
19
19
  "black~=24.0", # needed for bw-generate-cli
20
20
  "isort~=5.13, >=5.13.2", # needed for bw-generate-cli
21
21
  "pydantic~=2.0",
22
22
  "pyqtgraph~=0.13",
23
- "PySide6>=6.8",
23
+ "PySide6~=6.8.2",
24
24
  "pyte", # needed for vt100 console
25
25
  "qtconsole~=5.5, >=5.5.1", # needed for jupyter console
26
26
  "qtpy~=2.4",
@@ -1,198 +0,0 @@
1
- """ This module contains the GUI for the 1D alignment application.
2
- It is a preliminary version of the GUI, which will be added to the main branch and steadily updated to be improved.
3
- """
4
-
5
- import os
6
- from typing import Optional
7
-
8
- from bec_lib.device import Signal as BECSignal
9
- from bec_lib.endpoints import MessageEndpoints
10
- from bec_lib.logger import bec_logger
11
- from qtpy.QtCore import QSize
12
- from qtpy.QtGui import QIcon
13
- from qtpy.QtWidgets import QApplication
14
-
15
- import bec_widgets
16
- from bec_widgets.qt_utils.error_popups import SafeSlot as Slot
17
- from bec_widgets.utils import UILoader
18
- from bec_widgets.utils.bec_dispatcher import BECDispatcher
19
- from bec_widgets.utils.colors import get_accent_colors
20
- from bec_widgets.widgets.control.buttons.stop_button.stop_button import StopButton
21
- from bec_widgets.widgets.control.device_control.positioner_group.positioner_group import (
22
- PositionerGroup,
23
- )
24
- from bec_widgets.widgets.dap.lmfit_dialog.lmfit_dialog import LMFitDialog
25
- from bec_widgets.widgets.plots.waveform.waveform_widget import BECWaveformWidget
26
- from bec_widgets.widgets.progress.bec_progressbar.bec_progressbar import BECProgressBar
27
-
28
- MODULE_PATH = os.path.dirname(bec_widgets.__file__)
29
- logger = bec_logger.logger
30
-
31
-
32
- class Alignment1D:
33
- """Alignment GUI to perform 1D scans"""
34
-
35
- def __init__(self, client=None, gui_id: Optional[str] = None) -> None:
36
- """Initialization
37
-
38
- Args:
39
- config: Configuration of the application.
40
- client: BEC client object.
41
- gui_id: GUI ID.
42
- """
43
- self.bec_dispatcher = BECDispatcher(client=client)
44
- self.client = self.bec_dispatcher.client if client is None else client
45
- QApplication.instance().aboutToQuit.connect(self.close)
46
- self.dev = self.client.device_manager.devices
47
-
48
- self._accent_colors = get_accent_colors()
49
- self.ui_file = "alignment_1d.ui"
50
- self.ui = None
51
- self.progress_bar = None
52
- self.waveform = None
53
- self.init_ui()
54
-
55
- def init_ui(self):
56
- """Initialise the UI from QT Designer file"""
57
- current_path = os.path.dirname(__file__)
58
- self.ui = UILoader(None).loader(os.path.join(current_path, self.ui_file))
59
- # Customize the plotting widget
60
- self.waveform = self.ui.findChild(BECWaveformWidget, "bec_waveform_widget")
61
- self._customise_bec_waveform_widget()
62
- # Setup comboboxes for motor and signal selection
63
- # FIXME after changing the filtering in the combobox
64
- self._setup_signal_combobox()
65
- # Setup motor indicator
66
- self._setup_motor_indicator()
67
- # Setup progress bar
68
- self._setup_progress_bar()
69
- # Add actions buttons
70
- self._customise_buttons()
71
- # Hook scaninfo updates
72
- self.bec_dispatcher.connect_slot(self.scan_status_callback, MessageEndpoints.scan_status())
73
-
74
- def show(self):
75
- return self.ui.show()
76
-
77
- ##############################
78
- ############ SLOTS ###########
79
- ##############################
80
-
81
- @Slot(dict, dict)
82
- def scan_status_callback(self, content: dict, _) -> None:
83
- """This slot allows to enable/disable the UI critical components when a scan is running"""
84
- if content["status"] in ["open"]:
85
- self.enable_ui(False)
86
- elif content["status"] in ["aborted", "halted", "closed"]:
87
- self.enable_ui(True)
88
-
89
- @Slot(tuple)
90
- def move_to_center(self, move_request: tuple) -> None:
91
- """Move the selected motor to the center"""
92
- motor = self.ui.device_combobox.currentText()
93
- if move_request[0] in ["center", "center1", "center2"]:
94
- pos = move_request[1]
95
- self.dev.get(motor).move(float(pos), relative=False)
96
-
97
- @Slot()
98
- def reset_progress_bar(self) -> None:
99
- """Reset the progress bar"""
100
- self.progress_bar.set_value(0)
101
- self.progress_bar.set_minimum(0)
102
-
103
- @Slot(dict, dict)
104
- def update_progress_bar(self, content: dict, _) -> None:
105
- """Hook to update the progress bar
106
-
107
- Args:
108
- content: Content of the scan progress message.
109
- metadata: Metadata of the message.
110
- """
111
- if content["max_value"] == 0:
112
- self.progress_bar.set_value(0)
113
- return
114
- self.progress_bar.set_maximum(content["max_value"])
115
- self.progress_bar.set_value(content["value"])
116
-
117
- @Slot()
118
- def clear_queue(self) -> None:
119
- """Clear the scan queue"""
120
- self.queue.request_queue_reset()
121
-
122
- ##############################
123
- ######## END OF SLOTS ########
124
- ##############################
125
-
126
- def enable_ui(self, enable: bool) -> None:
127
- """Enable or disable the UI components"""
128
- # Enable/disable motor and signal selection
129
- self.ui.device_combobox_2.setEnabled(enable)
130
- # Enable/disable DAP selection
131
- self.ui.dap_combo_box.setEnabled(enable)
132
- # Enable/disable Scan Button
133
- # self.ui.scan_button.setEnabled(enable)
134
- # Disable move to buttons in LMFitDialog
135
- self.ui.findChild(LMFitDialog).set_actions_enabled(enable)
136
-
137
- def _customise_buttons(self) -> None:
138
- """Add action buttons for the Action Control.
139
- In addition, we are adding a callback to also clear the queue to the stop button
140
- to ensure that upon clicking the button, no scans from another client may be queued
141
- which would be confusing without the queue widget.
142
- """
143
- fit_dialog = self.ui.findChild(LMFitDialog)
144
- fit_dialog.active_action_list = ["center", "center1", "center2"]
145
- fit_dialog.move_action.connect(self.move_to_center)
146
- stop_button = self.ui.findChild(StopButton)
147
- stop_button.button.setText("Stop and Clear Queue")
148
- stop_button.button.clicked.connect(self.clear_queue)
149
-
150
- def _customise_bec_waveform_widget(self) -> None:
151
- """Customise the BEC Waveform Widget, i.e. clear the toolbar"""
152
- self.waveform.toolbar.clear()
153
-
154
- def _setup_motor_indicator(self) -> None:
155
- """Setup the arrow item"""
156
- self.waveform.waveform.tick_item.add_to_plot()
157
- positioner_box = self.ui.findChild(PositionerGroup)
158
- positioner_box.position_update.connect(self.waveform.waveform.tick_item.set_position)
159
- self.waveform.waveform.tick_item.set_position(0)
160
-
161
- def _setup_signal_combobox(self) -> None:
162
- """Setup signal selection"""
163
- # FIXME after changing the filtering in the combobox
164
- signals = [name for name in self.dev if isinstance(self.dev.get(name), BECSignal)]
165
- self.ui.device_combobox_2.setCurrentText(signals[0])
166
- self.ui.device_combobox_2.set_device_filter("Signal")
167
-
168
- def _setup_progress_bar(self) -> None:
169
- """Setup progress bar"""
170
- # FIXME once the BECScanProgressBar is implemented
171
- self.progress_bar = self.ui.findChild(BECProgressBar, "bec_progress_bar")
172
- self.progress_bar.set_value(0)
173
- self.ui.bec_waveform_widget.new_scan.connect(self.reset_progress_bar)
174
- self.bec_dispatcher.connect_slot(self.update_progress_bar, MessageEndpoints.scan_progress())
175
-
176
- def close(self):
177
- logger.info("Disconnecting", repr(self.bec_dispatcher))
178
- self.bec_dispatcher.disconnect_all()
179
- logger.info("Shutting down BEC Client", repr(self.client))
180
- self.client.shutdown()
181
-
182
-
183
- def main():
184
- import sys
185
-
186
- app = QApplication(sys.argv)
187
- icon = QIcon()
188
- icon.addFile(
189
- os.path.join(MODULE_PATH, "assets", "app_icons", "alignment_1d.png"), size=QSize(48, 48)
190
- )
191
- app.setWindowIcon(icon)
192
- window = Alignment1D()
193
- window.show()
194
- sys.exit(app.exec_())
195
-
196
-
197
- if __name__ == "__main__": # pragma: no cover
198
- main()