bec-widgets 0.80.1__py3-none-any.whl → 0.81.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. CHANGELOG.md +12 -12
  2. PKG-INFO +1 -1
  3. bec_widgets/examples/__init__.py +0 -9
  4. bec_widgets/widgets/buttons/color_button/color_button.py +19 -0
  5. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/METADATA +1 -1
  6. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/RECORD +10 -28
  7. pyproject.toml +1 -1
  8. bec_widgets/examples/motor_movement/__init__.py +0 -9
  9. bec_widgets/examples/motor_movement/motor_control_compilations.py +0 -250
  10. bec_widgets/examples/motor_movement/motor_controller.ui +0 -926
  11. bec_widgets/widgets/motor_control/__init__.py +0 -0
  12. bec_widgets/widgets/motor_control/motor_control.py +0 -252
  13. bec_widgets/widgets/motor_control/motor_table/__init__.py +0 -0
  14. bec_widgets/widgets/motor_control/motor_table/motor_table.py +0 -484
  15. bec_widgets/widgets/motor_control/motor_table/motor_table.ui +0 -113
  16. bec_widgets/widgets/motor_control/movement_absolute/__init__.py +0 -0
  17. bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py +0 -159
  18. bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.ui +0 -149
  19. bec_widgets/widgets/motor_control/movement_relative/__init__.py +0 -0
  20. bec_widgets/widgets/motor_control/movement_relative/movement_relative.py +0 -230
  21. bec_widgets/widgets/motor_control/movement_relative/movement_relative.ui +0 -298
  22. bec_widgets/widgets/motor_control/selection/__init__.py +0 -0
  23. bec_widgets/widgets/motor_control/selection/selection.py +0 -110
  24. bec_widgets/widgets/motor_control/selection/selection.ui +0 -69
  25. tests/unit_tests/test_motor_control.py +0 -588
  26. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/WHEEL +0 -0
  27. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/entry_points.txt +0 -0
  28. {bec_widgets-0.80.1.dist-info → bec_widgets-0.81.1.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.81.1 (2024-07-07)
4
+
5
+ ### Fix
6
+
7
+ * fix(motor_control): temporary remove of motor control widgets ([`99114f1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/99114f14f62202e1fd8bf145616fa8c69937ada4))
8
+
9
+ ## v0.81.0 (2024-07-06)
10
+
11
+ ### Feature
12
+
13
+ * feat(color_button): can get colors in RGBA or HEX ([`9594be2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9594be260680d11c8550ff74ffb8d679e5a5b8f6))
14
+
3
15
  ## v0.80.1 (2024-07-06)
4
16
 
5
17
  ### Fix
@@ -129,15 +141,3 @@
129
141
  ### Unknown
130
142
 
131
143
  * fix:parent set as first kwarg TextBox and WebsiteWidget ([`a45c407`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a45c4075684b93bfdcee03e5a416b84f61d3bc6f))
132
-
133
- ## v0.75.0 (2024-06-26)
134
-
135
- ### Feature
136
-
137
- * feat(widgets): added simple bec queue widget ([`3faee98`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3faee98ec80041a27e4c1f1156178de6f9dcdc63))
138
-
139
- ### Refactor
140
-
141
- * refactor(dispatcher): cleanup ([`ca02132`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ca02132c8d18535b37e9192e00459d2aca6ba5cf))
142
-
143
- ## v0.74.1 (2024-06-26)
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.80.1
3
+ Version: 0.81.1
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
@@ -1,9 +0,0 @@
1
- from .motor_movement import (
2
- MotorControlApp,
3
- MotorControlMap,
4
- MotorControlPanel,
5
- MotorControlPanelAbsolute,
6
- MotorControlPanelRelative,
7
- MotorCoordinateTable,
8
- MotorThread,
9
- )
@@ -1,3 +1,7 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import Literal
4
+
1
5
  import pyqtgraph as pg
2
6
 
3
7
 
@@ -15,3 +19,18 @@ class ColorButton(pg.ColorButton):
15
19
  self.colorDialog.setCurrentColor(self.color())
16
20
  self.colorDialog.open()
17
21
  self.colorDialog.exec()
22
+
23
+ def get_color(self, format: Literal["RGBA", "HEX"] = "RGBA") -> tuple | str:
24
+ """
25
+ Get the color of the button in the specified format.
26
+
27
+ Args:
28
+ format(Literal["RGBA", "HEX"]): The format of the returned color.
29
+
30
+ Returns:
31
+ tuple|str: The color in the specified format.
32
+ """
33
+ if format == "RGBA":
34
+ return self.color().getRgb()
35
+ if format == "HEX":
36
+ return self.color().name()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.80.1
3
+ Version: 0.81.1
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
@@ -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=zyzr2iWHZZpH8Zcb3Q2EdAEd9KzpMkzIVhoUpNbiTQw,6794
5
+ CHANGELOG.md,sha256=W9XR-rYh7t3zY1bRlnIahn2zpqaDrPcTt7aRKTXwAwc,6826
6
6
  LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
7
- PKG-INFO,sha256=W5BiUCnKEu7UtciQ89fZp4AqzfUxwuHdNW84R2Yg8IQ,1309
7
+ PKG-INFO,sha256=iC_enZjkeS3eb0_OWFePjHBFeUAK_XzT9m58EUz5_8U,1309
8
8
  README.md,sha256=Od69x-RS85Hph0-WwWACwal4yUd67XkEn4APEfHhHFw,2649
9
- pyproject.toml,sha256=1-rpTxKUDLOPeIAe91QcKJEY1P0YgefF2Gz60Z8VJzI,2358
9
+ pyproject.toml,sha256=v0tcEeOW9aQHcN_w9BuTjwLWzw0NZG1fWwXZ4DdrAcI,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=WWQ0cu7m8sA4Ehy-DWdTIqSISjaHsbxhsNmNrMnhDZU,202
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
@@ -72,7 +69,7 @@ bec_widgets/widgets/bec_status_box/register_bec_status_box.py,sha256=EiQITnkNw7I
72
69
  bec_widgets/widgets/bec_status_box/status_item.py,sha256=2SoMmgHL_MFnr7XiStFjLolHh0Vs3P68ZvP8kMIGc8w,5046
73
70
  bec_widgets/widgets/buttons/__init__.py,sha256=74ucIRU6-anoqQ-zT7wbrysmxhg_3_04xGhN_kllNUI,48
74
71
  bec_widgets/widgets/buttons/color_button/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
- bec_widgets/widgets/buttons/color_button/color_button.py,sha256=AJUMOQVLd4H39wzW2MJLhGAww7a1NtjivTkfexVhHHo,512
72
+ bec_widgets/widgets/buttons/color_button/color_button.py,sha256=Faszdcu6iJo2n0fdAORvKMf926Le9f454t6JIIZRc-0,1049
76
73
  bec_widgets/widgets/buttons/color_button/color_button.pyproject,sha256=LUYF4VkDOB4ttVe7YfvLh64K-XZg0-xaVT06BqCT3UA,30
77
74
  bec_widgets/widgets/buttons/color_button/color_button_plugin.py,sha256=4phedgYl94PAn2VL-_IPIU3rKq6dwDGgHXyk5c2HcgU,1264
78
75
  bec_widgets/widgets/buttons/color_button/register_color_button.py,sha256=PqsqOMNcdBL956mRIRFau4emb0bExuEtI9_l1l6rf88,483
@@ -114,20 +111,6 @@ bec_widgets/widgets/figure/plots/waveform/waveform.py,sha256=GW8dInC7Wd4sNp6vCGY
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.80.1.dist-info/METADATA,sha256=W5BiUCnKEu7UtciQ89fZp4AqzfUxwuHdNW84R2Yg8IQ,1309
252
- bec_widgets-0.80.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
253
- bec_widgets-0.80.1.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
254
- bec_widgets-0.80.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
255
- bec_widgets-0.80.1.dist-info/RECORD,,
233
+ bec_widgets-0.81.1.dist-info/METADATA,sha256=iC_enZjkeS3eb0_OWFePjHBFeUAK_XzT9m58EUz5_8U,1309
234
+ bec_widgets-0.81.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
235
+ bec_widgets-0.81.1.dist-info/entry_points.txt,sha256=3otEkCdDB9LZJuBLzG4pFLK5Di0CVybN_12IsZrQ-58,166
236
+ bec_widgets-0.81.1.dist-info/licenses/LICENSE,sha256=YRKe85CBRyP7UpEAWwU8_qSIyuy5-l_9C-HKg5Qm8MQ,1511
237
+ bec_widgets-0.81.1.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.80.1"
7
+ version = "0.81.1"
8
8
  description = "BEC Widgets"
9
9
  requires-python = ">=3.10"
10
10
  classifiers = [
@@ -1,9 +0,0 @@
1
- from .motor_control_compilations import (
2
- MotorControlApp,
3
- MotorControlMap,
4
- MotorControlPanel,
5
- MotorControlPanelAbsolute,
6
- MotorControlPanelRelative,
7
- MotorCoordinateTable,
8
- MotorThread,
9
- )
@@ -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())