bec-widgets 0.57.5__py3-none-any.whl → 0.57.6__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 +7 -7
- PKG-INFO +1 -1
- bec_widgets/cli/client.py +31 -8
- bec_widgets/widgets/spiral_progress_bar/ring.py +72 -1
- bec_widgets/widgets/spiral_progress_bar/spiral_progress_bar.py +22 -0
- {bec_widgets-0.57.5.dist-info → bec_widgets-0.57.6.dist-info}/METADATA +1 -1
- {bec_widgets-0.57.5.dist-info → bec_widgets-0.57.6.dist-info}/RECORD +10 -10
- pyproject.toml +1 -1
- {bec_widgets-0.57.5.dist-info → bec_widgets-0.57.6.dist-info}/WHEEL +0 -0
- {bec_widgets-0.57.5.dist-info → bec_widgets-0.57.6.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## v0.57.6 (2024-06-06)
|
6
|
+
|
7
|
+
### Fix
|
8
|
+
|
9
|
+
* fix(bar): docstrings extended ([`edb1775`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/edb1775967c3ff0723d0edad2b764f1ffc832b7c))
|
10
|
+
|
11
|
+
|
5
12
|
## v0.57.5 (2024-06-06)
|
6
13
|
|
7
14
|
### Documentation
|
@@ -145,15 +152,8 @@
|
|
145
152
|
|
146
153
|
* docs(examples): example apps section deleted ([`ad208a5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ad208a5ef8495c45a8b83a4850ba9a1041b42717))
|
147
154
|
|
148
|
-
### Feature
|
149
|
-
|
150
|
-
* feat(utils/ui_loader): universal ui loader for pyside/pyqt ([`0fea8d6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0fea8d606574fa99dda3b117da5d5209c251f694))
|
151
|
-
|
152
155
|
### Fix
|
153
156
|
|
154
157
|
* fix(examples): outdated examples removed (mca_plot.py, stream_plot.py, motor_example.py) ([`ddc9510`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ddc9510c2ba8dadf291809eeb5b135a105259492))
|
155
158
|
|
156
159
|
* fix: compatibility adjustment to .ui loading and tests for PySide6 ([`07b99d9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/07b99d91a57a645cddd76294f48d78773e4c9ea5))
|
157
|
-
|
158
|
-
|
159
|
-
## v0.55.0 (2024-05-24)
|
PKG-INFO
CHANGED
bec_widgets/cli/client.py
CHANGED
@@ -1861,43 +1861,66 @@ class Ring(RPCBase):
|
|
1861
1861
|
@rpc_call
|
1862
1862
|
def set_value(self, value: "int | float"):
|
1863
1863
|
"""
|
1864
|
-
|
1864
|
+
Set the value for the ring widget
|
1865
|
+
|
1866
|
+
Args:
|
1867
|
+
value(int | float): Value for the ring widget
|
1865
1868
|
"""
|
1866
1869
|
|
1867
1870
|
@rpc_call
|
1868
1871
|
def set_color(self, color: "str | tuple"):
|
1869
1872
|
"""
|
1870
|
-
|
1873
|
+
Set the color for the ring widget
|
1874
|
+
|
1875
|
+
Args:
|
1876
|
+
color(str | tuple): Color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
1871
1877
|
"""
|
1872
1878
|
|
1873
1879
|
@rpc_call
|
1874
1880
|
def set_background(self, color: "str | tuple"):
|
1875
1881
|
"""
|
1876
|
-
|
1882
|
+
Set the background color for the ring widget
|
1883
|
+
|
1884
|
+
Args:
|
1885
|
+
color(str | tuple): Background color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
1877
1886
|
"""
|
1878
1887
|
|
1879
1888
|
@rpc_call
|
1880
1889
|
def set_line_width(self, width: "int"):
|
1881
1890
|
"""
|
1882
|
-
|
1891
|
+
Set the line width for the ring widget
|
1892
|
+
|
1893
|
+
Args:
|
1894
|
+
width(int): Line width for the ring widget
|
1883
1895
|
"""
|
1884
1896
|
|
1885
1897
|
@rpc_call
|
1886
1898
|
def set_min_max_values(self, min_value: "int | float", max_value: "int | float"):
|
1887
1899
|
"""
|
1888
|
-
|
1900
|
+
Set the min and max values for the ring widget.
|
1901
|
+
|
1902
|
+
Args:
|
1903
|
+
min_value(int | float): Minimum value for the ring widget
|
1904
|
+
max_value(int | float): Maximum value for the ring widget
|
1889
1905
|
"""
|
1890
1906
|
|
1891
1907
|
@rpc_call
|
1892
1908
|
def set_start_angle(self, start_angle: "int"):
|
1893
1909
|
"""
|
1894
|
-
|
1910
|
+
Set the start angle for the ring widget
|
1911
|
+
|
1912
|
+
Args:
|
1913
|
+
start_angle(int): Start angle for the ring widget in degrees
|
1895
1914
|
"""
|
1896
1915
|
|
1897
1916
|
@rpc_call
|
1898
1917
|
def set_update(self, mode: "Literal['manual', 'scan', 'device']", device: "str" = None):
|
1899
1918
|
"""
|
1900
|
-
Set the update mode for the ring widget
|
1919
|
+
Set the update mode for the ring widget.
|
1920
|
+
Modes:
|
1921
|
+
- "manual": Manual update mode, the value is set by the user.
|
1922
|
+
- "scan": Update mode for the scan progress. The value is updated by the current scan progress.
|
1923
|
+
- "device": Update mode for the device readback. The value is updated by the device readback. Take into account that user has to set the device name and limits.
|
1901
1924
|
|
1902
1925
|
Args:
|
1903
1926
|
mode(str): Update mode for the ring widget. Can be "manual", "scan" or "device"
|
@@ -1907,5 +1930,5 @@ class Ring(RPCBase):
|
|
1907
1930
|
@rpc_call
|
1908
1931
|
def reset_connection(self):
|
1909
1932
|
"""
|
1910
|
-
|
1933
|
+
Reset the connections for the ring widget. Disconnect the current slot and endpoint.
|
1911
1934
|
"""
|
@@ -114,32 +114,75 @@ class Ring(BECConnector):
|
|
114
114
|
self.set_connections(self.config.connections.slot, self.config.connections.endpoint)
|
115
115
|
|
116
116
|
def set_value(self, value: int | float):
|
117
|
+
"""
|
118
|
+
Set the value for the ring widget
|
119
|
+
|
120
|
+
Args:
|
121
|
+
value(int | float): Value for the ring widget
|
122
|
+
"""
|
117
123
|
self.config.value = round(
|
118
124
|
float(max(self.config.min_value, min(self.config.max_value, value))),
|
119
125
|
self.config.precision,
|
120
126
|
)
|
121
127
|
|
122
128
|
def set_color(self, color: str | tuple):
|
129
|
+
"""
|
130
|
+
Set the color for the ring widget
|
131
|
+
|
132
|
+
Args:
|
133
|
+
color(str | tuple): Color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
134
|
+
"""
|
123
135
|
self.config.color = color
|
124
136
|
self.color = self.convert_color(color)
|
125
137
|
|
126
138
|
def set_background(self, color: str | tuple):
|
139
|
+
"""
|
140
|
+
Set the background color for the ring widget
|
141
|
+
|
142
|
+
Args:
|
143
|
+
color(str | tuple): Background color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
144
|
+
"""
|
127
145
|
self.config.background_color = color
|
128
146
|
self.color = self.convert_color(color)
|
129
147
|
|
130
148
|
def set_line_width(self, width: int):
|
149
|
+
"""
|
150
|
+
Set the line width for the ring widget
|
151
|
+
|
152
|
+
Args:
|
153
|
+
width(int): Line width for the ring widget
|
154
|
+
"""
|
131
155
|
self.config.line_width = width
|
132
156
|
|
133
157
|
def set_min_max_values(self, min_value: int | float, max_value: int | float):
|
158
|
+
"""
|
159
|
+
Set the min and max values for the ring widget.
|
160
|
+
|
161
|
+
Args:
|
162
|
+
min_value(int | float): Minimum value for the ring widget
|
163
|
+
max_value(int | float): Maximum value for the ring widget
|
164
|
+
"""
|
134
165
|
self.config.min_value = min_value
|
135
166
|
self.config.max_value = max_value
|
136
167
|
|
137
168
|
def set_start_angle(self, start_angle: int):
|
169
|
+
"""
|
170
|
+
Set the start angle for the ring widget
|
171
|
+
|
172
|
+
Args:
|
173
|
+
start_angle(int): Start angle for the ring widget in degrees
|
174
|
+
"""
|
138
175
|
self.config.start_position = start_angle
|
139
176
|
self.start_position = start_angle * 16
|
140
177
|
|
141
178
|
@staticmethod
|
142
179
|
def convert_color(color):
|
180
|
+
"""
|
181
|
+
Convert the color to QColor
|
182
|
+
|
183
|
+
Args:
|
184
|
+
color(str | tuple): Color for the ring widget. Can be HEX code or tuple (R, G, B, A).
|
185
|
+
"""
|
143
186
|
converted_color = None
|
144
187
|
if isinstance(color, str):
|
145
188
|
converted_color = QtGui.QColor(color)
|
@@ -149,7 +192,11 @@ class Ring(BECConnector):
|
|
149
192
|
|
150
193
|
def set_update(self, mode: Literal["manual", "scan", "device"], device: str = None):
|
151
194
|
"""
|
152
|
-
Set the update mode for the ring widget
|
195
|
+
Set the update mode for the ring widget.
|
196
|
+
Modes:
|
197
|
+
- "manual": Manual update mode, the value is set by the user.
|
198
|
+
- "scan": Update mode for the scan progress. The value is updated by the current scan progress.
|
199
|
+
- "device": Update mode for the device readback. The value is updated by the device readback. Take into account that user has to set the device name and limits.
|
153
200
|
|
154
201
|
Args:
|
155
202
|
mode(str): Update mode for the ring widget. Can be "manual", "scan" or "device"
|
@@ -169,6 +216,13 @@ class Ring(BECConnector):
|
|
169
216
|
self.parent_progress_widget.enable_auto_updates(False)
|
170
217
|
|
171
218
|
def set_connections(self, slot: str, endpoint: str | EndpointInfo):
|
219
|
+
"""
|
220
|
+
Set the connections for the ring widget
|
221
|
+
|
222
|
+
Args:
|
223
|
+
slot(str): Slot for the ring widget update. Can be "on_scan_progress" or "on_device_readback".
|
224
|
+
endpoint(str | EndpointInfo): Endpoint for the ring widget update. Endpoint has to match the slot type.
|
225
|
+
"""
|
172
226
|
if self.config.connections.endpoint == endpoint and self.config.connections.slot == slot:
|
173
227
|
return
|
174
228
|
else:
|
@@ -179,12 +233,22 @@ class Ring(BECConnector):
|
|
179
233
|
self.bec_dispatcher.connect_slot(getattr(self, slot), endpoint)
|
180
234
|
|
181
235
|
def reset_connection(self):
|
236
|
+
"""
|
237
|
+
Reset the connections for the ring widget. Disconnect the current slot and endpoint.
|
238
|
+
"""
|
182
239
|
self.bec_dispatcher.disconnect_slot(
|
183
240
|
self.config.connections.slot, self.config.connections.endpoint
|
184
241
|
)
|
185
242
|
self.config.connections = RingConnections()
|
186
243
|
|
187
244
|
def on_scan_progress(self, msg, meta):
|
245
|
+
"""
|
246
|
+
Update the ring widget with the scan progress.
|
247
|
+
|
248
|
+
Args:
|
249
|
+
msg(dict): Message with the scan progress
|
250
|
+
meta(dict): Metadata for the message
|
251
|
+
"""
|
188
252
|
current_RID = meta.get("RID", None)
|
189
253
|
if current_RID != self.RID:
|
190
254
|
self.set_min_max_values(0, msg.get("max_value", 100))
|
@@ -192,6 +256,13 @@ class Ring(BECConnector):
|
|
192
256
|
self.parent_progress_widget.update()
|
193
257
|
|
194
258
|
def on_device_readback(self, msg, meta):
|
259
|
+
"""
|
260
|
+
Update the ring widget with the device readback.
|
261
|
+
|
262
|
+
Args:
|
263
|
+
msg(dict): Message with the device readback
|
264
|
+
meta(dict): Metadata for the message
|
265
|
+
"""
|
195
266
|
if isinstance(self.config.connections.endpoint, EndpointInfo):
|
196
267
|
endpoint = self.config.connections.endpoint.endpoint
|
197
268
|
else:
|
@@ -464,6 +464,13 @@ class SpiralProgressBar(BECConnector, QWidget):
|
|
464
464
|
|
465
465
|
@Slot(dict, dict)
|
466
466
|
def on_scan_queue_status(self, msg, meta):
|
467
|
+
"""
|
468
|
+
Slot to handle scan queue status messages. Decides what update to perform based on the scan queue status.
|
469
|
+
|
470
|
+
Args:
|
471
|
+
msg(dict): Message from the BEC.
|
472
|
+
meta(dict): Metadata from the BEC.
|
473
|
+
"""
|
467
474
|
primary_queue = msg.get("queue").get("primary")
|
468
475
|
info = primary_queue.get("info", None)
|
469
476
|
|
@@ -490,6 +497,12 @@ class SpiralProgressBar(BECConnector, QWidget):
|
|
490
497
|
# print("hook device_progress")
|
491
498
|
|
492
499
|
def _hook_scan_progress(self, ring_index: int = None):
|
500
|
+
"""
|
501
|
+
Hook the scan progress to the progress bars.
|
502
|
+
|
503
|
+
Args:
|
504
|
+
ring_index(int): Index of the progress bar to hook the scan progress to.
|
505
|
+
"""
|
493
506
|
if ring_index is not None:
|
494
507
|
ring = self._find_ring_by_index(ring_index)
|
495
508
|
else:
|
@@ -501,6 +514,15 @@ class SpiralProgressBar(BECConnector, QWidget):
|
|
501
514
|
ring.set_connections("on_scan_progress", MessageEndpoints.scan_progress())
|
502
515
|
|
503
516
|
def _hook_readback(self, bar_index: int, device: str, min: float | int, max: float | int):
|
517
|
+
"""
|
518
|
+
Hook the readback values to the progress bars.
|
519
|
+
|
520
|
+
Args:
|
521
|
+
bar_index(int): Index of the progress bar to hook the readback values to.
|
522
|
+
device(str): Device to readback values from.
|
523
|
+
min(float|int): Minimum value for the progress bar.
|
524
|
+
max(float|int): Maximum value for the progress bar.
|
525
|
+
"""
|
504
526
|
ring = self._find_ring_by_index(bar_index)
|
505
527
|
ring.set_min_max_values(min, max)
|
506
528
|
endpoint = MessageEndpoints.device_readback(device)
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=RF2JeGh8tG09DyAOwEu991IZy3C8Vm6lI8O_4Dr9B9Q,12239
|
3
3
|
.pylintrc,sha256=OstrgmEyP0smNFBKoIN5_26-UmNZgMHnbjvAWX0UrLs,18535
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=PBUKv3Symz1kDLb8arybg5eBIhTCCqgW09Sh45Bo7rc,7209
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=W1IkNBUfxaDv1yzQ94gfD1NSm1CF3FAmJwlMYzn7was,1178
|
8
8
|
README.md,sha256=y4jB6wvArS7N8_iTbKWnSM_oRAqLA2GqgzUR-FMh5sU,2645
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=tKe6Rt9bkUN4Pj1OuLyr5AuOLho0b0s0PaGU0xSOBg4,1822
|
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=tLD8HWgyURhMjYlKZ43pBu-qvGD1LI5o3n3rEieg-70,43
|
19
19
|
bec_widgets/cli/auto_updates.py,sha256=8x4_SrD8Hh1RbrUWXLfisw6X5v8Mij2DiTfjvn9dkUw,4692
|
20
|
-
bec_widgets/cli/client.py,sha256=
|
20
|
+
bec_widgets/cli/client.py,sha256=3GiSipBcjFvQunvevSgxGgriK1dslqpu-0A5WWFN_fA,55076
|
21
21
|
bec_widgets/cli/client_utils.py,sha256=7u8P9EYgLPJuAcHxnFiZi-gCZohO3vAn0W7dqsSrs4M,10660
|
22
22
|
bec_widgets/cli/generate_cli.py,sha256=tBt-F4Xccg9Pj2zuDEGHd0Ho1fKLfCf3PuSa8KmelQk,4431
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
@@ -82,8 +82,8 @@ bec_widgets/widgets/motor_control/selection/selection.ui,sha256=vXXpvNWuL6xyHhW7
|
|
82
82
|
bec_widgets/widgets/scan_control/__init__.py,sha256=IOfHl15vxb_uC6KN62-PeUzbBha_vQyqkkXbJ2HU674,38
|
83
83
|
bec_widgets/widgets/scan_control/scan_control.py,sha256=B5n2U2iVtTCY3Tx93JyBqzGCDCmWhWwAOhbPelLI-bs,17168
|
84
84
|
bec_widgets/widgets/spiral_progress_bar/__init__.py,sha256=4efbtcqCToMIw5bkQrTzy2TzuBCXvlhuUPh1bYC_Yzg,51
|
85
|
-
bec_widgets/widgets/spiral_progress_bar/ring.py,sha256=
|
86
|
-
bec_widgets/widgets/spiral_progress_bar/spiral_progress_bar.py,sha256=
|
85
|
+
bec_widgets/widgets/spiral_progress_bar/ring.py,sha256=JUx2TDH5eh1x9tWCkIkis9Tvo5P27gqFcszxVxSq7Ho,10469
|
86
|
+
bec_widgets/widgets/spiral_progress_bar/spiral_progress_bar.py,sha256=OQzJiR0Fd4fWop4ojykEKtXVqeLL0WLNSBdhf7JvLsc,24386
|
87
87
|
bec_widgets/widgets/toolbar/__init__.py,sha256=d-TP4_cr_VbpwreMM4ePnfZ5YXsEPQ45ibEf75nuGoE,36
|
88
88
|
bec_widgets/widgets/toolbar/toolbar.py,sha256=e0zCD_0q7K4NVhrzD8001Qvfxt-VhqHTgofchS9NgCM,5125
|
89
89
|
docs/Makefile,sha256=i2WHuFlgfyAPEW4ssEP8NY4cOibDJrVjvzSEU8_Ggwc,634
|
@@ -151,7 +151,7 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
151
151
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
152
152
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
153
153
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
154
|
-
bec_widgets-0.57.
|
155
|
-
bec_widgets-0.57.
|
156
|
-
bec_widgets-0.57.
|
157
|
-
bec_widgets-0.57.
|
154
|
+
bec_widgets-0.57.6.dist-info/METADATA,sha256=W1IkNBUfxaDv1yzQ94gfD1NSm1CF3FAmJwlMYzn7was,1178
|
155
|
+
bec_widgets-0.57.6.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
|
156
|
+
bec_widgets-0.57.6.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
157
|
+
bec_widgets-0.57.6.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|