bec-widgets 0.93.4__py3-none-any.whl → 0.94.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.
CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.94.0 (2024-08-08)
4
+
5
+ ### Feature
6
+
7
+ * feat: add PositionerControlLine ([`c80a7cd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c80a7cd1083baa9543a2cee2e3c3a51dfd209b19))
8
+
9
+ ### Refactor
10
+
11
+ * refactor: adjust dimensions ([`0273bf4`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0273bf485694609325b5b556a3c69fb53c18446e))
12
+
13
+ ## v0.93.5 (2024-08-08)
14
+
15
+ ### Fix
16
+
17
+ * fix(positioner_box): icons fixed ([`281633d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/281633deff15b6879dac3a4f0770fa6949aaecdc))
18
+
19
+ ### Refactor
20
+
21
+ * refactor: add button for positioner selection ([`0d190c5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0d190c5c5996e59fec4bdd44d2003e10e200b009))
22
+
23
+ ### Test
24
+
25
+ * test(dap): wait for fit ([`6269009`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6269009e5451f830cdee58a514c7858483488a8d))
26
+
27
+ * test(auto-update): wait for rendering ([`6d2442d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6d2442d23c683fe92af13df982ce681c07e99cde))
28
+
3
29
  ## v0.93.4 (2024-08-07)
4
30
 
5
31
  ### Fix
