bec-widgets 0.118.0__py3-none-any.whl → 1.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 (26) hide show
  1. CHANGELOG.md +63 -67
  2. PKG-INFO +1 -1
  3. bec_widgets/applications/alignment/alignment_1d/alignment_1d.py +33 -89
  4. bec_widgets/applications/alignment/alignment_1d/alignment_1d.ui +413 -715
  5. bec_widgets/cli/client.py +22 -0
  6. bec_widgets/qt_utils/compact_popup.py +68 -23
  7. bec_widgets/utils/crosshair.py +11 -2
  8. bec_widgets/widgets/device_line_edit/device_line_edit.py +15 -1
  9. bec_widgets/widgets/figure/plots/waveform/waveform.py +15 -0
  10. bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +3 -2
  11. bec_widgets/widgets/positioner_box/positioner_box.py +10 -4
  12. bec_widgets/widgets/positioner_group/__init__.py +0 -0
  13. bec_widgets/widgets/positioner_group/positioner_group.py +170 -0
  14. bec_widgets/widgets/positioner_group/positioner_group.pyproject +1 -0
  15. bec_widgets/widgets/positioner_group/positioner_group_plugin.py +57 -0
  16. bec_widgets/widgets/positioner_group/register_positioner_group.py +15 -0
  17. bec_widgets/widgets/scan_control/scan_control.py +74 -122
  18. bec_widgets/widgets/scan_control/scan_group_box.py +66 -11
  19. bec_widgets/widgets/stop_button/stop_button.py +1 -1
  20. bec_widgets/widgets/waveform/waveform_widget.py +10 -0
  21. {bec_widgets-0.118.0.dist-info → bec_widgets-1.0.0.dist-info}/METADATA +1 -1
  22. {bec_widgets-0.118.0.dist-info → bec_widgets-1.0.0.dist-info}/RECORD +26 -21
  23. pyproject.toml +1 -1
  24. {bec_widgets-0.118.0.dist-info → bec_widgets-1.0.0.dist-info}/WHEEL +0 -0
  25. {bec_widgets-0.118.0.dist-info → bec_widgets-1.0.0.dist-info}/entry_points.txt +0 -0
  26. {bec_widgets-0.118.0.dist-info → bec_widgets-1.0.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md CHANGED
@@ -1,6 +1,53 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v1.0.0 (2024-10-18)
5
+
6
+ ### Breaking
7
+
8
+ * feat!: ability to disable scatter from waveform & compatible crosshair with down sampling ([`2ab12ed`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2ab12ed60abb995abc381d9330fdcf399796d9e5))
9
+
10
+ ### Bug Fixes
11
+
12
+ * fix(crosshair): downsample clear markers ([`f9a889f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f9a889fc6d380b9e587edcb465203122ea0bffc1))
13
+
14
+
15
+ ## v0.119.0 (2024-10-17)
16
+
17
+ ### Bug Fixes
18
+
19
+ * fix: fix syntax due to change of api for simulated devices ([`19f4e40`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/19f4e407e00ee242973ca4c3f90e4e41a4d3e315))
20
+
21
+ * fix: remove wrongly scoped test ([`a23841b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a23841b2553dc7162da943715d58275c7dc39ed9))
22
+
23
+ * fix: rename 'compact' property -> 'compact_view' ([`6982711`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6982711fea5fb8a73845ed7c0692e3ec53ef7871))
24
+
25
+ * fix: Alignment 1D update, make app window a main window (in .ui file) ([`0015f0e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0015f0e2d62adc02d3ef334e1f6dbb2d0288fec6))
26
+
27
+ * fix: set (Minimum, Fixed) size policy on Stop button ([`523cc43`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/523cc435725b10b7d59a4477a1aaa24a1f3e37a2))
28
+
29
+ ### Features
30
+
31
+ * feat: new PositionerGroup widget ([`af9655d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/af9655de0c541092437accfbaa779628a2f48ccb))
32
+
33
+ * feat: add 'expand_popup' property to CompactPopupWidget
34
+
35
+ This property tells if expand should show a popup (by default), or
36
+ if the widget should expand in-place ([`e4121a0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e4121a01cb6b8d496e630cd43bc642b994b8f310))
37
+
38
+ * feat: PositionerBox with a popup view ([`2615787`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/261578796f1de8ca9cab9b91659bc1484f7aa89d))
39
+
40
+ * feat: emit 'device_selected' and 'scan_axis' from scan control widget ([`0b9b1a3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0b9b1a3c89a98505079f7d4078915b7bbfaa1e23))
41
+
42
+ * feat: new 'device_selected' signals to ScanControl, ScanGroupBox, DeviceLineEdit ([`9801d27`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9801d2769eb0ee95c94ec0c011e1dac1407142ae))
43
+
44
+ ### Refactoring
45
+
46
+ * refactor: redesign of scan selection and scan control boxes ([`a69d287`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a69d2870e2b3539739781d741b27b8599c0f4abd))
47
+
48
+ * refactor: move add/remove bundle to scan group box ([`e3d0a7b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e3d0a7bbf9918dc16eb7227a178c310256ce570d))
49
+
50
+
4
51
  ## v0.118.0 (2024-10-13)
5
52
 
6
53
  ### Documentation
@@ -14,7 +61,7 @@
14
61
 
15
62
  ## v0.117.1 (2024-10-11)
16
63
 
17
- ### Fixes
64
+ ### Bug Fixes
18
65
 
19
66
  * fix(FPS): qtimer cleanup leaking ([`3a22392`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3a2239278075de7489ad10a58c31d7d89715e221))
20
67
 
@@ -58,18 +105,26 @@ complete UI ([`49268e3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/49268e38
58
105
 
59
106
  ## v0.115.0 (2024-10-08)
60
107
 
108
+ ### Bug Fixes
109
+
110
+ * fix: make Alignment1D a MainWindow as it is an application ([`c5e9ed6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c5e9ed6e422acb908e1ada32822f5d7cc256ade7))
111
+
112
+ * fix: adjust bec_qthemes dependency ([`b207e45`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b207e45a67818ee061272ce00a09fe7ea31cd1ba))
113
+
61
114
  ### Features
62
115
 
63
116
  * feat: add bec-app script to launch applications ([`8bf4842`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8bf48427884338672a8e3de3deb20439b0bfdf99))
64
117
 
65
- ### Fixes
66
118
 
67
- * fix: make Alignment1D a MainWindow as it is an application ([`c5e9ed6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c5e9ed6e422acb908e1ada32822f5d7cc256ade7))
119
+ ## v0.114.0 (2024-10-02)
68
120
 
69
- * fix: adjust bec_qthemes dependency ([`b207e45`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b207e45a67818ee061272ce00a09fe7ea31cd1ba))
121
+ ### Bug Fixes
70
122
 
123
+ * fix: prevent exception when empty string updates are coming from widget ([`04cfb1e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/04cfb1edf19437d54f07b868bcf3cfc2a35fd3bc))
71
124
 
72
- ## v0.114.0 (2024-10-02)
125
+ * fix: use new 'scan_axis' signal, to set_x and select x axis on waveform
126
+
127
+ Fixes #361, do not try to change x axis when not permitted ([`efa2763`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/efa276358b0f5a45cce9fa84fa5f9aafaf4284f7))
73
128
 
74
129
  ### Features
75
130
 
@@ -79,16 +134,12 @@ Signal is emitted before "scan_started", to inform about scan positioner
79
134
  and (start, stop) positions. In case of multiple bundles, the signal
80
135
  is emitted multiple times. ([`f084e25`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f084e2514bc9459cccaa951b79044bc25884e738))
81
136
 
82
- ### Fixes
83
137
 
84
- * fix: prevent exception when empty string updates are coming from widget ([`04cfb1e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/04cfb1edf19437d54f07b868bcf3cfc2a35fd3bc))
85
-
86
- * fix: use new 'scan_axis' signal, to set_x and select x axis on waveform
87
-
88
- Fixes #361, do not try to change x axis when not permitted ([`efa2763`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/efa276358b0f5a45cce9fa84fa5f9aafaf4284f7))
138
+ ## v0.113.0 (2024-10-02)
89
139
 
140
+ ### Bug Fixes
90
141
 
91
- ## v0.113.0 (2024-10-02)
142
+ * fix: add is_log checks and functionality to plot_indicator_items ([`0f9953e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0f9953e8fdcf3f9b5a09f994c69edb6b34756df9))
92
143
 
93
144
  ### Features
94
145
 
@@ -96,10 +147,6 @@ Fixes #361, do not try to change x axis when not permitted ([`efa2763`](https://
96
147
 
97
148
  * feat: add move to position button to lmfit dialog ([`281cb27`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/281cb27d8b5433e27a7ba0ca0a19e4b45b9c544f))
98
149
 
99
- ### Fixes
100
-
101
- * fix: add is_log checks and functionality to plot_indicator_items ([`0f9953e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0f9953e8fdcf3f9b5a09f994c69edb6b34756df9))
102
-
103
150
  ### Refactoring
104
151
 
105
152
  * refactor: various minor improvements for the alignment gui ([`f554f3c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f554f3c1672c4fe32968a5991dc98802556a6f3b))
@@ -121,54 +168,3 @@ Fixes #361, do not try to change x axis when not permitted ([`efa2763`](https://
121
168
  ### Unknown
122
169
 
123
170
  * feat : Add bec_signal_proxy to handle signals with option to unblock them manually. ([`1dcfeb6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1dcfeb6cfce3c69f0c5401731d4d3f9a1981b22e))
124
-
125
-
126
- ## v0.112.1 (2024-09-19)
127
-
128
- ### Documentation
129
-
130
- * docs(dap_combo_box): updated screenshot ([`e3b5e33`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e3b5e338bfaec276979183fb6d79ab41a7ca21e1))
131
-
132
- * docs(device_box): updated screenshot ([`c8e614b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c8e614b575b48be788a6389a7aa0cfa033d86ab8))
133
-
134
- ### Fixes
135
-
136
- * fix: test e2e dap wait_for_fit ([`b2f7d3c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b2f7d3c5f3f4bf00cc628f788e2c278ebb5688ae))
137
-
138
-
139
- ## v0.112.0 (2024-09-17)
140
-
141
- ### Features
142
-
143
- * feat: console: various improvements, auto-adapt rows to widget size, Qt Designer plugin ([`286ad71`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/286ad7196b0b8562d648fb304eab7d759b6a959b))
144
-
145
-
146
- ## v0.111.0 (2024-09-17)
147
-
148
- ### Documentation
149
-
150
- * docs(position_indicator): updated position indicator documentation and added designer properties ([`60f7d54`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/60f7d54e2b4c3129de6c95729b8b4aea1757174f))
151
-
152
- ### Features
153
-
154
- * feat(position_indicator): improved design and added more customization options ([`d15b222`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d15b22250fbceb708d89872c0380693e04acb107))
155
-
156
- ### Fixes
157
-
158
- * fix(position_indicator): fixed user access ([`dd932dd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd932dd8f3910ab67ec8403124f4e176d048e542))
159
-
160
- * fix(generate_cli): fixed type annotations ([`d3c1a1b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d3c1a1b2edcba7afea9d369820fa7974ac29c333))
161
-
162
- * fix(positioner_box): visual improvements to the positioner_box and positioner_control_line ([`7ea4a48`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7ea4a482e7cd9499a7268ac887b345cab01632aa))
163
-
164
- * fix(palette viewer): fixed background for tool tip ([`9045323`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9045323049d2a39c36fc8845f3b2883d6933436b))
165
-
166
-
167
- ## v0.110.0 (2024-09-12)
168
-
169
- ### Features
170
-
171
- * feat(palette_viewer): added widget to display the current palette and accent colors ([`a8576c1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a8576c164cad17746ec4fcd5c775fb78f70c055c))
172
-
173
-
174
- ## v0.109.1 (2024-09-09)
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.118.0
3
+ Version: 1.0.0
4
4
  Summary: BEC Widgets
5
5
  Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
6
  Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
@@ -8,45 +8,54 @@ from typing import Optional
8
8
  from bec_lib.device import Positioner as BECPositioner
9
9
  from bec_lib.device import Signal as BECSignal
10
10
  from bec_lib.endpoints import MessageEndpoints
11
+ from bec_lib.logger import bec_logger
11
12
  from qtpy.QtCore import QSize, Signal
12
13
  from qtpy.QtGui import QIcon
13
- from qtpy.QtWidgets import QCheckBox, QDoubleSpinBox, QMainWindow, QPushButton, QSpinBox
14
+ from qtpy.QtWidgets import (
15
+ QApplication,
16
+ QCheckBox,
17
+ QDoubleSpinBox,
18
+ QMainWindow,
19
+ QPushButton,
20
+ QSpinBox,
21
+ )
14
22
 
15
23
  import bec_widgets
16
24
  from bec_widgets.qt_utils.error_popups import SafeSlot as Slot
17
25
  from bec_widgets.qt_utils.toolbar import WidgetAction
18
26
  from bec_widgets.utils import UILoader
27
+ from bec_widgets.utils.bec_dispatcher import BECDispatcher
19
28
  from bec_widgets.utils.bec_widget import BECWidget
20
29
  from bec_widgets.utils.colors import get_accent_colors
21
30
  from bec_widgets.widgets.bec_progressbar.bec_progressbar import BECProgressBar
22
31
  from bec_widgets.widgets.device_line_edit.device_line_edit import DeviceLineEdit
23
32
  from bec_widgets.widgets.lmfit_dialog.lmfit_dialog import LMFitDialog
24
33
  from bec_widgets.widgets.positioner_box.positioner_box import PositionerBox
34
+ from bec_widgets.widgets.positioner_group.positioner_group import PositionerGroup
25
35
  from bec_widgets.widgets.stop_button.stop_button import StopButton
26
36
  from bec_widgets.widgets.toggle.toggle import ToggleSwitch
27
37
  from bec_widgets.widgets.waveform.waveform_widget import BECWaveformWidget
28
38
 
29
39
  MODULE_PATH = os.path.dirname(bec_widgets.__file__)
40
+ logger = bec_logger.logger
30
41
 
31
42
 
32
- class Alignment1D(BECWidget, QMainWindow):
43
+ class Alignment1D:
33
44
  """Alignment GUI to perform 1D scans"""
34
45
 
35
- # Emit a signal when a motion is ongoing
36
- motion_is_active = Signal(bool)
37
-
38
46
  def __init__(self, client=None, gui_id: Optional[str] = None) -> None:
39
- """Initialise the widget
47
+ """Initialization
40
48
 
41
49
  Args:
42
- parent: Parent widget.
43
- config: Configuration of the widget.
50
+ config: Configuration of the application.
44
51
  client: BEC client object.
45
52
  gui_id: GUI ID.
46
53
  """
47
- super().__init__(client=client, gui_id=gui_id)
48
- QMainWindow.__init__(self)
49
- self.get_bec_shortcuts()
54
+ self.bec_dispatcher = BECDispatcher(client=client)
55
+ self.client = self.bec_dispatcher.client if client is None else client
56
+ QApplication.instance().aboutToQuit.connect(self.close)
57
+ self.dev = self.client.device_manager.devices
58
+
50
59
  self._accent_colors = get_accent_colors()
51
60
  self.ui_file = "alignment_1d.ui"
52
61
  self.ui = None
@@ -57,28 +66,25 @@ class Alignment1D(BECWidget, QMainWindow):
57
66
  def init_ui(self):
58
67
  """Initialise the UI from QT Designer file"""
59
68
  current_path = os.path.dirname(__file__)
60
- self.ui = UILoader(self).loader(os.path.join(current_path, self.ui_file))
61
- self.setCentralWidget(self.ui)
69
+ self.ui = UILoader(None).loader(os.path.join(current_path, self.ui_file))
62
70
  # Customize the plotting widget
63
71
  self.waveform = self.ui.findChild(BECWaveformWidget, "bec_waveform_widget")
64
72
  self._customise_bec_waveform_widget()
65
73
  # Setup comboboxes for motor and signal selection
66
74
  # FIXME after changing the filtering in the combobox
67
- self._setup_motor_combobox()
68
75
  self._setup_signal_combobox()
69
76
  # Setup motor indicator
70
77
  self._setup_motor_indicator()
71
- # Connect spinboxes to scan Control
72
- self._setup_scan_control()
73
78
  # Setup progress bar
74
79
  self._setup_progress_bar()
75
80
  # Add actions buttons
76
81
  self._customise_buttons()
77
- # Customize the positioner box
78
- self._customize_positioner_box()
79
82
  # Hook scaninfo updates
80
83
  self.bec_dispatcher.connect_slot(self.scan_status_callback, MessageEndpoints.scan_status())
81
84
 
85
+ def show(self):
86
+ return self.ui.show()
87
+
82
88
  ##############################
83
89
  ############ SLOTS ###########
84
90
  ##############################
@@ -87,10 +93,8 @@ class Alignment1D(BECWidget, QMainWindow):
87
93
  def scan_status_callback(self, content: dict, _) -> None:
88
94
  """This slot allows to enable/disable the UI critical components when a scan is running"""
89
95
  if content["status"] in ["open"]:
90
- self.motion_is_active.emit(True)
91
96
  self.enable_ui(False)
92
97
  elif content["status"] in ["aborted", "halted", "closed"]:
93
- self.motion_is_active.emit(False)
94
98
  self.enable_ui(True)
95
99
 
96
100
  @Slot(tuple)
@@ -133,15 +137,11 @@ class Alignment1D(BECWidget, QMainWindow):
133
137
  def enable_ui(self, enable: bool) -> None:
134
138
  """Enable or disable the UI components"""
135
139
  # Enable/disable motor and signal selection
136
- self.ui.device_combobox.setEnabled(enable)
137
140
  self.ui.device_combobox_2.setEnabled(enable)
138
141
  # Enable/disable DAP selection
139
142
  self.ui.dap_combo_box.setEnabled(enable)
140
143
  # Enable/disable Scan Button
141
- self.ui.scan_button.setEnabled(enable)
142
- # Positioner control line
143
- # pylint: disable=protected-access
144
- self.ui.positioner_box._toogle_enable_buttons(enable)
144
+ # self.ui.scan_button.setEnabled(enable)
145
145
  # Disable move to buttons in LMFitDialog
146
146
  self.ui.findChild(LMFitDialog).set_actions_enabled(enable)
147
147
 
@@ -154,49 +154,20 @@ class Alignment1D(BECWidget, QMainWindow):
154
154
  fit_dialog = self.ui.findChild(LMFitDialog)
155
155
  fit_dialog.active_action_list = ["center", "center1", "center2"]
156
156
  fit_dialog.move_action.connect(self.move_to_center)
157
- scan_button = self.ui.findChild(QPushButton, "scan_button")
158
- scan_button.setStyleSheet(
159
- f"""
160
- QPushButton:enabled {{ background-color: {self._accent_colors.success.name()};color: white; }}
161
- QPushButton:disabled {{ background-color: grey;color: white; }}
162
- """
163
- )
164
157
  stop_button = self.ui.findChild(StopButton)
165
158
  stop_button.button.setText("Stop and Clear Queue")
166
159
  stop_button.button.clicked.connect(self.clear_queue)
167
160
 
168
161
  def _customise_bec_waveform_widget(self) -> None:
169
- """Customise the BEC Waveform Widget, i.e. clear the toolbar, add the DAP ROI selection to the toolbar.
170
- We also move the scan_control widget which is fully hidden and solely used for setting up the scan parameters to the toolbar.
171
- """
162
+ """Customise the BEC Waveform Widget, i.e. clear the toolbar"""
172
163
  self.waveform.toolbar.clear()
173
- toggle_switch = self.ui.findChild(ToggleSwitch, "toggle_switch")
174
- scan_control = self.ui.scan_control
175
- self.waveform.toolbar.populate_toolbar(
176
- {
177
- "label": WidgetAction(label="ENABLE DAP ROI", widget=toggle_switch),
178
- "scan_control": WidgetAction(widget=scan_control),
179
- },
180
- self.waveform,
181
- )
182
164
 
183
165
  def _setup_motor_indicator(self) -> None:
184
166
  """Setup the arrow item"""
185
167
  self.waveform.waveform.tick_item.add_to_plot()
186
- positioner_box = self.ui.findChild(PositionerBox)
168
+ positioner_box = self.ui.findChild(PositionerGroup)
187
169
  positioner_box.position_update.connect(self.waveform.waveform.tick_item.set_position)
188
- try:
189
- pos = float(positioner_box.ui.readback.text())
190
- except ValueError:
191
- pos = 0
192
- self.waveform.waveform.tick_item.set_position(pos)
193
-
194
- def _setup_motor_combobox(self) -> None:
195
- """Setup motor selection"""
196
- # FIXME after changing the filtering in the combobox
197
- motors = [name for name in self.dev if isinstance(self.dev.get(name), BECPositioner)]
198
- self.ui.device_combobox.setCurrentText(motors[0])
199
- self.ui.device_combobox.set_device_filter("Positioner")
170
+ self.waveform.waveform.tick_item.set_position(0)
200
171
 
201
172
  def _setup_signal_combobox(self) -> None:
202
173
  """Setup signal selection"""
@@ -205,31 +176,6 @@ class Alignment1D(BECWidget, QMainWindow):
205
176
  self.ui.device_combobox_2.setCurrentText(signals[0])
206
177
  self.ui.device_combobox_2.set_device_filter("Signal")
207
178
 
208
- def _setup_scan_control(self) -> None:
209
- """Setup scan control, connect spin and check boxes to the scan_control widget"""
210
- # Connect motor
211
- device_line_edit = self.ui.scan_control.arg_box.findChild(DeviceLineEdit)
212
- self.ui.device_combobox.currentTextChanged.connect(device_line_edit.setText)
213
- device_line_edit.setText(self.ui.device_combobox.currentText())
214
- # Connect start, stop, step, exp_time and relative check box
215
- spin_boxes = self.ui.scan_control.arg_box.findChildren(QDoubleSpinBox)
216
- start = self.ui.findChild(QDoubleSpinBox, "linescan_start")
217
- start.valueChanged.connect(spin_boxes[0].setValue)
218
- stop = self.ui.findChild(QDoubleSpinBox, "linescan_stop")
219
- stop.valueChanged.connect(spin_boxes[1].setValue)
220
- step = self.ui.findChild(QSpinBox, "linescan_step")
221
- step.valueChanged.connect(
222
- self.ui.scan_control.kwarg_boxes[0].findChildren(QSpinBox)[0].setValue
223
- )
224
- exp_time = self.ui.findChild(QDoubleSpinBox, "linescan_exp_time")
225
- exp_time.valueChanged.connect(
226
- self.ui.scan_control.kwarg_boxes[1].findChildren(QDoubleSpinBox)[0].setValue
227
- )
228
- relative = self.ui.findChild(QCheckBox, "linescan_relative")
229
- relative.toggled.connect(
230
- self.ui.scan_control.kwarg_boxes[0].findChildren(QCheckBox)[0].setChecked
231
- )
232
-
233
179
  def _setup_progress_bar(self) -> None:
234
180
  """Setup progress bar"""
235
181
  # FIXME once the BECScanProgressBar is implemented
@@ -238,18 +184,16 @@ class Alignment1D(BECWidget, QMainWindow):
238
184
  self.ui.bec_waveform_widget.new_scan.connect(self.reset_progress_bar)
239
185
  self.bec_dispatcher.connect_slot(self.update_progress_bar, MessageEndpoints.scan_progress())
240
186
 
241
- def _customize_positioner_box(self) -> None:
242
- """Customize the positioner Box, i.e. remove the stop button"""
243
- box = self.ui.findChild(PositionerBox)
244
- box.ui.stop.setVisible(False)
245
- box.ui.position_indicator.setFixedHeight(20)
187
+ def close(self):
188
+ logger.info("Disconnecting", repr(self.bec_dispatcher))
189
+ self.bec_dispatcher.disconnect_all()
190
+ logger.info("Shutting down BEC Client", repr(self.client))
191
+ self.client.shutdown()
246
192
 
247
193
 
248
194
  def main():
249
195
  import sys
250
196
 
251
- from qtpy.QtWidgets import QApplication # pylint: disable=ungrouped-imports
252
-
253
197
  app = QApplication(sys.argv)
254
198
  icon = QIcon()
255
199
  icon.addFile(