bec-widgets 0.93.5__py3-none-any.whl → 0.94.1__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 +16 -14
- PKG-INFO +1 -1
- bec_widgets/cli/client.py +12 -0
- bec_widgets/utils/bec_dispatcher.py +3 -3
- bec_widgets/widgets/positioner_box/positioner_box.py +6 -3
- bec_widgets/widgets/positioner_box/positioner_control_line.py +33 -0
- bec_widgets/widgets/positioner_box/positioner_control_line.pyproject +1 -0
- bec_widgets/widgets/positioner_box/positioner_control_line.ui +216 -0
- bec_widgets/widgets/positioner_box/positioner_control_line_plugin.py +58 -0
- bec_widgets/widgets/positioner_box/register_positioner_control_line.py +17 -0
- {bec_widgets-0.93.5.dist-info → bec_widgets-0.94.1.dist-info}/METADATA +1 -1
- {bec_widgets-0.93.5.dist-info → bec_widgets-0.94.1.dist-info}/RECORD +18 -13
- pyproject.toml +1 -1
- tests/unit_tests/test_bec_dispatcher.py +2 -0
- tests/unit_tests/test_positioner_box.py +26 -0
- {bec_widgets-0.93.5.dist-info → bec_widgets-0.94.1.dist-info}/WHEEL +0 -0
- {bec_widgets-0.93.5.dist-info → bec_widgets-0.94.1.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.93.5.dist-info → bec_widgets-0.94.1.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.94.1 (2024-08-12)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix: issue #292, wrong key was used to clean _slots internal dictionary ([`93d3977`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/93d397759c756397604ebff5e24f3a580be8620d))
|
8
|
+
|
9
|
+
## v0.94.0 (2024-08-08)
|
10
|
+
|
11
|
+
### Feature
|
12
|
+
|
13
|
+
* feat: add PositionerControlLine ([`c80a7cd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c80a7cd1083baa9543a2cee2e3c3a51dfd209b19))
|
14
|
+
|
15
|
+
### Refactor
|
16
|
+
|
17
|
+
* refactor: adjust dimensions ([`0273bf4`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0273bf485694609325b5b556a3c69fb53c18446e))
|
18
|
+
|
3
19
|
## v0.93.5 (2024-08-08)
|
4
20
|
|
5
21
|
### Fix
|
@@ -131,17 +147,3 @@ This reverts commit fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6 ([`5aad401`](https:
|
|
131
147
|
* refactor: renamed DeviceMonitor2DMessage ([`4be6fd6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4be6fd6b83ea1048f16310f7d2bbe777b13b245e))
|
132
148
|
|
133
149
|
* refactor: rename device_monitor to device_monitor_2d ([`714e1e1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/714e1e139e0033d2725fefb636c419ca137a68c6))
|
134
|
-
|
135
|
-
## v0.92.0 (2024-07-24)
|
136
|
-
|
137
|
-
### Feature
|
138
|
-
|
139
|
-
* feat(dock): dock style sheets updated ([`8ca60d5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8ca60d54b3cfa621172ce097fc1ba514c47ebac7))
|
140
|
-
|
141
|
-
* feat(general_gui): general gui added ([`5696c99`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5696c993dc1c0da40ff3e99f754c246cc017ea32))
|
142
|
-
|
143
|
-
### Fix
|
144
|
-
|
145
|
-
* fix(dock): custom label can be created closable ([`4457ef2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4457ef2147e21b856c9dcaf63c81ba98002dcaf1))
|
146
|
-
|
147
|
-
* fix(device_combobox): set minimum size to 125px ([`1206e15`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1206e153094cd8505badf69a1461572a76b4c5ad))
|
PKG-INFO
CHANGED
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":
|
@@ -162,9 +162,9 @@ class BECDispatcher:
|
|
162
162
|
return
|
163
163
|
self.client.connector.unregister(topics, cb=connected_slot)
|
164
164
|
topics_str, _ = self.client.connector._convert_endpointinfo(topics)
|
165
|
-
self._slots[
|
166
|
-
if not self._slots[
|
167
|
-
del self._slots[
|
165
|
+
self._slots[connected_slot].difference_update(set(topics_str))
|
166
|
+
if not self._slots[connected_slot]:
|
167
|
+
del self._slots[connected_slot]
|
168
168
|
|
169
169
|
def disconnect_topics(self, topics: Union[str, list]):
|
170
170
|
self.client.connector.unregister(topics)
|
@@ -24,6 +24,9 @@ MODULE_PATH = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
|
|
24
24
|
class PositionerBox(BECWidget, QWidget):
|
25
25
|
"""Simple Widget to control a positioner in box form"""
|
26
26
|
|
27
|
+
ui_file = "positioner_box.ui"
|
28
|
+
dimensions = (234, 224)
|
29
|
+
|
27
30
|
USER_ACCESS = ["set_positioner"]
|
28
31
|
device_changed = Signal(str, str)
|
29
32
|
|
@@ -51,7 +54,7 @@ class PositionerBox(BECWidget, QWidget):
|
|
51
54
|
self.device_changed.connect(self.on_device_change)
|
52
55
|
|
53
56
|
current_path = os.path.dirname(__file__)
|
54
|
-
self.ui = UILoader(self).loader(os.path.join(current_path,
|
57
|
+
self.ui = UILoader(self).loader(os.path.join(current_path, self.ui_file))
|
55
58
|
|
56
59
|
self.layout = QVBoxLayout(self)
|
57
60
|
self.layout.addWidget(self.ui)
|
@@ -60,8 +63,8 @@ class PositionerBox(BECWidget, QWidget):
|
|
60
63
|
|
61
64
|
# fix the size of the device box
|
62
65
|
db = self.ui.device_box
|
63
|
-
db.setFixedHeight(
|
64
|
-
db.setFixedWidth(
|
66
|
+
db.setFixedHeight(self.dimensions[0])
|
67
|
+
db.setFixedWidth(self.dimensions[1])
|
65
68
|
|
66
69
|
self.ui.step_size.setStepType(QDoubleSpinBox.AdaptiveDecimalStepType)
|
67
70
|
self.ui.stop.clicked.connect(self.on_stop)
|
@@ -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()
|
@@ -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=
|
5
|
+
CHANGELOG.md,sha256=oCzB0EpdV8HR6KkMTqeIRWoqFb6IddSxbiHM_4Lbl8c,6533
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=BmrzIa7-lpELNsnzboeX4nA6maDnRy0LI_Ab3FieNQE,1307
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=AAsfwyRhG1HwZKWguyvUld8nvCNQ5bfXLInKw0KMpDo,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
|
@@ -82,7 +82,7 @@ bec_widgets/assets/toolbar_icons/transform.svg,sha256=Fgug9wCi1FONy08nssEvnoDDDB
|
|
82
82
|
bec_widgets/assets/toolbar_icons/waveform.svg,sha256=darXWaIww4HEu9skFUd8Vs1NSAgUo1d37xBNr6DX-bM,231
|
83
83
|
bec_widgets/cli/__init__.py,sha256=d0Q6Fn44e7wFfLabDOBxpcJ1DPKWlFunGYDUBmO-4hA,22
|
84
84
|
bec_widgets/cli/auto_updates.py,sha256=DyBV3HnjMSH-cvVkYNcDiYKVf0Xut4Qy2qGQqkW47Bw,4833
|
85
|
-
bec_widgets/cli/client.py,sha256=
|
85
|
+
bec_widgets/cli/client.py,sha256=HjBxjthimBvbyVrjvLZoeBN1NdezupowRYjZxqDlOX8,76261
|
86
86
|
bec_widgets/cli/client_utils.py,sha256=cDhabblwaP88a0jlVpbn_RWWKVbsyjhmmGtMh9gesEw,12388
|
87
87
|
bec_widgets/cli/generate_cli.py,sha256=Ea5px9KblUlcGg-1JbJBTIU7laGg2n8PM7Efw9WVVzM,5889
|
88
88
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
@@ -109,7 +109,7 @@ bec_widgets/qt_utils/toolbar.py,sha256=89WddOXPePby2CICUumdN_K_3DBgZPCR8HWUJAwrh
|
|
109
109
|
bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U,533
|
110
110
|
bec_widgets/utils/bec_connector.py,sha256=SivHKXVyNVqeu3kCXYEPpbleTVw8g1cW0FKq1QrQgco,9987
|
111
111
|
bec_widgets/utils/bec_designer.py,sha256=ak3G8FdojUPjVBBwdPXw7tN5P2Uxr-SSoQt394jXeAA,4308
|
112
|
-
bec_widgets/utils/bec_dispatcher.py,sha256=
|
112
|
+
bec_widgets/utils/bec_dispatcher.py,sha256=l2NRuiHGA-tr3gwJXSk7h5ZBKDuDqP8gmJKHJFc_n9I,6225
|
113
113
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
114
114
|
bec_widgets/utils/bec_widget.py,sha256=Bo2v1aP7rgSAQajW8GBJbI3iovTn_hGCsmeFMo7bT10,707
|
115
115
|
bec_widgets/utils/colors.py,sha256=hNIi99EpMv3t3hTJIL2jBe5nzh5f2fuCyEKXEPWSQSc,10501
|
@@ -205,11 +205,16 @@ bec_widgets/widgets/position_indicator/position_indicator.pyproject,sha256=s0JEf
|
|
205
205
|
bec_widgets/widgets/position_indicator/position_indicator_plugin.py,sha256=xD8YyATYfpoHxGVcsecDKx9CLASAP6lKyypCEjRhNd0,1441
|
206
206
|
bec_widgets/widgets/position_indicator/register_position_indicator.py,sha256=OZNiMgM_80TPSAXK_0hXAkne4vUh8DGvh_OdpOiMpwI,516
|
207
207
|
bec_widgets/widgets/positioner_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
208
|
-
bec_widgets/widgets/positioner_box/positioner_box.py,sha256=
|
208
|
+
bec_widgets/widgets/positioner_box/positioner_box.py,sha256=FyUGskWAb-5m44bdUNVig_AkoDbLRbB0GucI6RRHge8,10839
|
209
209
|
bec_widgets/widgets/positioner_box/positioner_box.pyproject,sha256=7966pHdDseaHciaPNEKgdQgbUThSZf5wEDCeAEJh9po,32
|
210
210
|
bec_widgets/widgets/positioner_box/positioner_box.ui,sha256=Y-Xp0z32okT7X4-rL5r7dF_QH_QpXvPes3f778cC7_k,5633
|
211
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
|
212
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
|
213
218
|
bec_widgets/widgets/ring_progress_bar/__init__.py,sha256=_uoJKnDM2YAeUBfwc5WLbIHSJj7zm_FAurSKP3WRaCw,47
|
214
219
|
bec_widgets/widgets/ring_progress_bar/register_ring_progress_bar.py,sha256=uJrMhkuQi2PdWa0BwFJqjVXSkO-TXoyai4EQYOOe9t4,493
|
215
220
|
bec_widgets/widgets/ring_progress_bar/ring.py,sha256=2pdEzETaJpvx4Dzyosq2YhnvDOEUvFnj_f9GfFKpG5Q,11159
|
@@ -328,7 +333,7 @@ tests/unit_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
328
333
|
tests/unit_tests/client_mocks.py,sha256=4pS4KvvFGY9hjphds9i-GoIjVWVkax4XpDnVp6Mctfw,5275
|
329
334
|
tests/unit_tests/conftest.py,sha256=EE5RX_xR50ELJPgT2kny9rM1NCmCRO22sd_L9fvVSEk,1917
|
330
335
|
tests/unit_tests/test_bec_connector.py,sha256=5uqBfjgMeOlGvqJlFbytxEpZ1El7_Y2q8fZHh4GvtD8,2478
|
331
|
-
tests/unit_tests/test_bec_dispatcher.py,sha256=
|
336
|
+
tests/unit_tests/test_bec_dispatcher.py,sha256=uHKMDc2112Q7XY5GkaeV_uGzsjHCoOa7u-MpR-Y-sJA,4078
|
332
337
|
tests/unit_tests/test_bec_dock.py,sha256=iZcyF6tjNHstFx0rtbI8zhvFvgQiOpb_CuOF-L6Dipc,5610
|
333
338
|
tests/unit_tests/test_bec_figure.py,sha256=oTlwHgDSrE4QRN3i9ZRM3QT2Xt8jfOyUTNxIZqZ4WKQ,9780
|
334
339
|
tests/unit_tests/test_bec_image.py,sha256=Bc9eaLDk_9MfVFC6BZ-dymf-bQZg_CHL810nssXsj_k,2814
|
@@ -348,7 +353,7 @@ tests/unit_tests/test_generate_plugin.py,sha256=9603ucZChM-pYpHadzsR94U1Zec1KZT3
|
|
348
353
|
tests/unit_tests/test_motor_map_widget.py,sha256=j3Vv_jNTsJTg6UgtwoxFp-Qwi_1blT9HK-USALPgxSI,7469
|
349
354
|
tests/unit_tests/test_plot_base.py,sha256=evejmkYBBAu9f5XoA4dpYGPRGR5lIc3JqN4UQdGRY3Q,4134
|
350
355
|
tests/unit_tests/test_plugin_utils.py,sha256=ayksWdrFY7kOiA0wVEjKFmFCF3UhH3lG8tzPVOpwysk,528
|
351
|
-
tests/unit_tests/test_positioner_box.py,sha256=
|
356
|
+
tests/unit_tests/test_positioner_box.py,sha256=EdWFmia64dw4BI1y4LwA09lRF6nfkn-IgfVUEZzcMsU,5011
|
352
357
|
tests/unit_tests/test_ring_progress_bar.py,sha256=Q-hbRPj44Oa3RLJayQGNUKTnsDllk6j4sJwyJdDudT4,12233
|
353
358
|
tests/unit_tests/test_rpc_register.py,sha256=hECjZEimd440mwRrO0rg7L3PKN7__3DgjmESN6wx3bo,1179
|
354
359
|
tests/unit_tests/test_rpc_server.py,sha256=MvstcvqUsnGAzUxw8Et1xXXikk_VIxFPwDZD0v1QGkg,1500
|
@@ -371,8 +376,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
371
376
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
372
377
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
373
378
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
374
|
-
bec_widgets-0.
|
375
|
-
bec_widgets-0.
|
376
|
-
bec_widgets-0.
|
377
|
-
bec_widgets-0.
|
378
|
-
bec_widgets-0.
|
379
|
+
bec_widgets-0.94.1.dist-info/METADATA,sha256=BmrzIa7-lpELNsnzboeX4nA6maDnRy0LI_Ab3FieNQE,1307
|
380
|
+
bec_widgets-0.94.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
381
|
+
bec_widgets-0.94.1.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
382
|
+
bec_widgets-0.94.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
383
|
+
bec_widgets-0.94.1.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -92,7 +92,9 @@ def test_dispatcher_2_cb_same_topic(bec_dispatcher_w_connector, qtbot, send_msg_
|
|
92
92
|
bec_dispatcher.connect_slot(cb1, "topic1")
|
93
93
|
bec_dispatcher.connect_slot(cb2, "topic1")
|
94
94
|
assert len(bec_dispatcher.client.connector._topics_cb) == 1
|
95
|
+
assert len(bec_dispatcher._slots) == 2
|
95
96
|
bec_dispatcher.disconnect_slot(cb1, "topic1")
|
97
|
+
assert len(bec_dispatcher._slots) == 1
|
96
98
|
|
97
99
|
send_msg_event.set()
|
98
100
|
qtbot.wait(10)
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|