bec-widgets 0.81.0__py3-none-any.whl → 0.81.2__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 +12 -14
- PKG-INFO +1 -1
- bec_widgets/examples/__init__.py +0 -9
- bec_widgets/widgets/figure/plots/waveform/waveform.py +8 -2
- {bec_widgets-0.81.0.dist-info → bec_widgets-0.81.2.dist-info}/METADATA +1 -1
- {bec_widgets-0.81.0.dist-info → bec_widgets-0.81.2.dist-info}/RECORD +10 -28
- pyproject.toml +1 -1
- bec_widgets/examples/motor_movement/__init__.py +0 -9
- bec_widgets/examples/motor_movement/motor_control_compilations.py +0 -250
- bec_widgets/examples/motor_movement/motor_controller.ui +0 -926
- bec_widgets/widgets/motor_control/__init__.py +0 -0
- bec_widgets/widgets/motor_control/motor_control.py +0 -252
- bec_widgets/widgets/motor_control/motor_table/__init__.py +0 -0
- bec_widgets/widgets/motor_control/motor_table/motor_table.py +0 -484
- bec_widgets/widgets/motor_control/motor_table/motor_table.ui +0 -113
- bec_widgets/widgets/motor_control/movement_absolute/__init__.py +0 -0
- bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py +0 -159
- bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.ui +0 -149
- bec_widgets/widgets/motor_control/movement_relative/__init__.py +0 -0
- bec_widgets/widgets/motor_control/movement_relative/movement_relative.py +0 -230
- bec_widgets/widgets/motor_control/movement_relative/movement_relative.ui +0 -298
- bec_widgets/widgets/motor_control/selection/__init__.py +0 -0
- bec_widgets/widgets/motor_control/selection/selection.py +0 -110
- bec_widgets/widgets/motor_control/selection/selection.ui +0 -69
- tests/unit_tests/test_motor_control.py +0 -588
- {bec_widgets-0.81.0.dist-info → bec_widgets-0.81.2.dist-info}/WHEEL +0 -0
- {bec_widgets-0.81.0.dist-info → bec_widgets-0.81.2.dist-info}/entry_points.txt +0 -0
- {bec_widgets-0.81.0.dist-info → bec_widgets-0.81.2.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v0.81.2 (2024-07-07)
|
4
|
+
|
5
|
+
### Fix
|
6
|
+
|
7
|
+
* fix(waveform): scan_history error check for IndexError ([`dd1875e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/dd1875ea5cc18bcef9aad743347a8accf144c08d))
|
8
|
+
|
9
|
+
## v0.81.1 (2024-07-07)
|
10
|
+
|
11
|
+
### Fix
|
12
|
+
|
13
|
+
* fix(motor_control): temporary remove of motor control widgets ([`99114f1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/99114f14f62202e1fd8bf145616fa8c69937ada4))
|
14
|
+
|
3
15
|
## v0.81.0 (2024-07-06)
|
4
16
|
|
5
17
|
### Feature
|
@@ -124,20 +136,6 @@
|
|
124
136
|
|
125
137
|
## v0.76.0 (2024-06-28)
|
126
138
|
|
127
|
-
### Feature
|
128
|
-
|
129
|
-
* feat(designer): added support for creating designer plugins automatically ([`c1dd0ee`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c1dd0ee1906dba1f2e2ae9ce40a84d55c26a1cce))
|
130
|
-
|
131
139
|
### Fix
|
132
140
|
|
133
141
|
* fix: fixed qwidget inheritance for ring progress bar ([`0610d2f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0610d2f9f027f8659e7149f2dfbb316ff30e337d))
|
134
|
-
|
135
|
-
### Unknown
|
136
|
-
|
137
|
-
* fix:parent set as first kwarg TextBox and WebsiteWidget ([`a45c407`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a45c4075684b93bfdcee03e5a416b84f61d3bc6f))
|
138
|
-
|
139
|
-
## v0.75.0 (2024-06-26)
|
140
|
-
|
141
|
-
### Feature
|
142
|
-
|
143
|
-
* feat(widgets): added simple bec queue widget ([`3faee98`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3faee98ec80041a27e4c1f1156178de6f9dcdc63))
|
PKG-INFO
CHANGED
bec_widgets/examples/__init__.py
CHANGED
@@ -221,6 +221,7 @@ class BECWaveform(BECPlotBase):
|
|
221
221
|
label: str | None = None,
|
222
222
|
validate: bool = True,
|
223
223
|
dap: str | None = None, # TODO add dap custom curve wrapper
|
224
|
+
**kwargs,
|
224
225
|
) -> BECCurve:
|
225
226
|
"""
|
226
227
|
Plot a curve to the plot widget.
|
@@ -244,7 +245,7 @@ class BECWaveform(BECPlotBase):
|
|
244
245
|
"""
|
245
246
|
|
246
247
|
if x is not None and y is not None:
|
247
|
-
return self.add_curve_custom(x=x, y=y, label=label, color=color)
|
248
|
+
return self.add_curve_custom(x=x, y=y, label=label, color=color, **kwargs)
|
248
249
|
else:
|
249
250
|
if dap:
|
250
251
|
self.add_dap(x_name=x_name, y_name=y_name, dap=dap)
|
@@ -259,6 +260,7 @@ class BECWaveform(BECPlotBase):
|
|
259
260
|
color_map_z=color_map_z,
|
260
261
|
label=label,
|
261
262
|
validate_bec=validate,
|
263
|
+
**kwargs,
|
262
264
|
)
|
263
265
|
|
264
266
|
def add_curve_custom(
|
@@ -754,7 +756,11 @@ class BECWaveform(BECPlotBase):
|
|
754
756
|
self.update_dap, MessageEndpoints.dap_response(self.scan_id)
|
755
757
|
)
|
756
758
|
if scan_index is not None:
|
757
|
-
|
759
|
+
try:
|
760
|
+
self.scan_id = self.queue.scan_storage.storage[scan_index].scan_id
|
761
|
+
except IndexError:
|
762
|
+
print(f"Scan index {scan_index} out of range.")
|
763
|
+
return
|
758
764
|
elif scan_id is not None:
|
759
765
|
self.scan_id = scan_id
|
760
766
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=vuDJPAYOK0995_H6fu0N5dIgIrOJgTvKr0HZkNWlxMw,8142
|
3
3
|
.pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
|
4
4
|
.readthedocs.yaml,sha256=aSOc277LqXcsTI6lgvm_JY80lMlr69GbPKgivua2cS0,603
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=j1aNZJFxk_hqlSoK8ue-z10Cm3cvgwrDyGBF5uCewN8,6653
|
6
6
|
LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=VfAwsgdfE-Y03bigTY5y9gl9q-WmgX1yU8h-2OqucmI,1309
|
8
8
|
README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=SkiQlmPoikUOrLYzqhqHWHAPQATC3Vp6mkP9WPw25qA,2358
|
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
|
@@ -23,13 +23,10 @@ bec_widgets/cli/generate_cli.py,sha256=Ea5px9KblUlcGg-1JbJBTIU7laGg2n8PM7Efw9WVV
|
|
23
23
|
bec_widgets/cli/rpc_register.py,sha256=QxXUZu5XNg00Yf5O3UHWOXg3-f_pzKjjoZYMOa-MOJc,2216
|
24
24
|
bec_widgets/cli/rpc_wigdet_handler.py,sha256=6kQng2DyS6rhLJqSJ7xa0kdgSxp-35A2upcf833dJRE,1483
|
25
25
|
bec_widgets/cli/server.py,sha256=2EJvkQDzrDTsZjRPs7g2v_iPTspGqxzY34tRAnvjxjY,7281
|
26
|
-
bec_widgets/examples/__init__.py,sha256=
|
26
|
+
bec_widgets/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
bec_widgets/examples/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
28
|
bec_widgets/examples/jupyter_console/jupyter_console_window.py,sha256=oOVCTY68bAn9HDFd5W_xNqQhI7Nsm7TaqYYLqLWXo2w,5520
|
29
29
|
bec_widgets/examples/jupyter_console/jupyter_console_window.ui,sha256=2A2mNTUMZBYygz8K4qWzrcjnNqZBMVyeHm26iLZVRWI,1473
|
30
|
-
bec_widgets/examples/motor_movement/__init__.py,sha256=LzPJkxLAxOsZCbXR-fRCPmeYobp7Yqds6tDxW4W1gSw,214
|
31
|
-
bec_widgets/examples/motor_movement/motor_control_compilations.py,sha256=8rpA7a2xVZTDMrx7YQIj3IJew78J1gcVMkHvloS0U_Q,9055
|
32
|
-
bec_widgets/examples/motor_movement/motor_controller.ui,sha256=83XX6NGILwntoUIghvzWnMuGf80O8khK3SduVKTAEFM,29105
|
33
30
|
bec_widgets/examples/plugin_example_pyside/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
34
31
|
bec_widgets/examples/plugin_example_pyside/main.py,sha256=xdC6RWSRt1rW8Prj0CsDeCPct6-_j3__oJmdgogB5PI,505
|
35
32
|
bec_widgets/examples/plugin_example_pyside/registertictactoe.py,sha256=VNFkHc5Sc30lRKzOFJbhArCHGkp_wRxOeJjZbmaAHRU,448
|
@@ -110,24 +107,10 @@ bec_widgets/widgets/figure/plots/image/image_processor.py,sha256=GeTtWjbldy6VejM
|
|
110
107
|
bec_widgets/widgets/figure/plots/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
111
108
|
bec_widgets/widgets/figure/plots/motor_map/motor_map.py,sha256=QYeXKcb87DPti19MaAFFr6LGma4F7GijaxnC1vx8Kng,18013
|
112
109
|
bec_widgets/widgets/figure/plots/waveform/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
113
|
-
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=
|
110
|
+
bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=e401GGvUF11rZKf4onB4zYlcUWIv8Zsnm4GcysaXi6U,29226
|
114
111
|
bec_widgets/widgets/figure/plots/waveform/waveform_curve.py,sha256=yQZGPKs--3X_9Qg2pv0GUiL5WLBQVC3z_PJKRnsHqPU,8293
|
115
112
|
bec_widgets/widgets/jupyter_console/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
116
113
|
bec_widgets/widgets/jupyter_console/jupyter_console.py,sha256=ioLYJL31RdBoAOGFSS8PVSnUhkWPWmLC3tiKp7CouO8,2251
|
117
|
-
bec_widgets/widgets/motor_control/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
118
|
-
bec_widgets/widgets/motor_control/motor_control.py,sha256=UrLCvp3J6uiVxWV2jqQbsA2nsMf9s_rrDH2KjnUm-bk,7890
|
119
|
-
bec_widgets/widgets/motor_control/motor_table/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
120
|
-
bec_widgets/widgets/motor_control/motor_table/motor_table.py,sha256=xOTCz4eBKzEUyeOJhnAK--sbf-68H0yg7LM3KH3A9Hc,17570
|
121
|
-
bec_widgets/widgets/motor_control/motor_table/motor_table.ui,sha256=t6aRKiSmutMfp0AyupavbCs0cal-FANEnlKQiPzC9PQ,2792
|
122
|
-
bec_widgets/widgets/motor_control/movement_absolute/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
123
|
-
bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py,sha256=TQXZ1o4a4ukRAvhbebXC0v2-VGLqHVM2VzSAv5PajDI,5694
|
124
|
-
bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.ui,sha256=nR3p6oevAkIBTLW5wM_zYOVWsCAUgeMZdRm10Q77COE,4126
|
125
|
-
bec_widgets/widgets/motor_control/movement_relative/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
|
-
bec_widgets/widgets/motor_control/movement_relative/movement_relative.py,sha256=DXFHAxSGskpapRTyDNbG_oqLwFkVOXITYkEXbfQGWWQ,8926
|
127
|
-
bec_widgets/widgets/motor_control/movement_relative/movement_relative.ui,sha256=PulNJNiws7TRAxHM2snNyvlmQ0tRShdArHmtaC85h4U,8684
|
128
|
-
bec_widgets/widgets/motor_control/selection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
129
|
-
bec_widgets/widgets/motor_control/selection/selection.py,sha256=WNHndvv4JvxeAMnDFBMTvUILcn9u_0mWGRsgNiBZEsM,3988
|
130
|
-
bec_widgets/widgets/motor_control/selection/selection.ui,sha256=vXXpvNWuL6xyHhW7Lx1zmVFX-95Z5AXGlhKQD2HmM1A,1779
|
131
114
|
bec_widgets/widgets/motor_map/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
132
115
|
bec_widgets/widgets/motor_map/bec_motor_map_widget.pyproject,sha256=NAI8s5gRKz80ED4KY7OgD2OgSH5HEsjt2ux2BYp66yg,63
|
133
116
|
bec_widgets/widgets/motor_map/bec_motor_map_widget_plugin.py,sha256=PIfDE78Zqvsu7-xwoh9DdYkH8a7eOUFSaEl0bNrHYHc,1292
|
@@ -228,7 +211,6 @@ tests/unit_tests/test_device_input_base.py,sha256=Bf2lk_utvLsDqDX5NWgyArSAo-dWMQ
|
|
228
211
|
tests/unit_tests/test_device_input_widgets.py,sha256=PmUL8aJXg_BYwWDE3Gh1kGm8q6fQZD5sWlVXz3KLwI0,5837
|
229
212
|
tests/unit_tests/test_generate_cli_client.py,sha256=ng-eV5iF7Dhm-6YpxYo99CMY0KgqoaZBQNkMeKULDBU,3355
|
230
213
|
tests/unit_tests/test_generate_plugin.py,sha256=9603ucZChM-pYpHadzsR94U1Zec1KZT34WedX9qzgMo,4464
|
231
|
-
tests/unit_tests/test_motor_control.py,sha256=bdCjhthWEy9iNyNZiD1JAeN_PSMaOblS780XGDjVwsw,20851
|
232
214
|
tests/unit_tests/test_plot_base.py,sha256=vWbt-QO5blSoE5C1392MIFha9A9JnUsx_D_9yTqhcRo,3845
|
233
215
|
tests/unit_tests/test_plugin_utils.py,sha256=ayksWdrFY7kOiA0wVEjKFmFCF3UhH3lG8tzPVOpwysk,528
|
234
216
|
tests/unit_tests/test_ring_progress_bar.py,sha256=hDlqkQho7FR7HAfM4Zrr4q1m773a3_rQ8CbM1GqDDSE,12252
|
@@ -248,8 +230,8 @@ tests/unit_tests/test_configs/config_device_no_entry.yaml,sha256=hdvue9KLc_kfNzG
|
|
248
230
|
tests/unit_tests/test_configs/config_scan.yaml,sha256=vo484BbWOjA_e-h6bTjSV9k7QaQHrlAvx-z8wtY-P4E,1915
|
249
231
|
tests/unit_tests/test_msgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
250
232
|
tests/unit_tests/test_msgs/available_scans_message.py,sha256=m_z97hIrjHXXMa2Ex-UvsPmTxOYXfjxyJaGkIY6StTY,46532
|
251
|
-
bec_widgets-0.81.
|
252
|
-
bec_widgets-0.81.
|
253
|
-
bec_widgets-0.81.
|
254
|
-
bec_widgets-0.81.
|
255
|
-
bec_widgets-0.81.
|
233
|
+
bec_widgets-0.81.2.dist-info/METADATA,sha256=VfAwsgdfE-Y03bigTY5y9gl9q-WmgX1yU8h-2OqucmI,1309
|
234
|
+
bec_widgets-0.81.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
235
|
+
bec_widgets-0.81.2.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
|
236
|
+
bec_widgets-0.81.2.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
|
237
|
+
bec_widgets-0.81.2.dist-info/RECORD,,
|
pyproject.toml
CHANGED
@@ -1,250 +0,0 @@
|
|
1
|
-
# pylint: disable = no-name-in-module,missing-class-docstring, missing-module-docstring
|
2
|
-
|
3
|
-
import qdarktheme
|
4
|
-
from qtpy.QtCore import Qt
|
5
|
-
from qtpy.QtWidgets import QApplication, QSplitter, QVBoxLayout, QWidget
|
6
|
-
|
7
|
-
from bec_widgets.utils.bec_dispatcher import BECDispatcher
|
8
|
-
from bec_widgets.widgets.motor_control.motor_control import MotorThread
|
9
|
-
from bec_widgets.widgets.motor_control.motor_table.motor_table import MotorCoordinateTable
|
10
|
-
from bec_widgets.widgets.motor_control.movement_absolute.movement_absolute import (
|
11
|
-
MotorControlAbsolute,
|
12
|
-
)
|
13
|
-
from bec_widgets.widgets.motor_control.movement_relative.movement_relative import (
|
14
|
-
MotorControlRelative,
|
15
|
-
)
|
16
|
-
from bec_widgets.widgets.motor_control.selection.selection import MotorControlSelection
|
17
|
-
|
18
|
-
CONFIG_DEFAULT = {
|
19
|
-
"motor_control": {
|
20
|
-
"motor_x": "samx",
|
21
|
-
"motor_y": "samy",
|
22
|
-
"step_size_x": 3,
|
23
|
-
"step_size_y": 3,
|
24
|
-
"precision": 4,
|
25
|
-
"step_x_y_same": False,
|
26
|
-
"move_with_arrows": False,
|
27
|
-
},
|
28
|
-
"plot_settings": {
|
29
|
-
"colormap": "Greys",
|
30
|
-
"scatter_size": 5,
|
31
|
-
"max_points": 1000,
|
32
|
-
"num_dim_points": 100,
|
33
|
-
"precision": 2,
|
34
|
-
"num_columns": 1,
|
35
|
-
"background_value": 25,
|
36
|
-
},
|
37
|
-
"motors": [
|
38
|
-
{
|
39
|
-
"plot_name": "Motor Map",
|
40
|
-
"x_label": "Motor X",
|
41
|
-
"y_label": "Motor Y",
|
42
|
-
"signals": {
|
43
|
-
"x": [{"name": "samx", "entry": "samx"}],
|
44
|
-
"y": [{"name": "samy", "entry": "samy"}],
|
45
|
-
},
|
46
|
-
}
|
47
|
-
],
|
48
|
-
}
|
49
|
-
|
50
|
-
|
51
|
-
class MotorControlApp(QWidget):
|
52
|
-
def __init__(self, parent=None, client=None, config=None):
|
53
|
-
super().__init__(parent)
|
54
|
-
|
55
|
-
bec_dispatcher = BECDispatcher()
|
56
|
-
self.client = bec_dispatcher.client if client is None else client
|
57
|
-
self.config = config
|
58
|
-
|
59
|
-
# Widgets
|
60
|
-
self.motor_control_panel = MotorControlPanel(client=self.client, config=self.config)
|
61
|
-
# Create MotorMap
|
62
|
-
# self.motion_map = MotorMap(client=self.client, config=self.config)
|
63
|
-
# Create MotorCoordinateTable
|
64
|
-
self.motor_table = MotorCoordinateTable(client=self.client, config=self.config)
|
65
|
-
|
66
|
-
# Create the splitter and add MotorMap and MotorControlPanel
|
67
|
-
splitter = QSplitter(Qt.Horizontal)
|
68
|
-
# splitter.addWidget(self.motion_map)
|
69
|
-
splitter.addWidget(self.motor_control_panel)
|
70
|
-
splitter.addWidget(self.motor_table)
|
71
|
-
|
72
|
-
# Set the main layout
|
73
|
-
layout = QVBoxLayout(self)
|
74
|
-
layout.addWidget(splitter)
|
75
|
-
self.setLayout(layout)
|
76
|
-
|
77
|
-
# Connecting signals and slots
|
78
|
-
# self.motor_control_panel.selection_widget.selected_motors_signal.connect(
|
79
|
-
# lambda x, y: self.motion_map.change_motors(x, y, 0)
|
80
|
-
# )
|
81
|
-
self.motor_control_panel.absolute_widget.coordinates_signal.connect(
|
82
|
-
self.motor_table.add_coordinate
|
83
|
-
)
|
84
|
-
self.motor_control_panel.relative_widget.precision_signal.connect(
|
85
|
-
self.motor_table.set_precision
|
86
|
-
)
|
87
|
-
self.motor_control_panel.relative_widget.precision_signal.connect(
|
88
|
-
self.motor_control_panel.absolute_widget.set_precision
|
89
|
-
)
|
90
|
-
|
91
|
-
# self.motor_table.plot_coordinates_signal.connect(self.motion_map.plot_saved_coordinates)
|
92
|
-
|
93
|
-
|
94
|
-
class MotorControlMap(QWidget):
|
95
|
-
def __init__(self, parent=None, client=None, config=None):
|
96
|
-
super().__init__(parent)
|
97
|
-
|
98
|
-
bec_dispatcher = BECDispatcher()
|
99
|
-
self.client = bec_dispatcher.client if client is None else client
|
100
|
-
self.config = config
|
101
|
-
|
102
|
-
# Widgets
|
103
|
-
self.motor_control_panel = MotorControlPanel(client=self.client, config=self.config)
|
104
|
-
# Create MotorMap
|
105
|
-
# self.motion_map = MotorMap(client=self.client, config=self.config)
|
106
|
-
|
107
|
-
# Create the splitter and add MotorMap and MotorControlPanel
|
108
|
-
splitter = QSplitter(Qt.Horizontal)
|
109
|
-
# splitter.addWidget(self.motion_map)
|
110
|
-
splitter.addWidget(self.motor_control_panel)
|
111
|
-
|
112
|
-
# Set the main layout
|
113
|
-
layout = QVBoxLayout(self)
|
114
|
-
layout.addWidget(splitter)
|
115
|
-
self.setLayout(layout)
|
116
|
-
|
117
|
-
# Connecting signals and slots
|
118
|
-
# self.motor_control_panel.selection_widget.selected_motors_signal.connect(
|
119
|
-
# lambda x, y: self.motion_map.change_motors(x, y, 0)
|
120
|
-
# )
|
121
|
-
|
122
|
-
|
123
|
-
class MotorControlPanel(QWidget):
|
124
|
-
def __init__(self, parent=None, client=None, config=None):
|
125
|
-
super().__init__(parent)
|
126
|
-
|
127
|
-
bec_dispatcher = BECDispatcher()
|
128
|
-
self.client = bec_dispatcher.client if client is None else client
|
129
|
-
self.config = config
|
130
|
-
|
131
|
-
self.motor_thread = MotorThread(client=self.client)
|
132
|
-
|
133
|
-
self.selection_widget = MotorControlSelection(
|
134
|
-
client=self.client, config=self.config, motor_thread=self.motor_thread
|
135
|
-
)
|
136
|
-
self.relative_widget = MotorControlRelative(
|
137
|
-
client=self.client, config=self.config, motor_thread=self.motor_thread
|
138
|
-
)
|
139
|
-
self.absolute_widget = MotorControlAbsolute(
|
140
|
-
client=self.client, config=self.config, motor_thread=self.motor_thread
|
141
|
-
)
|
142
|
-
|
143
|
-
layout = QVBoxLayout(self)
|
144
|
-
|
145
|
-
layout.addWidget(self.selection_widget)
|
146
|
-
layout.addWidget(self.relative_widget)
|
147
|
-
layout.addWidget(self.absolute_widget)
|
148
|
-
|
149
|
-
# Connecting signals and slots
|
150
|
-
self.selection_widget.selected_motors_signal.connect(self.relative_widget.change_motors)
|
151
|
-
self.selection_widget.selected_motors_signal.connect(self.absolute_widget.change_motors)
|
152
|
-
|
153
|
-
# Set the window to a fixed size based on its contents
|
154
|
-
# self.layout().setSizeConstraint(layout.SetFixedSize)
|
155
|
-
|
156
|
-
|
157
|
-
class MotorControlPanelAbsolute(QWidget):
|
158
|
-
def __init__(self, parent=None, client=None, config=None):
|
159
|
-
super().__init__(parent)
|
160
|
-
|
161
|
-
bec_dispatcher = BECDispatcher()
|
162
|
-
self.client = bec_dispatcher.client if client is None else client
|
163
|
-
self.config = config
|
164
|
-
|
165
|
-
self.motor_thread = MotorThread(client=self.client)
|
166
|
-
|
167
|
-
self.selection_widget = MotorControlSelection(
|
168
|
-
client=client, config=config, motor_thread=self.motor_thread
|
169
|
-
)
|
170
|
-
self.absolute_widget = MotorControlAbsolute(
|
171
|
-
client=client, config=config, motor_thread=self.motor_thread
|
172
|
-
)
|
173
|
-
|
174
|
-
layout = QVBoxLayout(self)
|
175
|
-
layout.addWidget(self.selection_widget)
|
176
|
-
layout.addWidget(self.absolute_widget)
|
177
|
-
|
178
|
-
# Connecting signals and slots
|
179
|
-
self.selection_widget.selected_motors_signal.connect(self.absolute_widget.change_motors)
|
180
|
-
|
181
|
-
|
182
|
-
class MotorControlPanelRelative(QWidget):
|
183
|
-
def __init__(self, parent=None, client=None, config=None):
|
184
|
-
super().__init__(parent)
|
185
|
-
|
186
|
-
bec_dispatcher = BECDispatcher()
|
187
|
-
self.client = bec_dispatcher.client if client is None else client
|
188
|
-
self.config = config
|
189
|
-
|
190
|
-
self.motor_thread = MotorThread(client=self.client)
|
191
|
-
|
192
|
-
self.selection_widget = MotorControlSelection(
|
193
|
-
client=client, config=config, motor_thread=self.motor_thread
|
194
|
-
)
|
195
|
-
self.relative_widget = MotorControlRelative(
|
196
|
-
client=client, config=config, motor_thread=self.motor_thread
|
197
|
-
)
|
198
|
-
|
199
|
-
layout = QVBoxLayout(self)
|
200
|
-
layout.addWidget(self.selection_widget)
|
201
|
-
layout.addWidget(self.relative_widget)
|
202
|
-
|
203
|
-
# Connecting signals and slots
|
204
|
-
self.selection_widget.selected_motors_signal.connect(self.relative_widget.change_motors)
|
205
|
-
|
206
|
-
|
207
|
-
if __name__ == "__main__": # pragma: no cover
|
208
|
-
import argparse
|
209
|
-
import sys
|
210
|
-
|
211
|
-
parser = argparse.ArgumentParser(description="Run various Motor Control Widgets compositions.")
|
212
|
-
parser.add_argument(
|
213
|
-
"-v",
|
214
|
-
"--variant",
|
215
|
-
type=str,
|
216
|
-
choices=["app", "map", "panel", "panel_abs", "panel_rel"],
|
217
|
-
help="Select the variant of the motor control to run. "
|
218
|
-
"'app' for the full application, "
|
219
|
-
"'map' for MotorMap, "
|
220
|
-
"'panel' for the MotorControlPanel, "
|
221
|
-
"'panel_abs' for MotorControlPanel with absolute control, "
|
222
|
-
"'panel_rel' for MotorControlPanel with relative control.",
|
223
|
-
)
|
224
|
-
|
225
|
-
args = parser.parse_args()
|
226
|
-
|
227
|
-
bec_dispatcher = BECDispatcher()
|
228
|
-
client = bec_dispatcher.client
|
229
|
-
client.start()
|
230
|
-
|
231
|
-
app = QApplication([])
|
232
|
-
qdarktheme.setup_theme("auto")
|
233
|
-
|
234
|
-
if args.variant == "app":
|
235
|
-
window = MotorControlApp(client=client) # , config=CONFIG_DEFAULT)
|
236
|
-
elif args.variant == "map":
|
237
|
-
window = MotorControlMap(client=client) # , config=CONFIG_DEFAULT)
|
238
|
-
elif args.variant == "panel":
|
239
|
-
window = MotorControlPanel(client=client) # , config=CONFIG_DEFAULT)
|
240
|
-
elif args.variant == "panel_abs":
|
241
|
-
window = MotorControlPanelAbsolute(client=client) # , config=CONFIG_DEFAULT)
|
242
|
-
elif args.variant == "panel_rel":
|
243
|
-
window = MotorControlPanelRelative(client=client) # , config=CONFIG_DEFAULT)
|
244
|
-
else:
|
245
|
-
print("Please specify a valid variant to run. Use -h for help.")
|
246
|
-
print("Running the full application by default.")
|
247
|
-
window = MotorControlApp(client=client) # , config=CONFIG_DEFAULT)
|
248
|
-
|
249
|
-
window.show()
|
250
|
-
sys.exit(app.exec())
|