@@ -118,30 +144,6 @@ This reverts commit fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 ([`5aad401`](https:
118
144
 
119
145
  ## v0.92.0 (2024-07-24)
120
146
 
121
- ### Feature
122
-
123
- * feat(dock): dock style sheets updated ([`8ca60d5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8ca60d54b3cfa621172ce097fc1ba514c47ebac7))
124
-
125
- * feat(general_gui): general gui added ([`5696c99`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5696c993dc1c0da40ff3e99f754c246cc017ea32))
126
-
127
147
  ### Fix
128
148
 
129
149
  * fix(dock): custom label can be created closable ([`4457ef2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4457ef2147e21b856c9dcaf63c81ba98002dcaf1))
130
-
131
- * fix(device_combobox): set minimum size to 125px ([`1206e15`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1206e153094cd8505badf69a1461572a76b4c5ad))
132
-
133
- ## v0.91.0 (2024-07-23)
134
-
135
- ### Feature
136
-
137
- * feat(dock_area): plugin added ([`a16b87a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a16b87ac28d164230dd2e8020f50ff3a63cd407e))
138
-
139
- ### Fix
140
-
141
- * fix(status_item): icons changed to material design ([`1b9c55a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1b9c55a46a0dfd8678c8e95ff64dd6e8cfb9233e))
142
-
143
- * fix(plugins): Qt Designer plugins icons adjusted ([`f4844d2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f4844d2e067ce75dc64b89b230d7932b308ddfc2))
144
-
145
- ### Test
146
-
147
- * test(dock_area): tests extended ([`06fab0e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/06fab0eab926cef5677d4988fd1fce09da342dd8))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.93.4
3
+ Version: 0.94.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
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M180-404.87v-50.26h289.75v50.26H180Zm0-162.57v-50.25h454.62v50.25H180Zm0-162.3V-780h454.62v50.26H180ZM524.62-180v-105.69l217.15-216.16q7.46-7.07 16.11-10.3 8.65-3.23 17.3-3.23 9.43 0 18.25 3.53 8.82 3.54 16.03 10.62l37 37.38q6.87 7.47 10.21 16.16Q860-439 860-430.31t-3.37 17.69q-3.37 9-10.52 16.46L630.31-180H524.62Zm250.69-211.69 37-38.62-37-37.38-38 38 38 38Z"/>
3
+ </svg>
bec_widgets/cli/client.py CHANGED
@@ -24,6 +24,7 @@ class Widgets(str, enum.Enum):
24
24
  DeviceComboBox = "DeviceComboBox"
25
25
  DeviceLineEdit = "DeviceLineEdit"
26
26
  PositionerBox = "PositionerBox"
27
+ PositionerControlLine = "PositionerControlLine"
27
28
  RingProgressBar = "RingProgressBar"
28
29
  ScanControl = "ScanControl"
29
30
  StopButton = "StopButton"
@@ -2352,6 +2353,17 @@ class PositionerBox(RPCBase):
2352
2353
  """
2353
2354
 
2354
2355
 
2356
+ class PositionerControlLine(RPCBase):
2357
+ @rpc_call
2358
+ def set_positioner(self, positioner: str):
2359
+ """
2360
+ Set the device
2361
+
2362
+ Args:
2363
+ positioner (Positioner | str) : Positioner to set, accepts str or the device
2364
+ """
2365
+
2366
+
2355
2367
  class Ring(RPCBase):
2356
2368
  @rpc_call
2357
2369
  def _get_all_rpc(self) -> "dict":
@@ -7,20 +7,26 @@ from bec_lib.device import Positioner
7
7
  from bec_lib.endpoints import MessageEndpoints
8
8
  from bec_lib.logger import bec_logger
9
9
  from bec_lib.messages import ScanQueueMessage
10
- from qtpy.QtCore import Property, Signal, Slot
11
- from qtpy.QtGui import QDoubleValidator
12
- from qtpy.QtWidgets import QDoubleSpinBox, QVBoxLayout, QWidget
10
+ from qtpy.QtCore import Property, QSize, Signal, Slot
11
+ from qtpy.QtGui import QDoubleValidator, QIcon
12
+ from qtpy.QtWidgets import QDialog, QDoubleSpinBox, QPushButton, QVBoxLayout, QWidget
13
13
 
14
14
  from bec_widgets.utils import UILoader
15
15
  from bec_widgets.utils.bec_widget import BECWidget
16
16
  from bec_widgets.utils.colors import apply_theme
17
+ from bec_widgets.widgets.device_line_edit.device_line_edit import DeviceLineEdit
17
18
 
18
19
  logger = bec_logger.logger
19
20
 
21
+ MODULE_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
22
+
20
23
 
21
24
  class PositionerBox(BECWidget, QWidget):
22
25
  """Simple Widget to control a positioner in box form"""
23
26
 
27
+ ui_file = "positioner_box.ui"
28
+ dimensions = (234, 224)
29
+
24
30
  USER_ACCESS = ["set_positioner"]
25
31
  device_changed = Signal(str, str)
26
32
 
@@ -48,7 +54,7 @@ class PositionerBox(BECWidget, QWidget):
48
54
  self.device_changed.connect(self.on_device_change)
49
55
 
50
56
  current_path = os.path.dirname(__file__)
51
- self.ui = UILoader(self).loader(os.path.join(current_path, "positioner_box.ui"))
57
+ self.ui = UILoader(self).loader(os.path.join(current_path, self.ui_file))
52
58
 
53
59
  self.layout = QVBoxLayout(self)
54
60
  self.layout.addWidget(self.ui)
@@ -57,8 +63,8 @@ class PositionerBox(BECWidget, QWidget):
57
63
 
58
64
  # fix the size of the device box
59
65
  db = self.ui.device_box
60
- db.setFixedHeight(234)
61
- db.setFixedWidth(224)
66
+ db.setFixedHeight(self.dimensions[0])
67
+ db.setFixedWidth(self.dimensions[1])
62
68
 
63
69
  self.ui.step_size.setStepType(QDoubleSpinBox.AdaptiveDecimalStepType)
64
70
  self.ui.stop.clicked.connect(self.on_stop)
@@ -71,6 +77,36 @@ class PositionerBox(BECWidget, QWidget):
71
77
  self.setpoint_validator = QDoubleValidator()
72
78
  self.ui.setpoint.setValidator(self.setpoint_validator)
73
79
  self.ui.spinner_widget.start()
80
+ self.ui.tool_button.clicked.connect(self._open_dialog_selection)
81
+ icon = QIcon()
82
+ icon.addFile(
83
+ os.path.join(MODULE_PATH, "assets", "toolbar_icons", "device_line_edit.svg"),
84
+ size=QSize(16, 16),
85
+ )
86
+ self.ui.tool_button.setIcon(icon)
87
+
88
+ def _open_dialog_selection(self):
89
+ """Open dialog window for positioner selection"""
90
+ dialog = QDialog(self)
91
+ dialog.setWindowTitle("Positioner Selection")
92
+ layout = QVBoxLayout()
93
+ line_edit = DeviceLineEdit(self, client=self.client, device_filter="Positioner")
94
+ line_edit.textChanged.connect(self._positioner_changed)
95
+ layout.addWidget(line_edit)
96
+ close_button = QPushButton("Close")
97
+ close_button.clicked.connect(dialog.accept)
98
+ layout.addWidget(close_button)
99
+ dialog.setLayout(layout)
100
+ dialog.exec()
101
+
102
+ @Slot(str)
103
+ def _positioner_changed(self, positioner_name: str):
104
+ """Changed input in combobox.
105
+
106
+ Args:
107
+ positioner_name (str): name of the positioner
108
+ """
109
+ self.set_positioner(positioner_name)
74
110
 
75
111
  def init_device(self):
76
112
  """Init the device view and readback"""
@@ -267,7 +303,7 @@ if __name__ == "__main__": # pragma: no cover
267
303
  from qtpy.QtWidgets import QApplication
268
304
 
269
305
  app = QApplication(sys.argv)
270
- apply_theme("light")
306
+ apply_theme("dark")
271
307
  widget = PositionerBox(device="bpm4i")
272
308
 
273
309
  widget.show()
@@ -78,6 +78,9 @@
78
78
  <property name="enabled">
79
79
  <bool>false</bool>
80
80
  </property>
81
+ <property name="alignment">
82
+ <set>Qt::AlignmentFlag::AlignCenter</set>
83
+ </property>
81
84
  </widget>
82
85
  </item>
83
86
  <item row="3" column="0">
@@ -125,6 +128,13 @@
125
128
  <layout class="QVBoxLayout" name="verticalLayout_2">
126
129
  <item>
127
130
  <layout class="QHBoxLayout" name="horizontalLayout">
131
+ <item>
132
+ <widget class="QToolButton" name="tool_button">
133
+ <property name="text">
134
+ <string>...</string>
135
+ </property>
136
+ </widget>
137
+ </item>
128
138
  <item>
129
139
  <spacer name="horizontalSpacer">
130
140
  <property name="orientation">
@@ -1,6 +1,8 @@
1
1
  # Copyright (C) 2022 The Qt Company Ltd.
2
2
  # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
3
 
4
+ import os
5
+
4
6
  from qtpy.QtDesigner import QDesignerCustomWidgetInterface
5
7
  from qtpy.QtGui import QIcon
6
8
 
@@ -12,6 +14,7 @@ DOM_XML = """
12
14
  </widget>
13
15
  </ui>
14
16
  """
17
+ MODULE_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
15
18
 
16
19
 
17
20
  class PositionerBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
@@ -27,10 +30,11 @@ class PositionerBoxPlugin(QDesignerCustomWidgetInterface): # pragma: no cover
27
30
  return DOM_XML
28
31
 
29
32
  def group(self):
30
- return ""
33
+ return "Device Control"
31
34
 
32
35
  def icon(self):
33
- return QIcon()
36
+ icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "positioner_box.png")
37
+ return QIcon(icon_path)
34
38
 
35
39
  def includeFile(self):
36
40
  return "positioner_box"
@@ -0,0 +1,33 @@
1
+ from bec_lib.device import Positioner
2
+
3
+ from bec_widgets.widgets.positioner_box.positioner_box import PositionerBox
4
+
5
+
6
+ class PositionerControlLine(PositionerBox):
7
+ """A widget that controls a single device."""
8
+
9
+ ui_file = "positioner_control_line.ui"
10
+ dimensions = (60, 600) # height, width
11
+
12
+ def __init__(self, parent=None, device: Positioner = None, *args, **kwargs):
13
+ """Initialize the DeviceControlLine.
14
+
15
+ Args:
16
+ parent: The parent widget.
17
+ device (Positioner): The device to control.
18
+ """
19
+ super().__init__(parent=parent, device=device, *args, **kwargs)
20
+
21
+
22
+ if __name__ == "__main__": # pragma: no cover
23
+ import sys
24
+
25
+ import qdarktheme
26
+ from qtpy.QtWidgets import QApplication
27
+
28
+ app = QApplication(sys.argv)
29
+ qdarktheme.setup_theme("dark")
30
+ widget = PositionerControlLine(device="samy")
31
+
32
+ widget.show()
33
+ sys.exit(app.exec_())
@@ -0,0 +1 @@
1
+ {'files': ['positioner_control_line.py']}
@@ -0,0 +1,216 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ui version="4.0">
3
+ <class>Form</class>
4
+ <widget class="QWidget" name="Form">
5
+ <property name="geometry">
6
+ <rect>
7
+ <x>0</x>
8
+ <y>0</y>
9
+ <width>785</width>
10
+ <height>91</height>
11
+ </rect>
12
+ </property>
13
+ <property name="minimumSize">
14
+ <size>
15
+ <width>0</width>
16
+ <height>0</height>
17
+ </size>
18
+ </property>
19
+ <property name="maximumSize">
20
+ <size>
21
+ <width>16777215</width>
22
+ <height>16777215</height>
23
+ </size>
24
+ </property>
25
+ <property name="windowTitle">
26
+ <string>Form</string>
27
+ </property>
28
+ <layout class="QVBoxLayout" name="verticalLayout">
29
+ <item>
30
+ <widget class="QGroupBox" name="device_box">
31
+ <property name="title">
32
+ <string>Device Name</string>
33
+ </property>
34
+ <layout class="QHBoxLayout" name="horizontalLayout">
35
+ <item>
36
+ <widget class="QToolButton" name="tool_button">
37
+ <property name="sizePolicy">
38
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
39
+ <horstretch>0</horstretch>
40
+ <verstretch>0</verstretch>
41
+ </sizepolicy>
42
+ </property>
43
+ <property name="minimumSize">
44
+ <size>
45
+ <width>25</width>
46
+ <height>25</height>
47
+ </size>
48
+ </property>
49
+ <property name="maximumSize">
50
+ <size>
51
+ <width>25</width>
52
+ <height>25</height>
53
+ </size>
54
+ </property>
55
+ <property name="text">
56
+ <string>...</string>
57
+ </property>
58
+ </widget>
59
+ </item>
60
+ <item>
61
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
62
+ <item>
63
+ <widget class="PositionIndicator" name="position_indicator">
64
+ <property name="minimumSize">
65
+ <size>
66
+ <width>80</width>
67
+ <height>10</height>
68
+ </size>
69
+ </property>
70
+ </widget>
71
+ </item>
72
+ <item>
73
+ <widget class="SpinnerWidget" name="spinner_widget">
74
+ <property name="minimumSize">
75
+ <size>
76
+ <width>25</width>
77
+ <height>25</height>
78
+ </size>
79
+ </property>
80
+ <property name="maximumSize">
81
+ <size>
82
+ <width>25</width>
83
+ <height>25</height>
84
+ </size>
85
+ </property>
86
+ </widget>
87
+ </item>
88
+ <item>
89
+ <widget class="QLabel" name="readback">
90
+ <property name="minimumSize">
91
+ <size>
92
+ <width>80</width>
93
+ <height>0</height>
94
+ </size>
95
+ </property>
96
+ <property name="maximumSize">
97
+ <size>
98
+ <width>150</width>
99
+ <height>16777215</height>
100
+ </size>
101
+ </property>
102
+ <property name="text">
103
+ <string>Position</string>
104
+ </property>
105
+ <property name="alignment">
106
+ <set>Qt::AlignmentFlag::AlignCenter</set>
107
+ </property>
108
+ </widget>
109
+ </item>
110
+ <item>
111
+ <widget class="QLineEdit" name="setpoint">
112
+ <property name="minimumSize">
113
+ <size>
114
+ <width>80</width>
115
+ <height>24</height>
116
+ </size>
117
+ </property>
118
+ <property name="maximumSize">
119
+ <size>
120
+ <width>150</width>
121
+ <height>16777215</height>
122
+ </size>
123
+ </property>
124
+ <property name="alignment">
125
+ <set>Qt::AlignmentFlag::AlignCenter</set>
126
+ </property>
127
+ </widget>
128
+ </item>
129
+ </layout>
130
+ </item>
131
+ <item>
132
+ <widget class="QPushButton" name="stop">
133
+ <property name="text">
134
+ <string>Stop</string>
135
+ </property>
136
+ </widget>
137
+ </item>
138
+ <item>
139
+ <widget class="QToolButton" name="tweak_left">
140
+ <property name="minimumSize">
141
+ <size>
142
+ <width>30</width>
143
+ <height>30</height>
144
+ </size>
145
+ </property>
146
+ <property name="maximumSize">
147
+ <size>
148
+ <width>30</width>
149
+ <height>30</height>
150
+ </size>
151
+ </property>
152
+ <property name="text">
153
+ <string>...</string>
154
+ </property>
155
+ <property name="iconSize">
156
+ <size>
157
+ <width>30</width>
158
+ <height>30</height>
159
+ </size>
160
+ </property>
161
+ <property name="arrowType">
162
+ <enum>Qt::ArrowType::LeftArrow</enum>
163
+ </property>
164
+ </widget>
165
+ </item>
166
+ <item>
167
+ <widget class="QDoubleSpinBox" name="step_size"/>
168
+ </item>
169
+ <item>
170
+ <widget class="QToolButton" name="tweak_right">
171
+ <property name="minimumSize">
172
+ <size>
173
+ <width>30</width>
174
+ <height>30</height>
175
+ </size>
176
+ </property>
177
+ <property name="maximumSize">
178
+ <size>
179
+ <width>30</width>
180
+ <height>30</height>
181
+ </size>
182
+ </property>
183
+ <property name="text">
184
+ <string>...</string>
185
+ </property>
186
+ <property name="iconSize">
187
+ <size>
188
+ <width>30</width>
189
+ <height>30</height>
190
+ </size>
191
+ </property>
192
+ <property name="arrowType">
193
+ <enum>Qt::ArrowType::RightArrow</enum>
194
+ </property>
195
+ </widget>
196
+ </item>
197
+ </layout>
198
+ </widget>
199
+ </item>
200
+ </layout>
201
+ </widget>
202
+ <customwidgets>
203
+ <customwidget>
204
+ <class>SpinnerWidget</class>
205
+ <extends>QWidget</extends>
206
+ <header>spinner_widget</header>
207
+ </customwidget>
208
+ <customwidget>
209
+ <class>PositionIndicator</class>
210
+ <extends>QWidget</extends>
211
+ <header>position_indicator</header>
212
+ </customwidget>
213
+ </customwidgets>
214
+ <resources/>
215
+ <connections/>
216
+ </ui>
@@ -0,0 +1,58 @@
1
+ # Copyright (C) 2022 The Qt Company Ltd.
2
+ # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
+
4
+ import os
5
+
6
+ from qtpy.QtDesigner import QDesignerCustomWidgetInterface
7
+ from qtpy.QtGui import QIcon
8
+
9
+ from bec_widgets.widgets.positioner_box.positioner_control_line import PositionerControlLine
10
+
11
+ DOM_XML = """
12
+ <ui language='c++'>
13
+ <widget class='PositionerControlLine' name='positioner_control_line'>
14
+ </widget>
15
+ </ui>
16
+ """
17
+ MODULE_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
18
+
19
+
20
+ class PositionerControlLinePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
21
+ def __init__(self):
22
+ super().__init__()
23
+ self._form_editor = None
24
+
25
+ def createWidget(self, parent):
26
+ t = PositionerControlLine(parent)
27
+ return t
28
+
29
+ def domXml(self):
30
+ return DOM_XML
31
+
32
+ def group(self):
33
+ return "Device Control"
34
+
35
+ def icon(self):
36
+ icon_path = os.path.join(MODULE_PATH, "assets", "designer_icons", "positioner_box.png")
37
+ return QIcon(icon_path)
38
+
39
+ def includeFile(self):
40
+ return "positioner_control_line"
41
+
42
+ def initialize(self, form_editor):
43
+ self._form_editor = form_editor
44
+
45
+ def isContainer(self):
46
+ return False
47
+
48
+ def isInitialized(self):
49
+ return self._form_editor is not None
50
+
51
+ def name(self):
52
+ return "PositionerControlLine"
53
+
54
+ def toolTip(self):
55
+ return "A widget that controls a single positioner in line form."
56
+
57
+ def whatsThis(self):
58
+ return self.toolTip()
@@ -0,0 +1,17 @@
1
+ def main(): # pragma: no cover
2
+ from qtpy import PYSIDE6
3
+
4
+ if not PYSIDE6:
5
+ print("PYSIDE6 is not available in the environment. Cannot patch designer.")
6
+ return
7
+ from PySide6.QtDesigner import QPyDesignerCustomWidgetCollection
8
+
9
+ from bec_widgets.widgets.positioner_box.positioner_control_line_plugin import (
10
+ PositionerControlLinePlugin,
11
+ )
12
+
13
+ QPyDesignerCustomWidgetCollection.addCustomWidget(PositionerControlLinePlugin())
14
+
15
+
16
+ if __name__ == "__main__": # pragma: no cover
17
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.93.4
3
+ Version: 0.94.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
@@ -2,11 +2,11 @@
2
2
  .gitlab-ci.yml,sha256=BtKhZI3dhK09En1BfpglYi-ZJwG6ZdC-iJr7kXFVfCg,8346
3
3
  .pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
4
4
  .readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
5
- CHANGELOG.md,sha256=9EMQ1Af_QTOMF06XtrQGfth_oD5stOlkjsSdeKkgV14,6659
5
+ CHANGELOG.md,sha256=59GkHYkNg7uAMVi6Pb531x_aXSwWaojrE5vPcuzaWMw,6509
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=xpE3WACvw9YH_nuy0jPV4Z6i7pmskaF_vKGawCZmRj4,1307
7
+ PKG-INFO,sha256=MjxbUnm5qYS_aDZkXcxgQrtOuBkrM1JqqHz6yXZax-M,1307
8
8
  README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
9
- pyproject.toml,sha256=82c_u5P42OZ7b5q0YCuRpdwyNig4v_cDMaRISa5CNX4,2356
9
+ pyproject.toml,sha256=8_Y0Tw5VT2lcRdLe26uyF7YlOpW5GuvQ2D7muY13CjQ,2356
10
10
  .git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
11
11
  .gitlab/issue_templates/bug_report_template.md,sha256=gAuyEwl7XlnebBrkiJ9AqffSNOywmr8vygUFWKTuQeI,386
12
12
  .gitlab/issue_templates/documentation_update_template.md,sha256=FHLdb3TS_D9aL4CYZCjyXSulbaW5mrN2CmwTaeLPbNw,860
@@ -19,7 +19,6 @@ bec_widgets/assets/app_icons/terminal_icon.png,sha256=bJl7Tft4Fi2uxvuXI8o14uMHnI
19
19
  bec_widgets/assets/designer_icons/code.png,sha256=o_d4UbojdvmdPY6exO3Eu0aQlS3UbvMuwrTlptvRMQE,4420
20
20
  bec_widgets/assets/designer_icons/color_button.png,sha256=1cg0jmTbWQbfmmEb09ABoX03tovIt6loLyO90oOVe8k,4810
21
21
  bec_widgets/assets/designer_icons/colormap_selector.png,sha256=KULLUA5T9SLhcSyrdouG07nXHZtE-LNNOn0ghG7T-OQ,6831
22
- bec_widgets/assets/designer_icons/device_box.png,sha256=CtEDj_GTTi_WOmKipuMjbKsejIBVEFiAxy7QsKHke5A,3676
23
22
  bec_widgets/assets/designer_icons/device_combo_box.png,sha256=ubt4ltSC8gIkrTnzaZ58JhiIinFhmKBstYIMrcH5Ua4,3555
24
23
  bec_widgets/assets/designer_icons/device_line_edit.png,sha256=68sb_4_z7SvdTXsw21g6dIuWKX70l08LB8pW79d8cg8,3316
25
24
  bec_widgets/assets/designer_icons/dock_area.png,sha256=I5U1ivkYRtcxSF2wQQa-SMHxHYDm06Nhd0AvGip9gCk,2774
@@ -27,6 +26,7 @@ bec_widgets/assets/designer_icons/games.png,sha256=83th_P_GG6d_xd7X55rqy8yf8ygeV
27
26
  bec_widgets/assets/designer_icons/image.png,sha256=0Kppbe2BBcsXzSHjqHxjrRgBE6DUT-ZF7xNPMMI2bxA,3984
28
27
  bec_widgets/assets/designer_icons/motor_map.png,sha256=8iqST5mTnZfv9rN9rx3D-XBm232Mwvzz9D0Wx6QaT8I,7293
29
28
  bec_widgets/assets/designer_icons/position_indicator.png,sha256=9moeldNTfRWdf7aFvBS1GCewYtKC5o3hgx8BDgxALb0,2030
29
+ bec_widgets/assets/designer_icons/positioner_box.png,sha256=CtEDj_GTTi_WOmKipuMjbKsejIBVEFiAxy7QsKHke5A,3676
30
30
  bec_widgets/assets/designer_icons/queue.png,sha256=NdlrmWwon7K2zWbqg32WkHx1RBKznQDN5H-UfRVqDRA,1827
31
31
  bec_widgets/assets/designer_icons/ring_progress.png,sha256=klAmhZJOpFZOkI1fP1nk47Ug6uHXc1s_0y_vwmFMhjU,10358
32
32
  bec_widgets/assets/designer_icons/scan_control.png,sha256=WxdbBMCnGh1e_qsgPxccSDcR0hhUzUBiHtAjortzWh0,4392
@@ -47,7 +47,7 @@ bec_widgets/assets/toolbar_icons/attach_all.svg,sha256=AfnrIQ2zBkgpKdiIGY2NqJdhg
47
47
  bec_widgets/assets/toolbar_icons/auto_range.svg,sha256=vX_1qIl1dK6QEmEdp9OAw5SRcEugKvV_B5a2z8_jAtA,258
48
48
  bec_widgets/assets/toolbar_icons/compare.svg,sha256=se1AHEq0tpPueVLC05QsYXMiWbzff3sgUs_KUGXkmR0,351
49
49
  bec_widgets/assets/toolbar_icons/connection.svg,sha256=czIb1BnshmxJnER8ssU3WcLENrFSIUfMwberajWOGAk,341
50
- bec_widgets/assets/toolbar_icons/device_box.svg,sha256=cZC0vckMHsvwR1OSWzNqhG8h9CIJg6Q2Qy2wYDpzapY,266
50
+ bec_widgets/assets/toolbar_icons/device_line_edit.svg,sha256=XjEzYUIRlWc3aDM8FxvXm9RGOxRp2mZZzKnoWVLHctg,492
51
51
  bec_widgets/assets/toolbar_icons/drag_pan_mode.svg,sha256=ruinkJ0dVEPSH7ll4Pufl9c7oTwVXvcN57oTgiVRY5I,470
52
52
  bec_widgets/assets/toolbar_icons/export.svg,sha256=-kDEfxzloR1fOpZ5d4KIkxGH7wS_4Z1uJImtnKA5XxU,371
53
53
  bec_widgets/assets/toolbar_icons/fft.svg,sha256=fX31gulUsQTtpqbGbw4lpB1UwmIXh2LX2y4B2jPzyuo,2704
@@ -62,6 +62,7 @@ bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg,sha256=hq6YMySVWF01SeEXzp
62
62
  bec_widgets/assets/toolbar_icons/log_scale.png,sha256=pFYt9wn988rd-RHnyCuMw0WnIQY61UmEDvAHaiTs5dA,6453
63
63
  bec_widgets/assets/toolbar_icons/motor_map.svg,sha256=CRaoiALzdUByu6bTbJOg6czEzoI-1yRwcljlXUl4JNw,693
64
64
  bec_widgets/assets/toolbar_icons/photo_library.svg,sha256=weiDCYiHh9dzcA21D-37zpYts2CyoGAd9x-N_h292Mo,564
65
+ bec_widgets/assets/toolbar_icons/positioner_box.svg,sha256=cZC0vckMHsvwR1OSWzNqhG8h9CIJg6Q2Qy2wYDpzapY,266
65
66
  bec_widgets/assets/toolbar_icons/progress.svg,sha256=xcfcqNfhxVqmf2LbuVukuYxr1gS8kY57vCG1zDLO-rA,724
66
67
  bec_widgets/assets/toolbar_icons/queue.svg,sha256=yQuUkDo0tYT3tVqntPmiJD7YPK2bE5O8sj6GIKan3kA,248
67
68
  bec_widgets/assets/toolbar_icons/rectangle_mode.svg,sha256=N7AXB3da-RW8OpjLFeOUh1SDKVQ-9SWGPUjkryujyeE,946
@@ -81,7 +82,7 @@ bec_widgets/assets/toolbar_icons/transform.svg,sha256=Fgug9wCi1FONy08nssEvnoDDDB
81
82
  bec_widgets/assets/toolbar_icons/waveform.svg,sha256=darXWaIww4HEu9skFUd8Vs1NSAgUo1d37xBNr6DX-bM,231
82
83
  bec_widgets/cli/__init__.py,sha256=d0Q6Fn44e7wFfLabDOBxpcJ1DPKWlFunGYDUBmO-4hA,22
83
84
  bec_widgets/cli/auto_updates.py,sha256=DyBV3HnjMSH-cvVkYNcDiYKVf0Xut4Qy2qGQqkW47Bw,4833
84
- bec_widgets/cli/client.py,sha256=3zXER7rSN5DfFO_-rkSrkHdERnPD5bnrk3WjxJE9EiI,75957
85
+ bec_widgets/cli/client.py,sha256=HjBxjthimBvbyVrjvLZoeBN1NdezupowRYjZxqDlOX8,76261
85
86
  bec_widgets/cli/client_utils.py,sha256=cDhabblwaP88a0jlVpbn_RWWKVbsyjhmmGtMh9gesEw,12388
86
87
  bec_widgets/cli/generate_cli.py,sha256=Ea5px9KblUlcGg-1JbJBTIU7laGg2n8PM7Efw9WVVzM,5889
87
88
  bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
@@ -204,11 +205,16 @@ bec_widgets/widgets/position_indicator/position_indicator.pyproject,sha256=s0JEf
204
205
  bec_widgets/widgets/position_indicator/position_indicator_plugin.py,sha256=xD8YyATYfpoHxGVcsecDKx9CLASAP6lKyypCEjRhNd0,1441
205
206
  bec_widgets/widgets/position_indicator/register_position_indicator.py,sha256=OZNiMgM_80TPSAXK_0hXAkne4vUh8DGvh_OdpOiMpwI,516
206
207
  bec_widgets/widgets/positioner_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
207
- bec_widgets/widgets/positioner_box/positioner_box.py,sha256=nD_Nlk6-Q6rUWlhoGZ_IpF7PJwdZqumTnoBSKFYM-XI,9437
208
+ bec_widgets/widgets/positioner_box/positioner_box.py,sha256=FyUGskWAb-5m44bdUNVig_AkoDbLRbB0GucI6RRHge8,10839
208
209
  bec_widgets/widgets/positioner_box/positioner_box.pyproject,sha256=7966pHdDseaHciaPNEKgdQgbUThSZf5wEDCeAEJh9po,32
209
- bec_widgets/widgets/positioner_box/positioner_box.ui,sha256=Odvy2uFKt2guLmBQo8ZVX_32fkkHCAbBvGRlYr_dsu4,5318
210
- bec_widgets/widgets/positioner_box/positioner_box_plugin.py,sha256=-zv5LuUEp2lNwQ8G-vaBoxJHOKGn7WZpTQn5LD_M5Lk,1237
210
+ bec_widgets/widgets/positioner_box/positioner_box.ui,sha256=Y-Xp0z32okT7X4-rL5r7dF_QH_QpXvPes3f778cC7_k,5633
211
+ bec_widgets/widgets/positioner_box/positioner_box_plugin.py,sha256=Q-FTqaxB78ShlhB56TtDMtllEb-USqWRw_s6gm0WUr0,1441
212
+ bec_widgets/widgets/positioner_box/positioner_control_line.py,sha256=DWSDakPsOu8SrhTMKh9NR8b1a7npuyrkjVpZVqj1Kb0,915
213
+ bec_widgets/widgets/positioner_box/positioner_control_line.pyproject,sha256=RGIXDjWq3fNCgOnU-08oeIeBLCcjYbRXgyh26drxB7I,41
214
+ bec_widgets/widgets/positioner_box/positioner_control_line.ui,sha256=hJ4e3e3A1zZY3WRfQ7yvAZUAtL8tJhCJX2bWbtty_EQ,5625
215
+ bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py,sha256=lX5oqGHb0100NIvI1MxyeSswaCdyA1FGnVmOYtlhEtk,1515
211
216
  bec_widgets/widgets/positioner_box/register_positioner_box.py,sha256=UPOUjXXq6-IgSj0kdV_nJe1rYPMF8aIZxF4eSmWgQAg,483
217
+ bec_widgets/widgets/positioner_box/register_positioner_control_line.py,sha256=MJ13vKGIwTMQGFhll63tfUGXHyd6bz40Cvr85oYKH3I,525
212
218
  bec_widgets/widgets/ring_progress_bar/__init__.py,sha256=_uoJKnDM2YAeUBfwc5WLbIHSJj7zm_FAurSKP3WRaCw,47
213
219
  bec_widgets/widgets/ring_progress_bar/register_ring_progress_bar.py,sha256=uJrMhkuQi2PdWa0BwFJqjVXSkO-TXoyai4EQYOOe9t4,493
214
220
  bec_widgets/widgets/ring_progress_bar/ring.py,sha256=2pdEzETaJpvx4Dzyosq2YhnvDOEUvFnj_f9GfFKpG5Q,11159
@@ -315,8 +321,8 @@ docs/user/widgets/widgets.md,sha256=ZeRNmP7GUOu8kEoGu9XHsyF8Hb1foqZKEbwpgFP7ITk,
315
321
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
316
322
  tests/end-2-end/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
317
323
  tests/end-2-end/conftest.py,sha256=-BLnFE-NeCerf6xahGCkbZ4Ktactowi6RkBnboIzRvg,1767
318
- tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=hj06aUBGofq7yeFVoT3LB4NrCjc5FbOo5CGTvz7afpI,9118
319
- tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=73vuBbPJvkMR3w2jnQ7lk0z4-wN3HAmkLFDdv4BRPrM,6604
324
+ tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=FwbqHOlEcdimTiJaOJKfqHkOhqJY6R8Z9YNYnU8QCt4,9447
325
+ tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=_OTyZfkF0D9cvdwRhHNfNadCpZPWybOCryN6EUs7tXI,6804
320
326
  tests/end-2-end/test_rpc_register_e2e.py,sha256=blhMiW7HVHX1kGm5dg8Sv0PeCuJ0gnBz3evznQFz_B8,1619
321
327
  tests/end-2-end/test_scan_control_e2e.py,sha256=u7oLgFyltkMW2apSZKDukMIXvYrbhHrU32p4mBdn8VE,2276
322
328
  tests/references/SpinnerWidget/SpinnerWidget_darwin.png,sha256=-Tf5x0xY0pb-8sXH6Pk8cZL5PAxZ4vMR5RgyGCxisM4,9490
@@ -347,7 +353,7 @@ tests/unit_tests/test_generate_plugin.py,sha256=9603ucZChM-pYpHadzsR94U1Zec1KZT3
347
353
  tests/unit_tests/test_motor_map_widget.py,sha256=j3Vv_jNTsJTg6UgtwoxFp-Qwi_1blT9HK-USALPgxSI,7469
348
354
  tests/unit_tests/test_plot_base.py,sha256=evejmkYBBAu9f5XoA4dpYGPRGR5lIc3JqN4UQdGRY3Q,4134
349
355
  tests/unit_tests/test_plugin_utils.py,sha256=ayksWdrFY7kOiA0wVEjKFmFCF3UhH3lG8tzPVOpwysk,528
350
- tests/unit_tests/test_positioner_box.py,sha256=Uc8d3rfgo74b-S53xglQr1HIXNBIKJIE5y5lkSSVZeg,3919
356
+ tests/unit_tests/test_positioner_box.py,sha256=EdWFmia64dw4BI1y4LwA09lRF6nfkn-IgfVUEZzcMsU,5011
351
357
  tests/unit_tests/test_ring_progress_bar.py,sha256=Q-hbRPj44Oa3RLJayQGNUKTnsDllk6j4sJwyJdDudT4,12233
352
358
  tests/unit_tests/test_rpc_register.py,sha256=hECjZEimd440mwRrO0rg7L3PKN7__3DgjmESN6wx3bo,1179
353
359
  tests/unit_tests/test_rpc_server.py,sha256=MvstcvqUsnGAzUxw8Et1xXXikk_VIxFPwDZD0v1QGkg,1500
@@ -370,8 +376,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
370
376
  tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
371
377
  tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
372
378
  tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
373
- bec_widgets-0.93.4.dist-info/METADATA,sha256=xpE3WACvw9YH_nuy0jPV4Z6i7pmskaF_vKGawCZmRj4,1307
374
- bec_widgets-0.93.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
375
- bec_widgets-0.93.4.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
376
- bec_widgets-0.93.4.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
377
- bec_widgets-0.93.4.dist-info/RECORD,,
379
+ bec_widgets-0.94.0.dist-info/METADATA,sha256=MjxbUnm5qYS_aDZkXcxgQrtOuBkrM1JqqHz6yXZax-M,1307
380
+ bec_widgets-0.94.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
381
+ bec_widgets-0.94.0.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
382
+ bec_widgets-0.94.0.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
383
+ bec_widgets-0.94.0.dist-info/RECORD,,
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_widgets"
7
- version = "0.93.4"
7
+ version = "0.94.0"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -9,6 +9,10 @@ from bec_widgets.cli.auto_updates import AutoUpdates
9
9
  from bec_widgets.cli.client import BECDockArea, BECFigure, BECImageShow, BECMotorMap, BECWaveform
10
10
  from bec_widgets.utils import Colors
11
11
 
12
+ # pylint: disable=unused-argument
13
+ # pylint: disable=redefined-outer-name
14
+ # pylint: disable=too-many-locals
15
+
12
16
 
13
17
  def test_rpc_add_dock_with_figure_e2e(bec_client_lib, rpc_server_dock):
14
18
  # BEC client shortcuts
@@ -227,13 +231,20 @@ def test_ring_bar_scan_update(bec_client_lib, rpc_server_dock):
227
231
  assert bar_config["rings"][1]["max_value"] == final_samy
228
232
 
229
233
 
230
- def test_auto_update(bec_client_lib, rpc_server_dock):
234
+ def test_auto_update(bec_client_lib, rpc_server_dock, qtbot):
231
235
  dock = BECDockArea(rpc_server_dock)
232
236
 
233
237
  AutoUpdates.enabled = True
234
238
  AutoUpdates.create_default_dock = True
235
239
  dock.auto_updates = AutoUpdates(gui=dock)
236
240
  dock.auto_updates.start_default_dock()
241
+
242
+ def get_default_figure():
243
+ return dock.auto_updates.get_default_figure()
244
+
245
+ qtbot.waitUntil(lambda: get_default_figure() is not None, timeout=10000)
246
+ plt = get_default_figure()
247
+
237
248
  dock.selected_device = "bpm4i"
238
249
 
239
250
  # we need to start the update script manually; normally this is done when the GUI is started
@@ -250,7 +261,6 @@ def test_auto_update(bec_client_lib, rpc_server_dock):
250
261
  last_scan_data = queue.scan_storage.storage[-1].data
251
262
 
252
263
  # get data from curves
253
- plt = dock.auto_updates.get_default_figure()
254
264
  widgets = plt.widget_list
255
265
  plt_data = widgets[0].get_all_data()
256
266
 
@@ -271,6 +281,7 @@ def test_auto_update(bec_client_lib, rpc_server_dock):
271
281
 
272
282
  plt = dock.auto_updates.get_default_figure()
273
283
  widgets = plt.widget_list
284
+ qtbot.waitUntil(lambda: len(plt.widget_list) > 0, timeout=5000)
274
285
  plt_data = widgets[0].get_all_data()
275
286
 
276
287
  last_scan_data = queue.scan_storage.storage[-1].data
@@ -158,7 +158,7 @@ def test_rpc_motor_map(rpc_server_figure, bec_client_lib):
158
158
  )
159
159
 
160
160
 
161
- def test_dap_rpc(rpc_server_figure, bec_client_lib):
161
+ def test_dap_rpc(rpc_server_figure, bec_client_lib, qtbot):
162
162
 
163
163
  fig = BECFigure(rpc_server_figure)
164
164
  plt = fig.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
@@ -178,13 +178,15 @@ def test_dap_rpc(rpc_server_figure, bec_client_lib):
178
178
  res = scans.line_scan(dev.samx, 0, 8, steps=50, relative=False)
179
179
  res.wait()
180
180
 
181
- time.sleep(2)
181
+ # especially on slow machines, the fit might not be done yet
182
+ # so we wait until the fit reaches the expected value
183
+ def wait_for_fit():
184
+ dap_curve = plt.get_curve("bpm4i-bpm4i-GaussianModel")
185
+ fit_params = dap_curve.dap_params
186
+ print(fit_params)
187
+ return np.isclose(fit_params["center"], 5, atol=0.5)
182
188
 
183
- dap_curve = plt.get_curve("bpm4i-bpm4i-GaussianModel")
184
- fit_params = dap_curve.dap_params
185
- print(fit_params)
186
-
187
- assert np.isclose(fit_params["center"], 5, atol=0.5)
189
+ qtbot.waitUntil(wait_for_fit, timeout=10000)
188
190
 
189
191
 
190
192
  def test_removing_subplots(rpc_server_figure, bec_client_lib):
@@ -7,12 +7,14 @@ from bec_lib.messages import ScanQueueMessage
7
7
  from qtpy.QtGui import QValidator
8
8
 
9
9
  from bec_widgets.widgets.positioner_box.positioner_box import PositionerBox
10
+ from bec_widgets.widgets.positioner_box.positioner_control_line import PositionerControlLine
10
11
 
11
12
  from .client_mocks import mocked_client
12
13
 
13
14
 
14
15
  @pytest.fixture
15
16
  def positioner_box(qtbot, mocked_client):
17
+ """Fixture for PositionerBox widget"""
16
18
  with mock.patch("bec_widgets.widgets.positioner_box.positioner_box.uuid.uuid4") as mock_uuid:
17
19
  mock_uuid.return_value = "fake_uuid"
18
20
  with mock.patch(
@@ -25,6 +27,7 @@ def positioner_box(qtbot, mocked_client):
25
27
 
26
28
 
27
29
  def test_positioner_box(positioner_box):
30
+ """Test init of positioner box"""
28
31
  assert positioner_box.device == "samx"
29
32
  data = positioner_box.dev["samx"].read()
30
33
  # Avoid check for Positioner class from BEC in _init_device
@@ -42,6 +45,7 @@ def test_positioner_box(positioner_box):
42
45
 
43
46
 
44
47
  def test_positioner_box_update_limits(positioner_box):
48
+ """Test update of limits"""
45
49
  positioner_box._limits = None
46
50
  positioner_box.update_limits([0, 10])
47
51
  assert positioner_box._limits == [0, 10]
@@ -63,6 +67,7 @@ def test_positioner_box_update_limits(positioner_box):
63
67
 
64
68
 
65
69
  def test_positioner_box_on_stop(positioner_box):
70
+ """Test on stop button"""
66
71
  with mock.patch.object(positioner_box.client.connector, "send") as mock_send:
67
72
  positioner_box.on_stop()
68
73
  params = {"device": "samx", "rpc_id": "fake_uuid", "func": "stop", "args": [], "kwargs": {}}
@@ -76,6 +81,7 @@ def test_positioner_box_on_stop(positioner_box):
76
81
 
77
82
 
78
83
  def test_positioner_box_setpoint_change(positioner_box):
84
+ """Test positioner box setpoint change"""
79
85
  with mock.patch.object(positioner_box.dev["samx"], "move") as mock_move:
80
86
  positioner_box.ui.setpoint.setText("100")
81
87
  positioner_box.on_setpoint_change()
@@ -83,6 +89,7 @@ def test_positioner_box_setpoint_change(positioner_box):
83
89
 
84
90
 
85
91
  def test_positioner_box_on_tweak_right(positioner_box):
92
+ """Test tweak right button"""
86
93
  with mock.patch.object(positioner_box.dev["samx"], "move") as mock_move:
87
94
  positioner_box.ui.step_size.setValue(0.1)
88
95
  positioner_box.on_tweak_right()
@@ -90,6 +97,7 @@ def test_positioner_box_on_tweak_right(positioner_box):
90
97
 
91
98
 
92
99
  def test_positioner_box_on_tweak_left(positioner_box):
100
+ """Test tweak left button"""
93
101
  with mock.patch.object(positioner_box.dev["samx"], "move") as mock_move:
94
102
  positioner_box.ui.step_size.setValue(0.1)
95
103
  positioner_box.on_tweak_left()
@@ -97,8 +105,26 @@ def test_positioner_box_on_tweak_left(positioner_box):
97
105
 
98
106
 
99
107
  def test_positioner_box_setpoint_out_of_range(positioner_box):
108
+ """Test setpoint out of range"""
100
109
  positioner_box.update_limits([0, 10])
101
110
  positioner_box.ui.setpoint.setText("100")
102
111
  positioner_box.on_setpoint_change()
103
112
  assert positioner_box.ui.setpoint.text() == "100"
104
113
  assert positioner_box.ui.setpoint.hasAcceptableInput() == False
114
+
115
+
116
+ def test_positioner_control_line(qtbot, mocked_client):
117
+ """Test PositionerControlLine.
118
+ Inherits from PositionerBox, but the layout is changed. Check dimensions only
119
+ """
120
+ with mock.patch("bec_widgets.widgets.positioner_box.positioner_box.uuid.uuid4") as mock_uuid:
121
+ mock_uuid.return_value = "fake_uuid"
122
+ with mock.patch(
123
+ "bec_widgets.widgets.positioner_box.positioner_box.PositionerBox._check_device_is_valid",
124
+ return_value=True,
125
+ ):
126
+ db = PositionerControlLine(device="samx", client=mocked_client)
127
+ qtbot.addWidget(db)
128
+
129
+ assert db.ui.device_box.height() == 60
130
+ assert db.ui.device_box.width() == 600