bec-widgets 0.54.0__py3-none-any.whl → 0.56.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.
- .gitlab-ci.yml +113 -8
- CHANGELOG.md +32 -21
- PKG-INFO +3 -1
- bec_widgets/cli/client.py +252 -0
- bec_widgets/cli/generate_cli.py +4 -1
- bec_widgets/cli/rpc_wigdet_handler.py +2 -1
- bec_widgets/examples/jupyter_console/jupyter_console_window.py +29 -37
- bec_widgets/examples/motor_movement/motor_control_compilations.py +1 -7
- bec_widgets/utils/__init__.py +1 -0
- bec_widgets/utils/crosshair.py +13 -9
- bec_widgets/utils/ui_loader.py +58 -0
- bec_widgets/widgets/__init__.py +1 -0
- bec_widgets/widgets/motor_control/motor_table/motor_table.py +44 -43
- bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py +25 -23
- bec_widgets/widgets/motor_control/movement_relative/movement_relative.py +51 -48
- bec_widgets/widgets/spiral_progress_bar/__init__.py +1 -0
- bec_widgets/widgets/spiral_progress_bar/ring.py +184 -0
- bec_widgets/widgets/spiral_progress_bar/spiral_progress_bar.py +594 -0
- {bec_widgets-0.54.0.dist-info → bec_widgets-0.56.0.dist-info}/METADATA +3 -1
- {bec_widgets-0.54.0.dist-info → bec_widgets-0.56.0.dist-info}/RECORD +29 -46
- docs/user/apps.md +1 -26
- pyproject.toml +2 -1
- tests/end-2-end/test_bec_dock_rpc_e2e.py +81 -0
- tests/unit_tests/test_client_utils.py +2 -2
- tests/unit_tests/test_crosshair.py +5 -5
- tests/unit_tests/test_motor_control.py +49 -45
- tests/unit_tests/test_spiral_progress_bar.py +338 -0
- bec_widgets/examples/eiger_plot/__init__.py +0 -0
- bec_widgets/examples/eiger_plot/eiger_plot.py +0 -307
- bec_widgets/examples/eiger_plot/eiger_plot.ui +0 -207
- bec_widgets/examples/mca_readout/__init__.py +0 -0
- bec_widgets/examples/mca_readout/mca_plot.py +0 -159
- bec_widgets/examples/mca_readout/mca_sim.py +0 -28
- bec_widgets/examples/modular_app/___init__.py +0 -0
- bec_widgets/examples/modular_app/modular.ui +0 -92
- bec_widgets/examples/modular_app/modular_app.py +0 -197
- bec_widgets/examples/motor_movement/config_example.yaml +0 -17
- bec_widgets/examples/motor_movement/csax_bec_config.yaml +0 -10
- bec_widgets/examples/motor_movement/csaxs_config.yaml +0 -17
- bec_widgets/examples/motor_movement/motor_example.py +0 -1344
- bec_widgets/examples/stream_plot/__init__.py +0 -0
- bec_widgets/examples/stream_plot/line_plot.ui +0 -155
- bec_widgets/examples/stream_plot/stream_plot.py +0 -337
- docs/user/apps/modular_app.md +0 -6
- docs/user/apps/motor_app.md +0 -34
- docs/user/apps/motor_app_10fps.gif +0 -0
- docs/user/apps/plot_app.md +0 -6
- tests/unit_tests/test_eiger_plot.py +0 -115
- tests/unit_tests/test_stream_plot.py +0 -158
- {bec_widgets-0.54.0.dist-info → bec_widgets-0.56.0.dist-info}/WHEEL +0 -0
- {bec_widgets-0.54.0.dist-info → bec_widgets-0.56.0.dist-info}/licenses/LICENSE +0 -0
.gitlab-ci.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# This file is a template, and might need editing before it works on your project.
|
2
2
|
# Official language image. Look for the different tagged releases at:
|
3
3
|
# https://hub.docker.com/r/library/python/tags/
|
4
|
-
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.
|
4
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
|
5
5
|
#commands to run in the Docker container before starting each job.
|
6
6
|
variables:
|
7
7
|
DOCKER_TLS_CERTDIR: ""
|
@@ -23,7 +23,6 @@ workflow:
|
|
23
23
|
include:
|
24
24
|
- template: Security/Secret-Detection.gitlab-ci.yml
|
25
25
|
|
26
|
-
|
27
26
|
# different stages in the pipeline
|
28
27
|
stages:
|
29
28
|
- Formatter
|
@@ -65,7 +64,7 @@ pylint:
|
|
65
64
|
- ./pylint/
|
66
65
|
expire_in: 1 week
|
67
66
|
rules:
|
68
|
-
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
|
67
|
+
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
|
69
68
|
|
70
69
|
pylint-check:
|
71
70
|
stage: Formatter
|
@@ -98,7 +97,7 @@ pylint-check:
|
|
98
97
|
- ./pylint/
|
99
98
|
expire_in: 1 week
|
100
99
|
rules:
|
101
|
-
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
|
100
|
+
- if: $CI_PROJECT_PATH == "bec/bec_widgets"
|
102
101
|
|
103
102
|
tests:
|
104
103
|
stage: test
|
@@ -124,17 +123,124 @@ tests:
|
|
124
123
|
coverage_format: cobertura
|
125
124
|
path: coverage.xml
|
126
125
|
|
126
|
+
tests-3.10-pyside6:
|
127
|
+
extends: "tests"
|
128
|
+
stage: AdditionalTests
|
129
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10
|
130
|
+
script:
|
131
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
132
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
133
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
134
|
+
- apt-get update
|
135
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
136
|
+
- pip install -e ./bec/bec_lib[dev]
|
137
|
+
- pip install -e .[dev,pyside6]
|
138
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
139
|
+
allow_failure: true
|
127
140
|
|
128
|
-
tests-3.
|
141
|
+
tests-3.12-pyside6:
|
142
|
+
extends: "tests"
|
143
|
+
stage: AdditionalTests
|
144
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12
|
145
|
+
script:
|
146
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
147
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
148
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
149
|
+
- apt-get update
|
150
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
151
|
+
- pip install -e ./bec/bec_lib[dev]
|
152
|
+
- pip install -e .[dev,pyside6]
|
153
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
154
|
+
allow_failure: true
|
155
|
+
|
156
|
+
tests-3.10-pyqt5:
|
157
|
+
extends: "tests"
|
158
|
+
stage: AdditionalTests
|
159
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10
|
160
|
+
script:
|
161
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
162
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
163
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
164
|
+
- apt-get update
|
165
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
166
|
+
- pip install -e ./bec/bec_lib[dev]
|
167
|
+
- pip install -e .[dev,pyqt5]
|
168
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
169
|
+
allow_failure: true
|
170
|
+
|
171
|
+
tests-3.11-pyqt5:
|
129
172
|
extends: "tests"
|
130
173
|
stage: AdditionalTests
|
131
174
|
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
|
175
|
+
script:
|
176
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
177
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
178
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
179
|
+
- apt-get update
|
180
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
181
|
+
- pip install -e ./bec/bec_lib[dev]
|
182
|
+
- pip install -e .[dev,pyqt5]
|
183
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
132
184
|
allow_failure: true
|
133
185
|
|
134
|
-
tests-3.12:
|
186
|
+
tests-3.12-pyqt5:
|
135
187
|
extends: "tests"
|
136
188
|
stage: AdditionalTests
|
137
189
|
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12
|
190
|
+
script:
|
191
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
192
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
193
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
194
|
+
- apt-get update
|
195
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
196
|
+
- pip install -e ./bec/bec_lib[dev]
|
197
|
+
- pip install -e .[dev,pyqt5]
|
198
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
199
|
+
allow_failure: true
|
200
|
+
|
201
|
+
tests-3.10-pyqt6:
|
202
|
+
extends: "tests"
|
203
|
+
stage: AdditionalTests
|
204
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.10
|
205
|
+
script:
|
206
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
207
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
208
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
209
|
+
- apt-get update
|
210
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
211
|
+
- pip install -e ./bec/bec_lib[dev]
|
212
|
+
- pip install -e .[dev,pyqt6]
|
213
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
214
|
+
allow_failure: true
|
215
|
+
|
216
|
+
tests-3.11-pyqt6:
|
217
|
+
extends: "tests"
|
218
|
+
stage: AdditionalTests
|
219
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.11
|
220
|
+
script:
|
221
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
222
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
223
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
224
|
+
- apt-get update
|
225
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
226
|
+
- pip install -e ./bec/bec_lib[dev]
|
227
|
+
- pip install -e .[dev,pyqt6]
|
228
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
229
|
+
allow_failure: true
|
230
|
+
|
231
|
+
tests-3.12-pyqt6:
|
232
|
+
extends: "tests"
|
233
|
+
stage: AdditionalTests
|
234
|
+
image: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/python:3.12
|
235
|
+
script:
|
236
|
+
- git clone --branch $BEC_CORE_BRANCH https://gitlab.psi.ch/bec/bec.git
|
237
|
+
- git clone --branch $OPHYD_DEVICES_BRANCH https://gitlab.psi.ch/bec/ophyd_devices.git
|
238
|
+
- export OHPYD_DEVICES_PATH=$PWD/ophyd_devices
|
239
|
+
- apt-get update
|
240
|
+
- apt-get install -y libgl1-mesa-glx libegl1-mesa x11-utils libxkbcommon-x11-0 libdbus-1-3
|
241
|
+
- pip install -e ./bec/bec_lib[dev]
|
242
|
+
- pip install -e .[dev,pyqt6]
|
243
|
+
- pytest -v --junitxml=report.xml --random-order ./tests/unit_tests
|
138
244
|
allow_failure: true
|
139
245
|
|
140
246
|
end-2-end-conda:
|
@@ -150,7 +256,7 @@ end-2-end-conda:
|
|
150
256
|
- conda config --prepend channels conda-forge
|
151
257
|
- conda config --set channel_priority strict
|
152
258
|
- conda config --set always_yes yes --set changeps1 no
|
153
|
-
- conda create -q -n test-environment python=3.
|
259
|
+
- conda create -q -n test-environment python=3.11
|
154
260
|
- conda init bash
|
155
261
|
- source ~/.bashrc
|
156
262
|
- conda activate test-environment
|
@@ -183,7 +289,6 @@ end-2-end-conda:
|
|
183
289
|
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
|
184
290
|
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "production"'
|
185
291
|
|
186
|
-
|
187
292
|
semver:
|
188
293
|
stage: Deploy
|
189
294
|
needs: ["tests"]
|
CHANGELOG.md
CHANGED
@@ -2,6 +2,38 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
|
5
|
+
## v0.56.0 (2024-05-29)
|
6
|
+
|
7
|
+
### Build
|
8
|
+
|
9
|
+
* build: added pyside6 as dependency ([`db301b1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/db301b1be27bba76c8bb21fbff93cb4902b592a5))
|
10
|
+
|
11
|
+
### Ci
|
12
|
+
|
13
|
+
* ci: added tests for pyside6, pyqt6 and pyqt5, default test and e2e is python 3.11 and pyqt6 ([`855be35`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/855be3551a1372bcbebba6f8930903f99202bbca))
|
14
|
+
|
15
|
+
### Documentation
|
16
|
+
|
17
|
+
* docs(examples): example apps section deleted ([`ad208a5`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ad208a5ef8495c45a8b83a4850ba9a1041b42717))
|
18
|
+
|
19
|
+
### Feature
|
20
|
+
|
21
|
+
* feat(utils/ui_loader): universal ui loader for pyside/pyqt ([`0fea8d6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0fea8d606574fa99dda3b117da5d5209c251f694))
|
22
|
+
|
23
|
+
### Fix
|
24
|
+
|
25
|
+
* fix(examples): outdated examples removed (mca_plot.py, stream_plot.py, motor_example.py) ([`ddc9510`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ddc9510c2ba8dadf291809eeb5b135a105259492))
|
26
|
+
|
27
|
+
* fix: compatibility adjustment to .ui loading and tests for PySide6 ([`07b99d9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/07b99d91a57a645cddd76294f48d78773e4c9ea5))
|
28
|
+
|
29
|
+
|
30
|
+
## v0.55.0 (2024-05-24)
|
31
|
+
|
32
|
+
### Feature
|
33
|
+
|
34
|
+
* feat(widgets/progressbar): SpiralProgressBar added with rpc interface ([`76bd0d3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/76bd0d339ac9ae9e8a3baa0d0d4e951ec1d09670))
|
35
|
+
|
36
|
+
|
5
37
|
## v0.54.0 (2024-05-24)
|
6
38
|
|
7
39
|
### Build
|
@@ -138,35 +170,14 @@
|
|
138
170
|
|
139
171
|
## v0.50.0 (2024-04-29)
|
140
172
|
|
141
|
-
### Feature
|
142
|
-
|
143
|
-
* feat(plots): universal cleanup and remove also for children items ([`381d713`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/381d713837bb9217c58ba1d8b89691aa35c9f5ec))
|
144
|
-
|
145
|
-
* feat(rpc/rpc_register): singleton rpc register for all rpc connections for session ([`a898e7e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a898e7e4f14e9ae854703dddbd1eb8c50cb640ff))
|
146
|
-
|
147
173
|
### Fix
|
148
174
|
|
149
175
|
* fix(widgets/figure): access pattern changed for getting widgets by coordinates for rpc ([`13c018a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/13c018a79704a7497c140df57179d294e43ecffa))
|
150
176
|
|
151
177
|
* fix(plots): cleanup policy reviewed for children items ([`8f20a0b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8f20a0b3b1b5dd117b36b45645717190b9ee9cbf))
|
152
178
|
|
153
|
-
* fix(rpc/client_utils): getoutput more transparent + error handling ([`6b6a6b2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6b6a6b2249f24d3d02bd5fcd7ef1c63ed794c304))
|
154
|
-
|
155
|
-
* fix(rpc_register): thread lock for listign all connections ([`2ca3267`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2ca32675ec3f00137e2140259db51f6e5aa7bb71))
|
156
|
-
|
157
179
|
### Test
|
158
180
|
|
159
181
|
* test(cli/rpc_register): e2e RPCRegister ([`4f261be`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4f261be4c7cfe54501443d031f9266f4f838f6e2))
|
160
182
|
|
161
183
|
* test(cli/rpc_register): rpc_register tests added ([`40eb75f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/40eb75f85a4d99d498b086a37e799276a9d2ac3f))
|
162
|
-
|
163
|
-
|
164
|
-
## v0.49.1 (2024-04-26)
|
165
|
-
|
166
|
-
### Build
|
167
|
-
|
168
|
-
* build(pyqt6): fixing PyQt6-Qt6 package to 6.6.3 ([`a222298`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a22229849cbb57c15e4c1bae02d7e52e672f8c4c))
|
169
|
-
|
170
|
-
### Fix
|
171
|
-
|
172
|
-
* fix(widgets/editor): qscintilla editor removed ([`ab85374`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ab8537483da6c87cb9a0b0f01706208c964f292d))
|
PKG-INFO
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: bec_widgets
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.56.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
|
@@ -31,3 +31,5 @@ Provides-Extra: pyqt5
|
|
31
31
|
Requires-Dist: pyqt5>=5.9; extra == 'pyqt5'
|
32
32
|
Provides-Extra: pyqt6
|
33
33
|
Requires-Dist: pyqt6>=6.7; extra == 'pyqt6'
|
34
|
+
Provides-Extra: pyside6
|
35
|
+
Requires-Dist: pyside6>=6.7; extra == 'pyside6'
|
bec_widgets/cli/client.py
CHANGED
@@ -1630,3 +1630,255 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
|
|
1630
1630
|
"""
|
1631
1631
|
Get all registered RPC objects.
|
1632
1632
|
"""
|
1633
|
+
|
1634
|
+
|
1635
|
+
class SpiralProgressBar(RPCBase):
|
1636
|
+
@rpc_call
|
1637
|
+
def get_all_rpc(self) -> "dict":
|
1638
|
+
"""
|
1639
|
+
Get all registered RPC objects.
|
1640
|
+
"""
|
1641
|
+
|
1642
|
+
@property
|
1643
|
+
@rpc_call
|
1644
|
+
def rpc_id(self) -> "str":
|
1645
|
+
"""
|
1646
|
+
Get the RPC ID of the widget.
|
1647
|
+
"""
|
1648
|
+
|
1649
|
+
@property
|
1650
|
+
@rpc_call
|
1651
|
+
def config_dict(self) -> "dict":
|
1652
|
+
"""
|
1653
|
+
Get the configuration of the widget.
|
1654
|
+
|
1655
|
+
Returns:
|
1656
|
+
dict: The configuration of the widget.
|
1657
|
+
"""
|
1658
|
+
|
1659
|
+
@property
|
1660
|
+
@rpc_call
|
1661
|
+
def rings(self):
|
1662
|
+
"""
|
1663
|
+
None
|
1664
|
+
"""
|
1665
|
+
|
1666
|
+
@rpc_call
|
1667
|
+
def update_config(self, config: "SpiralProgressBarConfig | dict"):
|
1668
|
+
"""
|
1669
|
+
Update the configuration of the widget.
|
1670
|
+
|
1671
|
+
Args:
|
1672
|
+
config(SpiralProgressBarConfig|dict): Configuration to update.
|
1673
|
+
"""
|
1674
|
+
|
1675
|
+
@rpc_call
|
1676
|
+
def add_ring(self, **kwargs) -> "Ring":
|
1677
|
+
"""
|
1678
|
+
Add a new progress bar.
|
1679
|
+
|
1680
|
+
Args:
|
1681
|
+
**kwargs: Keyword arguments for the new progress bar.
|
1682
|
+
|
1683
|
+
Returns:
|
1684
|
+
Ring: Ring object.
|
1685
|
+
"""
|
1686
|
+
|
1687
|
+
@rpc_call
|
1688
|
+
def remove_ring(self, index: "int"):
|
1689
|
+
"""
|
1690
|
+
Remove a progress bar by index.
|
1691
|
+
|
1692
|
+
Args:
|
1693
|
+
index(int): Index of the progress bar to remove.
|
1694
|
+
"""
|
1695
|
+
|
1696
|
+
@rpc_call
|
1697
|
+
def set_precision(self, precision: "int", bar_index: "int" = None):
|
1698
|
+
"""
|
1699
|
+
Set the precision for the progress bars. If bar_index is not provide, the precision will be set for all progress bars.
|
1700
|
+
|
1701
|
+
Args:
|
1702
|
+
precision(int): Precision for the progress bars.
|
1703
|
+
bar_index(int): Index of the progress bar to set the precision for. If provided, only a single precision can be set.
|
1704
|
+
"""
|
1705
|
+
|
1706
|
+
@rpc_call
|
1707
|
+
def set_min_max_values(
|
1708
|
+
self,
|
1709
|
+
min_values: "int | float | list[int | float]",
|
1710
|
+
max_values: "int | float | list[int | float]",
|
1711
|
+
):
|
1712
|
+
"""
|
1713
|
+
Set the minimum and maximum values for the progress bars.
|
1714
|
+
|
1715
|
+
Args:
|
1716
|
+
min_values(int|float | list[float]): Minimum value(s) for the progress bars. If multiple progress bars are displayed, provide a list of minimum values for each progress bar.
|
1717
|
+
max_values(int|float | list[float]): Maximum value(s) for the progress bars. If multiple progress bars are displayed, provide a list of maximum values for each progress bar.
|
1718
|
+
"""
|
1719
|
+
|
1720
|
+
@rpc_call
|
1721
|
+
def set_number_of_bars(self, num_bars: "int"):
|
1722
|
+
"""
|
1723
|
+
Set the number of progress bars to display.
|
1724
|
+
|
1725
|
+
Args:
|
1726
|
+
num_bars(int): Number of progress bars to display.
|
1727
|
+
"""
|
1728
|
+
|
1729
|
+
@rpc_call
|
1730
|
+
def set_value(self, values: "int | list", ring_index: "int" = None):
|
1731
|
+
"""
|
1732
|
+
Set the values for the progress bars.
|
1733
|
+
|
1734
|
+
Args:
|
1735
|
+
values(int | tuple): Value(s) for the progress bars. If multiple progress bars are displayed, provide a tuple of values for each progress bar.
|
1736
|
+
ring_index(int): Index of the progress bar to set the value for. If provided, only a single value can be set.
|
1737
|
+
|
1738
|
+
Examples:
|
1739
|
+
>>> SpiralProgressBar.set_value(50)
|
1740
|
+
>>> SpiralProgressBar.set_value([30, 40, 50]) # (outer, middle, inner)
|
1741
|
+
>>> SpiralProgressBar.set_value(60, bar_index=1) # Set the value for the middle progress bar.
|
1742
|
+
"""
|
1743
|
+
|
1744
|
+
@rpc_call
|
1745
|
+
def set_colors_from_map(self, colormap, color_format: "Literal['RGB', 'HEX']" = "RGB"):
|
1746
|
+
"""
|
1747
|
+
Set the colors for the progress bars from a colormap.
|
1748
|
+
|
1749
|
+
Args:
|
1750
|
+
colormap(str): Name of the colormap.
|
1751
|
+
color_format(Literal["RGB","HEX"]): Format of the returned colors ('RGB', 'HEX').
|
1752
|
+
"""
|
1753
|
+
|
1754
|
+
@rpc_call
|
1755
|
+
def set_colors_directly(
|
1756
|
+
self, colors: "list[str | tuple] | str | tuple", bar_index: "int" = None
|
1757
|
+
):
|
1758
|
+
"""
|
1759
|
+
Set the colors for the progress bars directly.
|
1760
|
+
|
1761
|
+
Args:
|
1762
|
+
colors(list[str | tuple] | str | tuple): Color(s) for the progress bars. If multiple progress bars are displayed, provide a list of colors for each progress bar.
|
1763
|
+
bar_index(int): Index of the progress bar to set the color for. If provided, only a single color can be set.
|
1764
|
+
"""
|
1765
|
+
|
1766
|
+
@rpc_call
|
1767
|
+
def set_line_widths(self, widths: "int | list[int]", bar_index: "int" = None):
|
1768
|
+
"""
|
1769
|
+
Set the line widths for the progress bars.
|
1770
|
+
|
1771
|
+
Args:
|
1772
|
+
widths(int | list[int]): Line width(s) for the progress bars. If multiple progress bars are displayed, provide a list of line widths for each progress bar.
|
1773
|
+
bar_index(int): Index of the progress bar to set the line width for. If provided, only a single line width can be set.
|
1774
|
+
"""
|
1775
|
+
|
1776
|
+
@rpc_call
|
1777
|
+
def set_gap(self, gap: "int"):
|
1778
|
+
"""
|
1779
|
+
Set the gap between the progress bars.
|
1780
|
+
|
1781
|
+
Args:
|
1782
|
+
gap(int): Gap between the progress bars.
|
1783
|
+
"""
|
1784
|
+
|
1785
|
+
@rpc_call
|
1786
|
+
def set_diameter(self, diameter: "int"):
|
1787
|
+
"""
|
1788
|
+
Set the diameter of the widget.
|
1789
|
+
|
1790
|
+
Args:
|
1791
|
+
diameter(int): Diameter of the widget.
|
1792
|
+
"""
|
1793
|
+
|
1794
|
+
@rpc_call
|
1795
|
+
def reset_diameter(self):
|
1796
|
+
"""
|
1797
|
+
Reset the fixed size of the widget.
|
1798
|
+
"""
|
1799
|
+
|
1800
|
+
@rpc_call
|
1801
|
+
def enable_auto_updates(self, enable: "bool" = True):
|
1802
|
+
"""
|
1803
|
+
Enable or disable updates based on scan status. Overrides manual updates.
|
1804
|
+
The behaviour of the whole progress bar widget will be driven by the scan queue status.
|
1805
|
+
|
1806
|
+
Args:
|
1807
|
+
enable(bool): True or False.
|
1808
|
+
|
1809
|
+
Returns:
|
1810
|
+
bool: True if scan segment updates are enabled.
|
1811
|
+
"""
|
1812
|
+
|
1813
|
+
|
1814
|
+
class Ring(RPCBase):
|
1815
|
+
@rpc_call
|
1816
|
+
def get_all_rpc(self) -> "dict":
|
1817
|
+
"""
|
1818
|
+
Get all registered RPC objects.
|
1819
|
+
"""
|
1820
|
+
|
1821
|
+
@property
|
1822
|
+
@rpc_call
|
1823
|
+
def rpc_id(self) -> "str":
|
1824
|
+
"""
|
1825
|
+
Get the RPC ID of the widget.
|
1826
|
+
"""
|
1827
|
+
|
1828
|
+
@property
|
1829
|
+
@rpc_call
|
1830
|
+
def config_dict(self) -> "dict":
|
1831
|
+
"""
|
1832
|
+
Get the configuration of the widget.
|
1833
|
+
|
1834
|
+
Returns:
|
1835
|
+
dict: The configuration of the widget.
|
1836
|
+
"""
|
1837
|
+
|
1838
|
+
@rpc_call
|
1839
|
+
def set_value(self, value: "int | float"):
|
1840
|
+
"""
|
1841
|
+
None
|
1842
|
+
"""
|
1843
|
+
|
1844
|
+
@rpc_call
|
1845
|
+
def set_color(self, color: "str | tuple"):
|
1846
|
+
"""
|
1847
|
+
None
|
1848
|
+
"""
|
1849
|
+
|
1850
|
+
@rpc_call
|
1851
|
+
def set_background(self, color: "str | tuple"):
|
1852
|
+
"""
|
1853
|
+
None
|
1854
|
+
"""
|
1855
|
+
|
1856
|
+
@rpc_call
|
1857
|
+
def set_line_width(self, width: "int"):
|
1858
|
+
"""
|
1859
|
+
None
|
1860
|
+
"""
|
1861
|
+
|
1862
|
+
@rpc_call
|
1863
|
+
def set_min_max_values(self, min_value: "int", max_value: "int"):
|
1864
|
+
"""
|
1865
|
+
None
|
1866
|
+
"""
|
1867
|
+
|
1868
|
+
@rpc_call
|
1869
|
+
def set_start_angle(self, start_angle: "int"):
|
1870
|
+
"""
|
1871
|
+
None
|
1872
|
+
"""
|
1873
|
+
|
1874
|
+
@rpc_call
|
1875
|
+
def set_connections(self, slot: "str", endpoint: "str | EndpointInfo"):
|
1876
|
+
"""
|
1877
|
+
None
|
1878
|
+
"""
|
1879
|
+
|
1880
|
+
@rpc_call
|
1881
|
+
def reset_connection(self):
|
1882
|
+
"""
|
1883
|
+
None
|
1884
|
+
"""
|
bec_widgets/cli/generate_cli.py
CHANGED
@@ -109,13 +109,14 @@ if __name__ == "__main__": # pragma: no cover
|
|
109
109
|
import os
|
110
110
|
|
111
111
|
from bec_widgets.utils import BECConnector
|
112
|
-
from bec_widgets.widgets import BECDock, BECDockArea, BECFigure
|
112
|
+
from bec_widgets.widgets import BECDock, BECDockArea, BECFigure, SpiralProgressBar
|
113
113
|
from bec_widgets.widgets.figure.plots.image.image import BECImageShow
|
114
114
|
from bec_widgets.widgets.figure.plots.image.image_item import BECImageItem
|
115
115
|
from bec_widgets.widgets.figure.plots.motor_map.motor_map import BECMotorMap
|
116
116
|
from bec_widgets.widgets.figure.plots.plot_base import BECPlotBase
|
117
117
|
from bec_widgets.widgets.figure.plots.waveform.waveform import BECWaveform
|
118
118
|
from bec_widgets.widgets.figure.plots.waveform.waveform_curve import BECCurve
|
119
|
+
from bec_widgets.widgets.spiral_progress_bar.ring import Ring
|
119
120
|
|
120
121
|
current_path = os.path.dirname(__file__)
|
121
122
|
client_path = os.path.join(current_path, "client.py")
|
@@ -130,6 +131,8 @@ if __name__ == "__main__": # pragma: no cover
|
|
130
131
|
BECMotorMap,
|
131
132
|
BECDock,
|
132
133
|
BECDockArea,
|
134
|
+
SpiralProgressBar,
|
135
|
+
Ring,
|
133
136
|
]
|
134
137
|
generator = ClientGenerator()
|
135
138
|
generator.generate_client(clss)
|
@@ -1,11 +1,12 @@
|
|
1
1
|
from bec_widgets.utils import BECConnector
|
2
2
|
from bec_widgets.widgets.figure import BECFigure
|
3
|
+
from bec_widgets.widgets.spiral_progress_bar.spiral_progress_bar import SpiralProgressBar
|
3
4
|
|
4
5
|
|
5
6
|
class RPCWidgetHandler:
|
6
7
|
"""Handler class for creating widgets from RPC messages."""
|
7
8
|
|
8
|
-
widget_classes = {"BECFigure": BECFigure}
|
9
|
+
widget_classes = {"BECFigure": BECFigure, "SpiralProgressBar": SpiralProgressBar}
|
9
10
|
|
10
11
|
@staticmethod
|
11
12
|
def create_widget(widget_type, **kwargs) -> BECConnector:
|