bec-widgets 0.74.0__py3-none-any.whl → 0.75.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 +36 -32
- PKG-INFO +18 -20
- bec_widgets/cli/client.py +32 -0
- bec_widgets/utils/bec_designer.py +2 -2
- bec_widgets/utils/bec_dispatcher.py +0 -1
- bec_widgets/widgets/bec_queue/__init__.py +0 -0
- bec_widgets/widgets/bec_queue/bec_queue.py +111 -0
- bec_widgets/widgets/bec_queue/bec_queue.pyproject +1 -0
- bec_widgets/widgets/bec_queue/bec_queue_plugin.py +54 -0
- bec_widgets/widgets/bec_queue/register_bec_queue.py +15 -0
- bec_widgets/widgets/figure/plots/motor_map/motor_map.py +2 -0
- bec_widgets/widgets/ring_progress_bar/ring.py +6 -0
- {bec_widgets-0.74.0.dist-info → bec_widgets-0.75.0.dist-info}/METADATA +18 -20
- {bec_widgets-0.74.0.dist-info → bec_widgets-0.75.0.dist-info}/RECORD +20 -14
- pyproject.toml +18 -20
- tests/end-2-end/test_bec_figure_rpc_e2e.py +23 -0
- tests/unit_tests/test_bec_queue.py +111 -0
- {bec_widgets-0.74.0.dist-info → bec_widgets-0.75.0.dist-info}/WHEEL +0 -0
- {bec_widgets-0.74.0.dist-info → bec_widgets-0.75.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.74.0.dist-info → bec_widgets-0.75.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.75.0 (2024-06-26)
|
4
|
+
|
5
|
+
### Feature
|
6
|
+
|
7
|
+
* feat(widgets): added simple bec queue widget ([`3faee98`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3faee98ec80041a27e4c1f1156178de6f9dcdc63))
|
8
|
+
|
9
|
+
### Refactor
|
10
|
+
|
11
|
+
* refactor(dispatcher): cleanup ([`ca02132`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ca02132c8d18535b37e9192e00459d2aca6ba5cf))
|
12
|
+
|
13
|
+
## v0.74.1 (2024-06-26)
|
14
|
+
|
15
|
+
### Build
|
16
|
+
|
17
|
+
* build: added missing pytest-bec-e2e dependency; closes #219 ([`56fdae4`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/56fdae42757bdb9fa301c1e425a77e98b6eaf92b))
|
18
|
+
|
19
|
+
* build: fixed dependency ranges; closes #135 ([`e6a06c9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e6a06c9f43e0ad6bbfcfa550a2f580d2a27aff66))
|
20
|
+
|
21
|
+
### Chore
|
22
|
+
|
23
|
+
* chore: sorted dependencies alphabetically ([`21c807f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/21c807f35831fdd1ef2e488ab90edae4719f0cb7))
|
24
|
+
|
25
|
+
### Documentation
|
26
|
+
|
27
|
+
* docs: fixed doc string ([`f979a63`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f979a63d3d1a008f80e500510909750878ff4303))
|
28
|
+
|
29
|
+
### Fix
|
30
|
+
|
31
|
+
* fix(rings): rings properties updated right after setting ([`c8b7367`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c8b7367815b095f8e4aa8b819481efb701f2e542))
|
32
|
+
|
33
|
+
* fix(motor_map): motor map can be removed from BECFigure with .remove() ([`6b25abf`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6b25abff70280271e2eeb70450553c05d4b7c99c))
|
34
|
+
|
35
|
+
### Test
|
36
|
+
|
37
|
+
* test(bec_figure): tests for removing widgets with rpc e2e ([`a268caa`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a268caaa30711fcc7ece542d24578d74cbf65c77))
|
38
|
+
|
3
39
|
## v0.74.0 (2024-06-25)
|
4
40
|
|
5
41
|
### Documentation
|
@@ -115,35 +151,3 @@
|
|
115
151
|
* tests WIP ([`c09644b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c09644b29ddb291c91dc58bcd6ebf02ff45cab36))
|
116
152
|
|
117
153
|
## v0.70.0 (2024-06-21)
|
118
|
-
|
119
|
-
### Documentation
|
120
|
-
|
121
|
-
* docs: fix typo in link ([`fdf11d8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fdf11d8147750e379af9b17792761a267b49ae53))
|
122
|
-
|
123
|
-
### Feature
|
124
|
-
|
125
|
-
* feat(bec-designer): automatic plugin discovery ([`4639eee`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4639eee0b975ebd7a946e0e290449f5b88c372eb))
|
126
|
-
|
127
|
-
* feat(device_line_edit): plugin added to bec-designer ([`b4b27ae`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b4b27aea3d8c08fa3d5d5514c69dbde32721d1dc))
|
128
|
-
|
129
|
-
* feat(device_combobox): plugin added to bec-designer ([`e483b28`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e483b282db20a81182b87938ea172654092419b5))
|
130
|
-
|
131
|
-
* feat: added entry point for bec-designer ([`36391db`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/36391db60735d57b371211791ddf8d3d00cebcf1))
|
132
|
-
|
133
|
-
* feat(utils/bec-designer): added startup script to launched QtDesigner compatible with conda environments ([`5362334`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5362334ff3b07fc83653323a084a4b6946bade96))
|
134
|
-
|
135
|
-
### Fix
|
136
|
-
|
137
|
-
* fix(bec-desiger+plugins): imports fixed, PYSIDE6 check to not enable run plugins with pyqt6 ([`50b3422`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/50b3422528d46d74317e8c903b6286e868ab7fe0))
|
138
|
-
|
139
|
-
## v0.69.0 (2024-06-21)
|
140
|
-
|
141
|
-
### Feature
|
142
|
-
|
143
|
-
* feat(widgets): added vscode widget ([`48ae950`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/48ae950d57b454307ce409e2511f7b7adf3cfc6b))
|
144
|
-
|
145
|
-
### Fix
|
146
|
-
|
147
|
-
* fix(generate_cli): fixed rpc generate for classes without user access; closes #226 ([`925c893`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/925c893f3ff4337fc8b4d237c8ffc19a597b0996))
|
148
|
-
|
149
|
-
## v0.68.0 (2024-06-21)
|
PKG-INFO
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: bec_widgets
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.75.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
|
@@ -9,26 +9,24 @@ Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
10
10
|
Classifier: Topic :: Scientific/Engineering
|
11
11
|
Requires-Python: >=3.10
|
12
|
-
Requires-Dist: bec-ipython-client
|
13
|
-
Requires-Dist: bec-lib
|
14
|
-
Requires-Dist: black
|
15
|
-
Requires-Dist:
|
16
|
-
Requires-Dist:
|
17
|
-
Requires-Dist:
|
18
|
-
Requires-Dist:
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
21
|
-
Requires-Dist: qtconsole
|
22
|
-
Requires-Dist: qtpy
|
23
|
-
Requires-Dist: zmq
|
12
|
+
Requires-Dist: bec-ipython-client~=2.16
|
13
|
+
Requires-Dist: bec-lib~=2.16
|
14
|
+
Requires-Dist: black~=24.0
|
15
|
+
Requires-Dist: isort>=5.13.2,~=5.13
|
16
|
+
Requires-Dist: pydantic~=2.0
|
17
|
+
Requires-Dist: pyqtdarktheme~=2.1
|
18
|
+
Requires-Dist: pyqtgraph~=0.13
|
19
|
+
Requires-Dist: qtconsole>=5.5.1,~=5.5
|
20
|
+
Requires-Dist: qtpy~=2.4
|
24
21
|
Provides-Extra: dev
|
25
|
-
Requires-Dist: coverage; extra == 'dev'
|
26
|
-
Requires-Dist: fakeredis; extra == 'dev'
|
27
|
-
Requires-Dist: pytest; extra == 'dev'
|
28
|
-
Requires-Dist: pytest-qt; extra == 'dev'
|
29
|
-
Requires-Dist: pytest-random-order; extra == 'dev'
|
30
|
-
Requires-Dist: pytest-timeout; extra == 'dev'
|
31
|
-
Requires-Dist: pytest-xvfb; extra == 'dev'
|
22
|
+
Requires-Dist: coverage~=7.0; extra == 'dev'
|
23
|
+
Requires-Dist: fakeredis>=2.23.2,~=2.23; extra == 'dev'
|
24
|
+
Requires-Dist: pytest-bec-e2e~=2.16; extra == 'dev'
|
25
|
+
Requires-Dist: pytest-qt~=4.4; extra == 'dev'
|
26
|
+
Requires-Dist: pytest-random-order~=1.1; extra == 'dev'
|
27
|
+
Requires-Dist: pytest-timeout~=2.2; extra == 'dev'
|
28
|
+
Requires-Dist: pytest-xvfb~=3.0; extra == 'dev'
|
29
|
+
Requires-Dist: pytest~=8.0; extra == 'dev'
|
32
30
|
Provides-Extra: pyqt5
|
33
31
|
Requires-Dist: pyqt5>=5.9; extra == 'pyqt5'
|
34
32
|
Requires-Dist: pyqtwebengine>=5.9; extra == 'pyqt5'
|
bec_widgets/cli/client.py
CHANGED
@@ -13,6 +13,7 @@ class Widgets(str, enum.Enum):
|
|
13
13
|
Enum for the available widgets.
|
14
14
|
"""
|
15
15
|
|
16
|
+
BECQueue = "BECQueue"
|
16
17
|
BECStatusBox = "BECStatusBox"
|
17
18
|
BECDock = "BECDock"
|
18
19
|
BECDockArea = "BECDockArea"
|
@@ -1206,6 +1207,13 @@ class BECImageShow(RPCBase):
|
|
1206
1207
|
|
1207
1208
|
|
1208
1209
|
class BECMotorMap(RPCBase):
|
1210
|
+
@property
|
1211
|
+
@rpc_call
|
1212
|
+
def rpc_id(self) -> "str":
|
1213
|
+
"""
|
1214
|
+
Get the RPC ID of the widget.
|
1215
|
+
"""
|
1216
|
+
|
1209
1217
|
@property
|
1210
1218
|
@rpc_call
|
1211
1219
|
def config_dict(self) -> "dict":
|
@@ -1289,6 +1297,12 @@ class BECMotorMap(RPCBase):
|
|
1289
1297
|
dict: Data of the motor map.
|
1290
1298
|
"""
|
1291
1299
|
|
1300
|
+
@rpc_call
|
1301
|
+
def remove(self):
|
1302
|
+
"""
|
1303
|
+
Remove the plot widget from the figure.
|
1304
|
+
"""
|
1305
|
+
|
1292
1306
|
|
1293
1307
|
class BECPlotBase(RPCBase):
|
1294
1308
|
@property
|
@@ -1433,6 +1447,24 @@ class BECPlotBase(RPCBase):
|
|
1433
1447
|
"""
|
1434
1448
|
|
1435
1449
|
|
1450
|
+
class BECQueue(RPCBase):
|
1451
|
+
@property
|
1452
|
+
@rpc_call
|
1453
|
+
def config_dict(self) -> "dict":
|
1454
|
+
"""
|
1455
|
+
Get the configuration of the widget.
|
1456
|
+
|
1457
|
+
Returns:
|
1458
|
+
dict: The configuration of the widget.
|
1459
|
+
"""
|
1460
|
+
|
1461
|
+
@rpc_call
|
1462
|
+
def get_all_rpc(self) -> "dict":
|
1463
|
+
"""
|
1464
|
+
Get all registered RPC objects.
|
1465
|
+
"""
|
1466
|
+
|
1467
|
+
|
1436
1468
|
class BECStatusBox(RPCBase):
|
1437
1469
|
@property
|
1438
1470
|
@rpc_call
|
@@ -21,12 +21,12 @@ if PYSIDE6:
|
|
21
21
|
import bec_widgets
|
22
22
|
|
23
23
|
|
24
|
-
def list_editable_packages() ->
|
24
|
+
def list_editable_packages() -> set[str]:
|
25
25
|
"""
|
26
26
|
List all editable packages in the environment.
|
27
27
|
|
28
28
|
Returns:
|
29
|
-
|
29
|
+
set: A set of paths to editable packages.
|
30
30
|
"""
|
31
31
|
|
32
32
|
editable_packages = set()
|
File without changes
|
@@ -0,0 +1,111 @@
|
|
1
|
+
from bec_lib.endpoints import MessageEndpoints
|
2
|
+
from qtpy.QtCore import Qt, Slot
|
3
|
+
from qtpy.QtWidgets import QHeaderView, QTableWidget, QTableWidgetItem, QWidget
|
4
|
+
|
5
|
+
from bec_widgets.utils.bec_connector import BECConnector, ConnectionConfig
|
6
|
+
|
7
|
+
|
8
|
+
class BECQueue(BECConnector, QTableWidget):
|
9
|
+
"""
|
10
|
+
Widget to display the BEC queue.
|
11
|
+
"""
|
12
|
+
|
13
|
+
def __init__(
|
14
|
+
self,
|
15
|
+
parent: QWidget | None = None,
|
16
|
+
client=None,
|
17
|
+
config: ConnectionConfig = None,
|
18
|
+
gui_id: str = None,
|
19
|
+
):
|
20
|
+
super().__init__(client, config, gui_id)
|
21
|
+
QTableWidget.__init__(self, parent=parent)
|
22
|
+
self.setColumnCount(3)
|
23
|
+
self.setHorizontalHeaderLabels(["Scan Number", "Type", "Status"])
|
24
|
+
header = self.horizontalHeader()
|
25
|
+
header.setSectionResizeMode(QHeaderView.Stretch)
|
26
|
+
self.bec_dispatcher.connect_slot(self.update_queue, MessageEndpoints.scan_queue_status())
|
27
|
+
self.reset_content()
|
28
|
+
|
29
|
+
@Slot(dict, dict)
|
30
|
+
def update_queue(self, content, _metadata):
|
31
|
+
"""
|
32
|
+
Update the queue table with the latest queue information.
|
33
|
+
|
34
|
+
Args:
|
35
|
+
content (dict): The queue content.
|
36
|
+
_metadata (dict): The metadata.
|
37
|
+
"""
|
38
|
+
# only show the primary queue for now
|
39
|
+
queue_info = content.get("queue", {}).get("primary", {}).get("info", [])
|
40
|
+
self.setRowCount(len(queue_info))
|
41
|
+
self.clearContents()
|
42
|
+
|
43
|
+
if not queue_info:
|
44
|
+
self.reset_content()
|
45
|
+
return
|
46
|
+
|
47
|
+
for index, item in enumerate(queue_info):
|
48
|
+
blocks = item.get("request_blocks", [])
|
49
|
+
scan_types = []
|
50
|
+
scan_numbers = []
|
51
|
+
status = item.get("status", "")
|
52
|
+
for request_block in blocks:
|
53
|
+
scan_type = request_block.get("content", {}).get("scan_type", "")
|
54
|
+
if scan_type:
|
55
|
+
scan_types.append(scan_type)
|
56
|
+
scan_number = request_block.get("scan_number", "")
|
57
|
+
if scan_number:
|
58
|
+
scan_numbers.append(str(scan_number))
|
59
|
+
if scan_types:
|
60
|
+
scan_types = ", ".join(scan_types)
|
61
|
+
if scan_numbers:
|
62
|
+
scan_numbers = ", ".join(scan_numbers)
|
63
|
+
self.set_row(index, scan_numbers, scan_types, status)
|
64
|
+
|
65
|
+
def format_item(self, content: str) -> QTableWidgetItem:
|
66
|
+
"""
|
67
|
+
Format the content of the table item.
|
68
|
+
|
69
|
+
Args:
|
70
|
+
content (str): The content to be formatted.
|
71
|
+
|
72
|
+
Returns:
|
73
|
+
QTableWidgetItem: The formatted item.
|
74
|
+
"""
|
75
|
+
item = QTableWidgetItem(content)
|
76
|
+
item.setTextAlignment(Qt.AlignHCenter | Qt.AlignVCenter)
|
77
|
+
return item
|
78
|
+
|
79
|
+
def set_row(self, index: int, scan_number: str, scan_type: str, status: str):
|
80
|
+
"""
|
81
|
+
Set the row of the table.
|
82
|
+
|
83
|
+
Args:
|
84
|
+
index (int): The index of the row.
|
85
|
+
scan_number (str): The scan number.
|
86
|
+
scan_type (str): The scan type.
|
87
|
+
status (str): The status.
|
88
|
+
"""
|
89
|
+
|
90
|
+
self.setItem(index, 0, self.format_item(scan_number))
|
91
|
+
self.setItem(index, 1, self.format_item(scan_type))
|
92
|
+
self.setItem(index, 2, self.format_item(status))
|
93
|
+
|
94
|
+
def reset_content(self):
|
95
|
+
"""
|
96
|
+
Reset the content of the table.
|
97
|
+
"""
|
98
|
+
|
99
|
+
self.setRowCount(1)
|
100
|
+
self.set_row(0, "", "", "")
|
101
|
+
|
102
|
+
|
103
|
+
if __name__ == "__main__": # pragma: no cover
|
104
|
+
import sys
|
105
|
+
|
106
|
+
from qtpy.QtWidgets import QApplication
|
107
|
+
|
108
|
+
app = QApplication(sys.argv)
|
109
|
+
widget = BECQueue()
|
110
|
+
widget.show()
|
111
|
+
sys.exit(app.exec_())
|
@@ -0,0 +1 @@
|
|
1
|
+
{'files': ['bec_queue.py']}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# Copyright (C) 2022 The Qt Company Ltd.
|
2
|
+
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
3
|
+
|
4
|
+
from qtpy.QtDesigner import QDesignerCustomWidgetInterface
|
5
|
+
from qtpy.QtGui import QIcon
|
6
|
+
|
7
|
+
from bec_widgets.widgets.bec_queue.bec_queue import BECQueue
|
8
|
+
|
9
|
+
DOM_XML = """
|
10
|
+
<ui language='c++'>
|
11
|
+
<widget class='BECQueue' name='bec_queue'>
|
12
|
+
</widget>
|
13
|
+
</ui>
|
14
|
+
"""
|
15
|
+
|
16
|
+
|
17
|
+
class BECQueuePlugin(QDesignerCustomWidgetInterface): # pragma: no cover
|
18
|
+
def __init__(self):
|
19
|
+
super().__init__()
|
20
|
+
self._form_editor = None
|
21
|
+
|
22
|
+
def createWidget(self, parent):
|
23
|
+
t = BECQueue(parent)
|
24
|
+
return t
|
25
|
+
|
26
|
+
def domXml(self):
|
27
|
+
return DOM_XML
|
28
|
+
|
29
|
+
def group(self):
|
30
|
+
return ""
|
31
|
+
|
32
|
+
def icon(self):
|
33
|
+
return QIcon()
|
34
|
+
|
35
|
+
def includeFile(self):
|
36
|
+
return "bec_queue"
|
37
|
+
|
38
|
+
def initialize(self, form_editor):
|
39
|
+
self._form_editor = form_editor
|
40
|
+
|
41
|
+
def isContainer(self):
|
42
|
+
return False
|
43
|
+
|
44
|
+
def isInitialized(self):
|
45
|
+
return self._form_editor is not None
|
46
|
+
|
47
|
+
def name(self):
|
48
|
+
return "BECQueue"
|
49
|
+
|
50
|
+
def toolTip(self):
|
51
|
+
return "Widget to display the BEC queue."
|
52
|
+
|
53
|
+
def whatsThis(self):
|
54
|
+
return self.toolTip()
|
@@ -0,0 +1,15 @@
|
|
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.bec_queue.bec_queue_plugin import BECQueuePlugin
|
10
|
+
|
11
|
+
QPyDesignerCustomWidgetCollection.addCustomWidget(BECQueuePlugin())
|
12
|
+
|
13
|
+
|
14
|
+
if __name__ == "__main__": # pragma: no cover
|
15
|
+
main()
|
@@ -36,6 +36,7 @@ class MotorMapConfig(SubplotConfig):
|
|
36
36
|
|
37
37
|
class BECMotorMap(BECPlotBase):
|
38
38
|
USER_ACCESS = [
|
39
|
+
"rpc_id",
|
39
40
|
"config_dict",
|
40
41
|
"change_motors",
|
41
42
|
"set_max_points",
|
@@ -44,6 +45,7 @@ class BECMotorMap(BECPlotBase):
|
|
44
45
|
"set_background_value",
|
45
46
|
"set_scatter_size",
|
46
47
|
"get_data",
|
48
|
+
"remove",
|
47
49
|
]
|
48
50
|
|
49
51
|
# QT Signals
|
@@ -135,6 +135,7 @@ class Ring(BECConnector):
|
|
135
135
|
float(max(self.config.min_value, min(self.config.max_value, value))),
|
136
136
|
self.config.precision,
|
137
137
|
)
|
138
|
+
self.parent_progress_widget.update()
|
138
139
|
|
139
140
|
def set_color(self, color: str | tuple):
|
140
141
|
"""
|
@@ -145,6 +146,7 @@ class Ring(BECConnector):
|
|
145
146
|
"""
|
146
147
|
self.config.color = color
|
147
148
|
self.color = self.convert_color(color)
|
149
|
+
self.parent_progress_widget.update()
|
148
150
|
|
149
151
|
def set_background(self, color: str | tuple):
|
150
152
|
"""
|
@@ -155,6 +157,7 @@ class Ring(BECConnector):
|
|
155
157
|
"""
|
156
158
|
self.config.background_color = color
|
157
159
|
self.color = self.convert_color(color)
|
160
|
+
self.parent_progress_widget.update()
|
158
161
|
|
159
162
|
def set_line_width(self, width: int):
|
160
163
|
"""
|
@@ -164,6 +167,7 @@ class Ring(BECConnector):
|
|
164
167
|
width(int): Line width for the ring widget
|
165
168
|
"""
|
166
169
|
self.config.line_width = width
|
170
|
+
self.parent_progress_widget.update()
|
167
171
|
|
168
172
|
def set_min_max_values(self, min_value: int | float, max_value: int | float):
|
169
173
|
"""
|
@@ -175,6 +179,7 @@ class Ring(BECConnector):
|
|
175
179
|
"""
|
176
180
|
self.config.min_value = min_value
|
177
181
|
self.config.max_value = max_value
|
182
|
+
self.parent_progress_widget.update()
|
178
183
|
|
179
184
|
def set_start_angle(self, start_angle: int):
|
180
185
|
"""
|
@@ -185,6 +190,7 @@ class Ring(BECConnector):
|
|
185
190
|
"""
|
186
191
|
self.config.start_position = start_angle
|
187
192
|
self.start_position = start_angle * 16
|
193
|
+
self.parent_progress_widget.update()
|
188
194
|
|
189
195
|
@staticmethod
|
190
196
|
def convert_color(color):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: bec_widgets
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.75.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
|
@@ -9,26 +9,24 @@ Classifier: Development Status :: 3 - Alpha
|
|
9
9
|
Classifier: Programming Language :: Python :: 3
|
10
10
|
Classifier: Topic :: Scientific/Engineering
|
11
11
|
Requires-Python: >=3.10
|
12
|
-
Requires-Dist: bec-ipython-client
|
13
|
-
Requires-Dist: bec-lib
|
14
|
-
Requires-Dist: black
|
15
|
-
Requires-Dist:
|
16
|
-
Requires-Dist:
|
17
|
-
Requires-Dist:
|
18
|
-
Requires-Dist:
|
19
|
-
Requires-Dist:
|
20
|
-
Requires-Dist:
|
21
|
-
Requires-Dist: qtconsole
|
22
|
-
Requires-Dist: qtpy
|
23
|
-
Requires-Dist: zmq
|
12
|
+
Requires-Dist: bec-ipython-client~=2.16
|
13
|
+
Requires-Dist: bec-lib~=2.16
|
14
|
+
Requires-Dist: black~=24.0
|
15
|
+
Requires-Dist: isort>=5.13.2,~=5.13
|
16
|
+
Requires-Dist: pydantic~=2.0
|
17
|
+
Requires-Dist: pyqtdarktheme~=2.1
|
18
|
+
Requires-Dist: pyqtgraph~=0.13
|
19
|
+
Requires-Dist: qtconsole>=5.5.1,~=5.5
|
20
|
+
Requires-Dist: qtpy~=2.4
|
24
21
|
Provides-Extra: dev
|
25
|
-
Requires-Dist: coverage; extra == 'dev'
|
26
|
-
Requires-Dist: fakeredis; extra == 'dev'
|
27
|
-
Requires-Dist: pytest; extra == 'dev'
|
28
|
-
Requires-Dist: pytest-qt; extra == 'dev'
|
29
|
-
Requires-Dist: pytest-random-order; extra == 'dev'
|
30
|
-
Requires-Dist: pytest-timeout; extra == 'dev'
|
31
|
-
Requires-Dist: pytest-xvfb; extra == 'dev'
|
22
|
+
Requires-Dist: coverage~=7.0; extra == 'dev'
|
23
|
+
Requires-Dist: fakeredis>=2.23.2,~=2.23; extra == 'dev'
|
24
|
+
Requires-Dist: pytest-bec-e2e~=2.16; extra == 'dev'
|
25
|
+
Requires-Dist: pytest-qt~=4.4; extra == 'dev'
|
26
|
+
Requires-Dist: pytest-random-order~=1.1; extra == 'dev'
|
27
|
+
Requires-Dist: pytest-timeout~=2.2; extra == 'dev'
|
28
|
+
Requires-Dist: pytest-xvfb~=3.0; extra == 'dev'
|
29
|
+
Requires-Dist: pytest~=8.0; extra == 'dev'
|
32
30
|
Provides-Extra: pyqt5
|
33
31
|
Requires-Dist: pyqt5>=5.9; extra == 'pyqt5'
|
34
32
|
Requires-Dist: pyqtwebengine>=5.9; extra == 'pyqt5'
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=RnYDz4zKXjlqltTryprlB1s5vLXxI2-seW-Vb70NNF0,8162
|
3
3
|
.pylintrc,sha256=OstrgmEyP0smNFBKoIN5_26-UmNZgMHnbjvAWX0UrLs,18535
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=sx0VgXjuW4b9kl-0R2dYbUIrICL3FUW9YLiHZndxdwQ,6864
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=LLUv5zSlJNd63QCDdWN-5IkzTXbvmzwvRWtafsg6Pcg,1407
|
8
8
|
README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=cipdKD-cFlub0rDkpT02AeG99qLXGJXtbRJ84v0r3Fg,2344
|
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
|
@@ -17,7 +17,7 @@ bec_widgets/assets/bec_widgets_icon.png,sha256=K8dgGwIjalDh9PRHUsSQBqgdX7a00nM3i
|
|
17
17
|
bec_widgets/assets/terminal_icon.png,sha256=bJl7Tft4Fi2uxvuXI8o14uMHnI9eAWKSU2uftXCH9ws,3889
|
18
18
|
bec_widgets/cli/__init__.py,sha256=d0Q6Fn44e7wFfLabDOBxpcJ1DPKWlFunGYDUBmO-4hA,22
|
19
19
|
bec_widgets/cli/auto_updates.py,sha256=DyBV3HnjMSH-cvVkYNcDiYKVf0Xut4Qy2qGQqkW47Bw,4833
|
20
|
-
bec_widgets/cli/client.py,sha256=
|
20
|
+
bec_widgets/cli/client.py,sha256=754vTVMVLkdpGa5wsH2wGP0fJW59wRubt6HOB8AG7_w,61582
|
21
21
|
bec_widgets/cli/client_utils.py,sha256=zq1gPW7t4n9Nsn4MLkdUeKwwl-9nUcf5UjuN8lZr9iY,12281
|
22
22
|
bec_widgets/cli/generate_cli.py,sha256=InKBVYM7DRfAVLNJhRJbWWSSPBQBHI8Ek6v7NCsK0ME,4997
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
@@ -39,8 +39,8 @@ bec_widgets/examples/plugin_example_pyside/tictactoeplugin.py,sha256=BBt3MD8oDLU
|
|
39
39
|
bec_widgets/examples/plugin_example_pyside/tictactoetaskmenu.py,sha256=LNwplI6deUdKY6FOhUuWBanotxk9asF2G-6k7lFfA8Y,2301
|
40
40
|
bec_widgets/utils/__init__.py,sha256=1930ji1Jj6dVuY81Wd2kYBhHYNV-2R0bN_L4o9zBj1U,533
|
41
41
|
bec_widgets/utils/bec_connector.py,sha256=t59482Tu30eiQ2YNHJZFEE-wQFt4qf85OmBfPkl-3N4,7335
|
42
|
-
bec_widgets/utils/bec_designer.py,sha256=
|
43
|
-
bec_widgets/utils/bec_dispatcher.py,sha256=
|
42
|
+
bec_widgets/utils/bec_designer.py,sha256=Q5qhdB7Jiw768dzlJ9bNxLrCbDKw4qNmhbO-9zLTVpw,4318
|
43
|
+
bec_widgets/utils/bec_dispatcher.py,sha256=QZjRKNrZ181yt_6nLJCfdNk5EyeaGImApNA1FWR4rqo,6186
|
44
44
|
bec_widgets/utils/bec_table.py,sha256=nA2b8ukSeUfquFMAxGrUVOqdrzMoDYD6O_4EYbOG2zk,717
|
45
45
|
bec_widgets/utils/colors.py,sha256=GYSDe0ZxsJSwxvuy-yG2BH17qlf_Sjq8dhDcyp9IhBI,8532
|
46
46
|
bec_widgets/utils/container_utils.py,sha256=m3VUyAYmSWkEwApP9tBvKxPYVtc2kHw4toxIpMryJy4,1495
|
@@ -55,6 +55,11 @@ bec_widgets/utils/validator_delegate.py,sha256=Emj1WF6W8Ke1ruBWUfmHdVJpmOSPezuOt
|
|
55
55
|
bec_widgets/utils/widget_io.py,sha256=U_02ESf9Ukz63B01AzYioNepSc6SX11nJhPPSDmL4IA,11318
|
56
56
|
bec_widgets/utils/yaml_dialog.py,sha256=cMVif-39SB9WjwGH5FWBJcFs4tnfFJFs5cacydRyhy0,1853
|
57
57
|
bec_widgets/widgets/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
58
|
+
bec_widgets/widgets/bec_queue/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
59
|
+
bec_widgets/widgets/bec_queue/bec_queue.py,sha256=voIsj599a5t-u-H15tpSqjGBmy5ra6LsHpZnqEZFrI8,3551
|
60
|
+
bec_widgets/widgets/bec_queue/bec_queue.pyproject,sha256=VhoNmAv1DQUl9dg7dELyf5i4pZ5k65N3GnqOYiSwbQo,27
|
61
|
+
bec_widgets/widgets/bec_queue/bec_queue_plugin.py,sha256=hDJm8Zd_GIDw2R8VYn4ytwrHVCmJUjC9dGDMae2omU0,1175
|
62
|
+
bec_widgets/widgets/bec_queue/register_bec_queue.py,sha256=XnwtUSa1asK1b80knKWodcyX9qJy4DnKsQL_FoDfZy4,463
|
58
63
|
bec_widgets/widgets/bec_status_box/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
59
64
|
bec_widgets/widgets/bec_status_box/bec_status_box.py,sha256=twWugYlGVSl9ziSbjeB75BZwuruXFszRoOlN0d79Gnk,14523
|
60
65
|
bec_widgets/widgets/bec_status_box/status_item.py,sha256=wPkDm0GCGNXXpy3rR_Ljaxy0ZHeiiYcrWFqEntZnz4E,5869
|
@@ -87,7 +92,7 @@ bec_widgets/widgets/figure/plots/image/image.py,sha256=1tZADgGQXDrFHS9CYsHD2r9Kz
|
|
87
92
|
bec_widgets/widgets/figure/plots/image/image_item.py,sha256=Wnq6N6q4QwGHdZzZ_ibYzqoJk68FKU6WUCcYpINhZMU,10513
|
88
93
|
bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejMwPGQgM-o3d6bmLglCjdoktu19xfA,5262
|
89
94
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
90
|
-
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=
|
95
|
+
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=xFjAHXJg5AOm4XTLE0yWhsls1NnWOulIsx4aPip136k,15303
|
91
96
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
92
97
|
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=j_Lb3ovxKzNKgssNTR9HJ-L4MP-SmesRcdyxIcbqnO0,29101
|
93
98
|
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=mSBzqQNpLhol1_2_9k7s2b-Y0ICGU242T39md0LxTSA,8291
|
@@ -108,7 +113,7 @@ bec_widgets/widgets/motor_control/selection/__init__.py,sha256=47DEQpj8HBSa-_TIm
|
|
108
113
|
bec_widgets/widgets/motor_control/selection/selection.py,sha256=WNHndvv4JvxeAMnDFBMTvUILcn9u_0mWGRsgNiBZEsM,3988
|
109
114
|
bec_widgets/widgets/motor_control/selection/selection.ui,sha256=vXXpvNWuL6xyHhW7Lx1zmVFX-95Z5AXGlhKQD2HmM1A,1779
|
110
115
|
bec_widgets/widgets/ring_progress_bar/__init__.py,sha256=_uoJKnDM2YAeUBfwc5WLbIHSJj7zm_FAurSKP3WRaCw,47
|
111
|
-
bec_widgets/widgets/ring_progress_bar/ring.py,sha256=
|
116
|
+
bec_widgets/widgets/ring_progress_bar/ring.py,sha256=3XwvM5cymCxffOYEjaDTqfqpNLjEunHTyZCBxz0cvmc,11238
|
112
117
|
bec_widgets/widgets/ring_progress_bar/ring_progress_bar.py,sha256=jc-2VtFBASzA15M8S2ZNAvu0Z7RFp130jHz7HpLyIRs,24068
|
113
118
|
bec_widgets/widgets/scan_control/__init__.py,sha256=IOfHl15vxb_uC6KN62-PeUzbBha_vQyqkkXbJ2HU674,38
|
114
119
|
bec_widgets/widgets/scan_control/scan_control.py,sha256=u2fjSUiSRYTkIq9WhdfQuQV6Sv3iWWcSfCraVGro1RQ,7686
|
@@ -173,7 +178,7 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
173
178
|
tests/end-2-end/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
174
179
|
tests/end-2-end/conftest.py,sha256=-BLnFE-NeCerf6xahGCkbZ4Ktactowi6RkBnboIzRvg,1767
|
175
180
|
tests/end-2-end/test_bec_dock_rpc_e2e.py,sha256=59nrcbEB0NK7ttXdOizN9kjUaqhMImVGaf4aciT4Jcs,9099
|
176
|
-
tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=
|
181
|
+
tests/end-2-end/test_bec_figure_rpc_e2e.py,sha256=QJl1-b8QRRIjnj6nd2yH0EivK6dt4gqrF0U9E4weHz4,6594
|
177
182
|
tests/end-2-end/test_rpc_register_e2e.py,sha256=3dfCnSvdcRO92pzHt9WlCTK0vzTKAvPtliEoEKrtuzQ,1604
|
178
183
|
tests/end-2-end/test_scan_control_e2e.py,sha256=u7oLgFyltkMW2apSZKDukMIXvYrbhHrU32p4mBdn8VE,2276
|
179
184
|
tests/unit_tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -185,6 +190,7 @@ tests/unit_tests/test_bec_dock.py,sha256=BXKXpuyIYj-l6KSyhQtM_p3kRFCRECIoXLzvkcJ
|
|
185
190
|
tests/unit_tests/test_bec_figure.py,sha256=aEd2R8K6fU2ON8QvPemGWpql_LaaYLipRlvnjBY2qFA,8009
|
186
191
|
tests/unit_tests/test_bec_image.py,sha256=mjvcrHgOF_FCj6WbUyxvZH9HL63QGA5C0PNZ5dXYn50,2541
|
187
192
|
tests/unit_tests/test_bec_motor_map.py,sha256=AfD_9-x6VV3TPnkQgNfFYRndPHDsGx-a_YknFeDr6hc,4588
|
193
|
+
tests/unit_tests/test_bec_queue.py,sha256=u-uc-iZeGAS8P90o6Cxy5oz_60zHpirGAu04OgQPDXw,4598
|
188
194
|
tests/unit_tests/test_bec_status_box.py,sha256=xR8c-hXFI9gKpNGhnnC5l_nzazfvPkWkhcAfJ77hxqY,4731
|
189
195
|
tests/unit_tests/test_client_utils.py,sha256=eViJ1Tz-HX9TkMvQH6W8cO-c3_1I8bUc4_Yen6LOc0E,830
|
190
196
|
tests/unit_tests/test_color_validation.py,sha256=csdvVKAohENZIRY-JQ97Hv-TShb1erj4oKMX7QRwo78,1883
|
@@ -212,8 +218,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
212
218
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
213
219
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
214
220
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
215
|
-
bec_widgets-0.
|
216
|
-
bec_widgets-0.
|
217
|
-
bec_widgets-0.
|
218
|
-
bec_widgets-0.
|
219
|
-
bec_widgets-0.
|
221
|
+
bec_widgets-0.75.0.dist-info/METADATA,sha256=LLUv5zSlJNd63QCDdWN-5IkzTXbvmzwvRWtafsg6Pcg,1407
|
222
|
+
bec_widgets-0.75.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
223
|
+
bec_widgets-0.75.0.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
224
|
+
bec_widgets-0.75.0.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
225
|
+
bec_widgets-0.75.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.
|
7
|
+
version = "0.75.0"
|
8
8
|
description = "BEC Widgets"
|
9
9
|
requires-python = ">=3.10"
|
10
10
|
classifiers = [
|
@@ -13,30 +13,28 @@ classifiers = [
|
|
13
13
|
"Topic :: Scientific/Engineering",
|
14
14
|
]
|
15
15
|
dependencies = [
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"pyqtdarktheme",
|
26
|
-
"black", # needed for bw-generate-cli
|
27
|
-
"isort", # needed for bw-generate-cli
|
16
|
+
"bec_ipython_client~=2.16", # needed for jupyter console
|
17
|
+
"bec_lib~=2.16",
|
18
|
+
"black~=24.0", # needed for bw-generate-cli
|
19
|
+
"isort~=5.13, >=5.13.2", # needed for bw-generate-cli
|
20
|
+
"pydantic~=2.0",
|
21
|
+
"pyqtgraph~=0.13",
|
22
|
+
"pyqtdarktheme~=2.1",
|
23
|
+
"qtconsole~=5.5, >=5.5.1", # needed for jupyter console
|
24
|
+
"qtpy~=2.4",
|
28
25
|
]
|
29
26
|
|
30
27
|
|
31
28
|
[project.optional-dependencies]
|
32
29
|
dev = [
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"pytest-
|
36
|
-
"pytest-
|
37
|
-
"
|
38
|
-
"pytest-
|
39
|
-
"
|
30
|
+
"coverage~=7.0",
|
31
|
+
"fakeredis~=2.23, >=2.23.2",
|
32
|
+
"pytest-bec-e2e~=2.16",
|
33
|
+
"pytest-qt~=4.4",
|
34
|
+
"pytest-random-order~=1.1",
|
35
|
+
"pytest-timeout~=2.2",
|
36
|
+
"pytest-xvfb~=3.0",
|
37
|
+
"pytest~=8.0",
|
40
38
|
]
|
41
39
|
pyqt5 = ["PyQt5>=5.9", "PyQtWebEngine>=5.9"]
|
42
40
|
pyqt6 = ["PyQt6>=6.7", "PyQt6-WebEngine>=6.7"]
|
@@ -185,3 +185,26 @@ def test_dap_rpc(rpc_server_figure, bec_client_lib):
|
|
185
185
|
print(fit_params)
|
186
186
|
|
187
187
|
assert np.isclose(fit_params["center"], 5, atol=0.5)
|
188
|
+
|
189
|
+
|
190
|
+
def test_removing_subplots(rpc_server_figure, bec_client_lib):
|
191
|
+
fig = BECFigure(rpc_server_figure)
|
192
|
+
plt = fig.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
|
193
|
+
im = fig.image(monitor="eiger")
|
194
|
+
mm = fig.motor_map(motor_x="samx", motor_y="samy")
|
195
|
+
|
196
|
+
assert len(fig.widget_list) == 3
|
197
|
+
|
198
|
+
# removing curves
|
199
|
+
assert len(plt.curves) == 2
|
200
|
+
plt.curves[0].remove()
|
201
|
+
assert len(plt.curves) == 1
|
202
|
+
plt.remove_curve("bpm4i-bpm4i")
|
203
|
+
assert len(plt.curves) == 0
|
204
|
+
|
205
|
+
# removing all subplots from figure
|
206
|
+
plt.remove()
|
207
|
+
im.remove()
|
208
|
+
mm.remove()
|
209
|
+
|
210
|
+
assert len(fig.widget_list) == 0
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import pytest
|
2
|
+
from bec_lib import messages
|
3
|
+
|
4
|
+
from bec_widgets.widgets.bec_queue.bec_queue import BECQueue
|
5
|
+
|
6
|
+
from .client_mocks import mocked_client
|
7
|
+
|
8
|
+
|
9
|
+
@pytest.fixture
|
10
|
+
def bec_queue_msg_full():
|
11
|
+
content = {
|
12
|
+
"primary": {
|
13
|
+
"info": [
|
14
|
+
{
|
15
|
+
"active_request_block": None,
|
16
|
+
"is_scan": [True],
|
17
|
+
"queue_id": "600163fc-5e56-4901-af25-14e9ee76817c",
|
18
|
+
"request_blocks": [
|
19
|
+
{
|
20
|
+
"RID": "89a76021-28c0-4297-828e-74ae40b941e5",
|
21
|
+
"content": {
|
22
|
+
"parameter": {
|
23
|
+
"args": {"samx": [-0.1, 0.1]},
|
24
|
+
"kwargs": {
|
25
|
+
"exp_time": 0.5,
|
26
|
+
"relative": True,
|
27
|
+
"steps": 20,
|
28
|
+
"system_config": {
|
29
|
+
"file_directory": None,
|
30
|
+
"file_suffix": None,
|
31
|
+
},
|
32
|
+
},
|
33
|
+
},
|
34
|
+
"queue": "primary",
|
35
|
+
"scan_type": "line_scan",
|
36
|
+
},
|
37
|
+
"is_scan": True,
|
38
|
+
"metadata": {
|
39
|
+
"RID": "89a76021-28c0-4297-828e-74ae40b941e5",
|
40
|
+
"file_directory": None,
|
41
|
+
"file_suffix": None,
|
42
|
+
"user_metadata": {"sample_name": "testA"},
|
43
|
+
},
|
44
|
+
"msg": messages.ScanQueueMessage(
|
45
|
+
metadata={
|
46
|
+
"file_suffix": None,
|
47
|
+
"file_directory": None,
|
48
|
+
"user_metadata": {"sample_name": "testA"},
|
49
|
+
"RID": "89a76021-28c0-4297-828e-74ae40b941e5",
|
50
|
+
},
|
51
|
+
scan_type="line_scan",
|
52
|
+
parameter={
|
53
|
+
"args": {"samx": [-0.1, 0.1]},
|
54
|
+
"kwargs": {
|
55
|
+
"steps": 20,
|
56
|
+
"exp_time": 0.5,
|
57
|
+
"relative": True,
|
58
|
+
"system_config": {
|
59
|
+
"file_suffix": None,
|
60
|
+
"file_directory": None,
|
61
|
+
},
|
62
|
+
},
|
63
|
+
},
|
64
|
+
queue="primary",
|
65
|
+
),
|
66
|
+
"readout_priority": {
|
67
|
+
"async": [],
|
68
|
+
"baseline": [],
|
69
|
+
"monitored": ["samx"],
|
70
|
+
"on_request": [],
|
71
|
+
},
|
72
|
+
"report_instructions": [{"scan_progress": 20}],
|
73
|
+
"scan_id": "2d704cc3-c172-404c-866d-608ce09fce40",
|
74
|
+
"scan_motors": ["samx"],
|
75
|
+
"scan_number": 1289,
|
76
|
+
}
|
77
|
+
],
|
78
|
+
"scan_id": ["2d704cc3-c172-404c-866d-608ce09fce40"],
|
79
|
+
"scan_number": [1289],
|
80
|
+
"status": "COMPLETED",
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"status": "RUNNING",
|
84
|
+
}
|
85
|
+
}
|
86
|
+
msg = messages.ScanQueueStatusMessage(metadata={}, queue=content)
|
87
|
+
return msg
|
88
|
+
|
89
|
+
|
90
|
+
@pytest.fixture
|
91
|
+
def bec_queue(qtbot, mocked_client):
|
92
|
+
widget = BECQueue(client=mocked_client)
|
93
|
+
qtbot.addWidget(widget)
|
94
|
+
qtbot.waitExposed(widget)
|
95
|
+
yield widget
|
96
|
+
|
97
|
+
|
98
|
+
def test_bec_queue(bec_queue, bec_queue_msg_full):
|
99
|
+
bec_queue.update_queue(bec_queue_msg_full.content, {})
|
100
|
+
assert bec_queue.rowCount() == 1
|
101
|
+
assert bec_queue.item(0, 0).text() == "1289"
|
102
|
+
assert bec_queue.item(0, 1).text() == "line_scan"
|
103
|
+
assert bec_queue.item(0, 2).text() == "COMPLETED"
|
104
|
+
|
105
|
+
|
106
|
+
def test_bec_queue_empty(bec_queue):
|
107
|
+
bec_queue.update_queue({}, {})
|
108
|
+
assert bec_queue.rowCount() == 1
|
109
|
+
assert bec_queue.item(0, 0).text() == ""
|
110
|
+
assert bec_queue.item(0, 1).text() == ""
|
111
|
+
assert bec_queue.item(0, 2).text() == ""
|
File without changes
|
File without changes
|
File without changes
|