bec-widgets 0.52.1__py3-none-any.whl → 0.53.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.
Files changed (67) hide show
  1. .git_hooks/pre-commit +3 -0
  2. .gitignore +177 -0
  3. .gitlab/issue_templates/bug_report_template.md +17 -0
  4. .gitlab/issue_templates/documentation_update_template.md +27 -0
  5. .gitlab/issue_templates/feature_request_template.md +40 -0
  6. .gitlab/merge_request_templates/default.md +28 -0
  7. .gitlab-ci.yml +225 -0
  8. .pylintrc +581 -0
  9. .readthedocs.yaml +25 -0
  10. CHANGELOG.md +176 -0
  11. PKG-INFO +33 -0
  12. bec_widgets-0.52.1.dist-info/METADATA → README.md +6 -42
  13. bec_widgets/cli/client.py +9 -9
  14. bec_widgets/cli/rpc_wigdet_handler.py +1 -3
  15. bec_widgets/examples/modular_app/___init__.py +0 -0
  16. bec_widgets/examples/modular_app/modular.ui +92 -0
  17. bec_widgets/examples/modular_app/modular_app.py +197 -0
  18. bec_widgets/examples/motor_movement/motor_control_compilations.py +1 -1
  19. bec_widgets/examples/motor_movement/motor_example.py +3 -12
  20. bec_widgets/utils/bec_dispatcher.py +1 -3
  21. bec_widgets/widgets/dock/dock_area.py +1 -4
  22. bec_widgets/widgets/figure/figure.py +3 -15
  23. bec_widgets/widgets/monitor/config_dialog.py +3 -19
  24. bec_widgets/widgets/monitor/example_configs/config_device.yaml +60 -0
  25. bec_widgets/widgets/monitor/example_configs/config_scans.yaml +92 -0
  26. bec_widgets/widgets/motor_map/motor_map.py +3 -14
  27. bec_widgets/widgets/plots/motor_map.py +2 -9
  28. bec_widgets/widgets/scan_control/scan_control.py +1 -3
  29. bec_widgets-0.53.0.dist-info/METADATA +33 -0
  30. {bec_widgets-0.52.1.dist-info → bec_widgets-0.53.0.dist-info}/RECORD +66 -23
  31. {bec_widgets-0.52.1.dist-info → bec_widgets-0.53.0.dist-info}/WHEEL +1 -2
  32. bec_widgets-0.53.0.dist-info/licenses/LICENSE +29 -0
  33. docs/Makefile +20 -0
  34. docs/_templates/custom-class-template.rst +34 -0
  35. docs/_templates/custom-module-template.rst +66 -0
  36. docs/conf.py +81 -0
  37. docs/developer/developer.md +26 -0
  38. docs/developer/reference.md +10 -0
  39. docs/index.md +39 -0
  40. docs/introduction/introduction.md +18 -0
  41. docs/make.bat +35 -0
  42. docs/requirements.txt +10 -0
  43. docs/user/apps/modular_app.md +6 -0
  44. docs/user/apps/motor_app.md +34 -0
  45. docs/user/apps/motor_app_10fps.gif +0 -0
  46. docs/user/apps/plot_app.md +6 -0
  47. docs/user/apps.md +39 -0
  48. docs/user/customisation.md +13 -0
  49. docs/user/installation.md +46 -0
  50. docs/user/user.md +38 -0
  51. docs/user/widgets/motor.gif +0 -0
  52. docs/user/widgets/scatter_2D.gif +0 -0
  53. docs/user/widgets/w1D.gif +0 -0
  54. docs/user/widgets.md +41 -0
  55. pyproject.toml +94 -0
  56. tests/unit_tests/test_bec_dispatcher.py +3 -26
  57. tests/unit_tests/test_bec_figure.py +1 -5
  58. tests/unit_tests/test_bec_motor_map.py +1 -4
  59. tests/unit_tests/test_config_dialog.py +1 -5
  60. tests/unit_tests/test_configs/config_device.yaml +33 -0
  61. tests/unit_tests/test_configs/config_device_no_entry.yaml +27 -0
  62. tests/unit_tests/test_configs/config_scan.yaml +82 -0
  63. tests/unit_tests/test_motor_control.py +1 -1
  64. tests/unit_tests/test_motor_map.py +5 -20
  65. tests/unit_tests/test_stream_plot.py +2 -12
  66. bec_widgets-0.52.1.dist-info/top_level.txt +0 -2
  67. /bec_widgets-0.52.1.dist-info/LICENSE → /LICENSE +0 -0
CHANGELOG.md ADDED
@@ -0,0 +1,176 @@
1
+ # CHANGELOG
2
+
3
+
4
+
5
+ ## v0.53.0 (2024-05-09)
6
+
7
+ ### Ci
8
+
9
+ * ci: use formatter config of toml file ([`5cc816d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5cc816d0af73e20c648e044a027c589704ab1625))
10
+
11
+ ### Documentation
12
+
13
+ * docs: update install instructions ([`57ee735`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/57ee735e5c2436d45a285507cdc939daa20e8e8f))
14
+
15
+ ### Feature
16
+
17
+ * feat: moved to pyproject.toml; closes #162 ([`c86ce30`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c86ce302a964d71ee631f0817609ab5aa0e3ab0f))
18
+
19
+ ### Fix
20
+
21
+ * fix: fixed semver job and upgraded to v9 ([`32e1a9d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/32e1a9d8472eb1c25d30697d407a8ffecd04e75d))
22
+
23
+ ### Refactor
24
+
25
+ * refactor: applied formatter ([`4117fd7`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4117fd7b5b2090ff4fb7ad9e0d92cc87cd13ed5f))
26
+
27
+
28
+ ## v0.52.1 (2024-05-08)
29
+
30
+ ### Fix
31
+
32
+ * fix(docstrings): docstrings formating fixed for sphinx to properly format readdocs ([`7f2f7cd`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7f2f7cd07a14876617cd83cedde8c281fdc52c3a))
33
+
34
+
35
+ ## v0.52.0 (2024-05-07)
36
+
37
+ ### Ci
38
+
39
+ * ci: fixed support for child pipelines ([`e65c7f3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e65c7f3be895ada407bd358edf67d569d2cab08e))
40
+
41
+ ### Feature
42
+
43
+ * feat(utils/layout_manager): added GridLayoutManager to extend functionalities of native QGridLayout ([`fcd6ef0`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fcd6ef0975dc872f69c9d6fb2b8a1ad04a423aae))
44
+
45
+ * feat(widget/dock): BECDock and BECDock area for dockable windows ([`d8ff8af`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d8ff8afcd474660a6069bbdab05f10a65f221727))
46
+
47
+ ### Fix
48
+
49
+ * fix(widgets/dock): BECDockArea close overwrites the default pyqtgraph Container close + minor improvements ([`ceae979`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ceae979f375ecc33c5c97148f197655c1ca57b6c))
50
+
51
+ ### Refactor
52
+
53
+ * refactor(widget/plots): WidgetConfig changed to SubplotConfig ([`03fa1f2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/03fa1f26d0fa6b58ed05556fb2438d1e62f6c107))
54
+
55
+
56
+ ## v0.51.0 (2024-05-07)
57
+
58
+ ### Build
59
+
60
+ * build(cli): changed repo name to bec_widgets ([`799ea55`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/799ea554de9a7f3720d100be4886a63f02c6a390))
61
+
62
+ * build(setup): fakeredis added to dev env ([`df32350`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/df323504fea024a97304d96c2e39e61450714069))
63
+
64
+ * build(setup): PyQt6 version is set to 6.7 ([`0ab8aa3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0ab8aa3a2fe51b5c38b25fca44c1c422bb42478d))
65
+
66
+ ### Ci
67
+
68
+ * ci: added rule for parent-child pipelines ([`e085125`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e0851250eecb85503db929d37f75d2ba366308a6))
69
+
70
+ ### Feature
71
+
72
+ * feat(utils): added plugin helper to find and load ([`5ece269`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/5ece269adb0e9b0c2a468f1dfbaa6212e86d3561))
73
+
74
+
75
+ ## v0.50.2 (2024-04-30)
76
+
77
+ ### Fix
78
+
79
+ * fix: 'disconnect_slot' has to be symmetric with 'connect_slot' regarding QtThreadSafeCallback ([`0dfcaa4`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0dfcaa4b708948af0a40ec7cf34d03ff1e96ffac))
80
+
81
+
82
+ ## v0.50.1 (2024-04-29)
83
+
84
+ ### Fix
85
+
86
+ * fix(cli): BECFigure takes the port to connect to redis from the current BECClient, supporting plugins ([`57cb136`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/57cb136a098e87a452414bf44e627edb562f6799))
87
+
88
+
89
+ ## v0.50.0 (2024-04-29)
90
+
91
+ ### Feature
92
+
93
+ * feat(plots): universal cleanup and remove also for children items ([`381d713`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/381d713837bb9217c58ba1d8b89691aa35c9f5ec))
94
+
95
+ * feat(rpc/rpc_register): singleton rpc register for all rpc connections for session ([`a898e7e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a898e7e4f14e9ae854703dddbd1eb8c50cb640ff))
96
+
97
+ ### Fix
98
+
99
+ * fix(widgets/figure): access pattern changed for getting widgets by coordinates for rpc ([`13c018a`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/13c018a79704a7497c140df57179d294e43ecffa))
100
+
101
+ * fix(plots): cleanup policy reviewed for children items ([`8f20a0b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8f20a0b3b1b5dd117b36b45645717190b9ee9cbf))
102
+
103
+ * fix(rpc/client_utils): getoutput more transparent + error handling ([`6b6a6b2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6b6a6b2249f24d3d02bd5fcd7ef1c63ed794c304))
104
+
105
+ * fix(rpc_register): thread lock for listign all connections ([`2ca3267`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/2ca32675ec3f00137e2140259db51f6e5aa7bb71))
106
+
107
+ ### Test
108
+
109
+ * test(cli/rpc_register): e2e RPCRegister ([`4f261be`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/4f261be4c7cfe54501443d031f9266f4f838f6e2))
110
+
111
+ * test(cli/rpc_register): rpc_register tests added ([`40eb75f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/40eb75f85a4d99d498b086a37e799276a9d2ac3f))
112
+
113
+
114
+ ## v0.49.1 (2024-04-26)
115
+
116
+ ### Build
117
+
118
+ * build(pyqt6): fixing PyQt6-Qt6 package to 6.6.3 ([`a222298`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a22229849cbb57c15e4c1bae02d7e52e672f8c4c))
119
+
120
+ ### Fix
121
+
122
+ * fix(widgets/editor): qscintilla editor removed ([`ab85374`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ab8537483da6c87cb9a0b0f01706208c964f292d))
123
+
124
+
125
+ ## v0.49.0 (2024-04-24)
126
+
127
+ ### Feature
128
+
129
+ * feat(rpc/client_utils): timeout for rpc response ([`6500a00`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6500a00682a2a7ca535a138bd9496ed8470856a8))
130
+
131
+ ### Fix
132
+
133
+ * fix(rpc/client_utils): close clean up policy for BECFigure ([`9602085`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9602085f82cbc983f89b5bfe48bf35f08438fa87))
134
+
135
+
136
+ ## v0.48.0 (2024-04-24)
137
+
138
+ ### Feature
139
+
140
+ * feat(cli): added auto updates plugin support ([`6238693`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6238693ffb44b47a56b969bc4129f2af7a2c04fe))
141
+
142
+
143
+ ## v0.47.0 (2024-04-23)
144
+
145
+ ### Feature
146
+
147
+ * feat(utils/thread_checker): util class to check the thread leakage for closeEvent in qt ([`71cb80d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/71cb80d544c5f4ef499379a431ce0c17907c7ce8))
148
+
149
+ ### Refactor
150
+
151
+ * refactor(utils/container_utils): part of the logic regarding locating widgets moved from BECFigure to utility class ([`77ff796`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/77ff7962cc91bce15d1c91b67b75b66fbea612c3))
152
+
153
+
154
+ ## v0.46.7 (2024-04-21)
155
+
156
+ ### Fix
157
+
158
+ * fix(plot/image): monitors are now validated with current bec session ([`67a99a1`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/67a99a1a19c261f9a1f09635f274cd9fbfe53639))
159
+
160
+
161
+ ## v0.46.6 (2024-04-19)
162
+
163
+ ### Ci
164
+
165
+ * ci: changed ophyd default branch to main ([`81484e8`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/81484e8160a4a09907313ed747c27ab3b6cbfdc4))
166
+
167
+ ### Fix
168
+
169
+ * fix(cli): fixed support for devices as cli input ([`1111610`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1111610f3206c5c46db6b4bd1e8827f1a4cd9e3f))
170
+
171
+
172
+ ## v0.46.5 (2024-04-19)
173
+
174
+ ### Test
175
+
176
+ * test(rpc/bec_figure): test_rpc_plotting_shortcuts_init_configs extended by testing scatter z gradient for BECWaveform through RPC ([`a156803`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a1568033899bbcdbd457e697d6c8d478df26ba54))
PKG-INFO ADDED
@@ -0,0 +1,33 @@
1
+ Metadata-Version: 2.3
2
+ Name: bec_widgets
3
+ Version: 0.53.0
4
+ Summary: BEC Widgets
5
+ Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec_widgets/issues
6
+ Project-URL: Homepage, https://gitlab.psi.ch/bec/bec_widgets
7
+ License-File: LICENSE
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Topic :: Scientific/Engineering
11
+ Requires-Python: >=3.10
12
+ Requires-Dist: bec-lib
13
+ Requires-Dist: black
14
+ Requires-Dist: h5py
15
+ Requires-Dist: jedi
16
+ Requires-Dist: pydantic
17
+ Requires-Dist: pyqtdarktheme
18
+ Requires-Dist: pyqtgraph
19
+ Requires-Dist: qtconsole
20
+ Requires-Dist: qtpy
21
+ Requires-Dist: zmq
22
+ Provides-Extra: dev
23
+ Requires-Dist: coverage; extra == 'dev'
24
+ Requires-Dist: fakeredis; extra == 'dev'
25
+ Requires-Dist: isort; extra == 'dev'
26
+ Requires-Dist: pytest; extra == 'dev'
27
+ Requires-Dist: pytest-qt; extra == 'dev'
28
+ Requires-Dist: pytest-random-order; extra == 'dev'
29
+ Requires-Dist: pytest-timeout; extra == 'dev'
30
+ Provides-Extra: pyqt5
31
+ Requires-Dist: pyqt5>=5.9; extra == 'pyqt5'
32
+ Provides-Extra: pyqt6
33
+ Requires-Dist: pyqt6>=6.7; extra == 'pyqt6'
@@ -1,40 +1,3 @@
1
- Metadata-Version: 2.1
2
- Name: bec-widgets
3
- Version: 0.52.1
4
- Summary: BEC Widgets
5
- Home-page: https://gitlab.psi.ch/bec/bec-widgets
6
- Project-URL: Bug Tracker, https://gitlab.psi.ch/bec/bec-widgets/issues
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Topic :: Scientific/Engineering
10
- Requires-Python: >=3.10
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
- Requires-Dist: pydantic
14
- Requires-Dist: qtconsole
15
- Requires-Dist: PyQt6 >=6.7
16
- Requires-Dist: jedi
17
- Requires-Dist: qtpy
18
- Requires-Dist: pyqtgraph
19
- Requires-Dist: bec-lib
20
- Requires-Dist: zmq
21
- Requires-Dist: h5py
22
- Requires-Dist: pyqtdarktheme
23
- Requires-Dist: black
24
- Provides-Extra: dev
25
- Requires-Dist: pytest ; extra == 'dev'
26
- Requires-Dist: pytest-random-order ; extra == 'dev'
27
- Requires-Dist: pytest-timeout ; extra == 'dev'
28
- Requires-Dist: coverage ; extra == 'dev'
29
- Requires-Dist: pytest-qt ; extra == 'dev'
30
- Requires-Dist: black ; extra == 'dev'
31
- Requires-Dist: isort ; extra == 'dev'
32
- Requires-Dist: fakeredis ; extra == 'dev'
33
- Provides-Extra: pyqt5
34
- Requires-Dist: PyQt5 >=5.9 ; extra == 'pyqt5'
35
- Provides-Extra: pyqt6
36
- Requires-Dist: PyQt6 >=6.7 ; extra == 'pyqt6'
37
-
38
1
  # BEC Widgets
39
2
 
40
3
  BEC Widgets is a GUI framework designed for interaction with [BEC (Beamline Experiment Control)](https://gitlab.psi.ch/bec/bec).
@@ -43,7 +6,7 @@ BEC Widgets is a GUI framework designed for interaction with [BEC (Beamline Expe
43
6
  Use the package manager [pip](https://pip.pypa.io/en/stable/) to install BEC Widgets:
44
7
 
45
8
  ```bash
46
- pip install bec_widgets
9
+ pip install bec_widgets PyQt6
47
10
  ```
48
11
 
49
12
  For development purposes, you can clone the repository and install the package locally in editable mode:
@@ -51,10 +14,11 @@ For development purposes, you can clone the repository and install the package l
51
14
  ```bash
52
15
  git clone https://gitlab.psi.ch/bec/bec-widgets
53
16
  cd bec_widgets
54
- pip install -e .[dev]
17
+ pip install -e .[dev,pyqt6]
55
18
  ```
56
19
 
57
- BEC Widgets currently supports both PyQt5 and PyQt6. By default, PyQt6 is installed.
20
+ BEC Widgets currently supports both PyQt5 and PyQt6, however, no default distribution is specified. As a result, users must install one of the supported
21
+ Python Qt distributions manually.
58
22
 
59
23
  To select a specific Python Qt distribution, install the package with an additional tag:
60
24
 
@@ -68,7 +32,7 @@ pip install bec_widgets[pyqt5]
68
32
  ```
69
33
  ## Documentation
70
34
 
71
- Documentation of BEC Widgets can be found [here](https://bec-widgets.readthedocs.io/en/latest/). The documentation of the BEC can be found [here](https://beamline-experiment-control.readthedocs.io/en/latest/).
35
+ Documentation of BEC Widgets can be found [here](https://bec-widgets.readthedocs.io/en/latest/). The documentation of the BEC can be found [here](https://bec.readthedocs.io/en/latest/).
72
36
 
73
37
  ## Contributing
74
38
 
@@ -107,4 +71,4 @@ All commits should use the Angular commit scheme:
107
71
 
108
72
  ## License
109
73
 
110
- [BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)
74
+ [BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)
bec_widgets/cli/client.py CHANGED
@@ -177,7 +177,7 @@ class BECWaveform(RPCBase):
177
177
  color_map_z: "Optional[str]" = "plasma",
178
178
  label: "Optional[str]" = None,
179
179
  validate_bec: "bool" = True,
180
- **kwargs
180
+ **kwargs,
181
181
  ) -> "BECCurve":
182
182
  """
183
183
  Add a curve to the plot widget from the scan segment.
@@ -205,7 +205,7 @@ class BECWaveform(RPCBase):
205
205
  y: "list | np.ndarray",
206
206
  label: "str" = None,
207
207
  color: "str" = None,
208
- **kwargs
208
+ **kwargs,
209
209
  ) -> "BECCurve":
210
210
  """
211
211
  Add a custom data curve to the plot widget.
@@ -484,7 +484,7 @@ class BECFigure(RPCBase):
484
484
  row: "int" = None,
485
485
  col: "int" = None,
486
486
  config=None,
487
- **axis_kwargs
487
+ **axis_kwargs,
488
488
  ) -> "BECWaveform":
489
489
  """
490
490
  Add a Waveform1D plot to the figure at the specified position.
@@ -508,7 +508,7 @@ class BECFigure(RPCBase):
508
508
  row: "int" = None,
509
509
  col: "int" = None,
510
510
  config=None,
511
- **axis_kwargs
511
+ **axis_kwargs,
512
512
  ) -> "BECImageShow":
513
513
  """
514
514
  Add an image to the figure at the specified position.
@@ -536,7 +536,7 @@ class BECFigure(RPCBase):
536
536
  row: "int" = None,
537
537
  col: "int" = None,
538
538
  config=None,
539
- **axis_kwargs
539
+ **axis_kwargs,
540
540
  ) -> "BECMotorMap":
541
541
  """
542
542
  Args:
@@ -566,7 +566,7 @@ class BECFigure(RPCBase):
566
566
  color_map_z: "Optional[str]" = "plasma",
567
567
  label: "Optional[str]" = None,
568
568
  validate: "bool" = True,
569
- **axis_kwargs
569
+ **axis_kwargs,
570
570
  ) -> "BECWaveform":
571
571
  """
572
572
  Add a 1D waveform plot to the figure. Always access the first waveform widget in the figure.
@@ -598,7 +598,7 @@ class BECFigure(RPCBase):
598
598
  color_map: "str" = "magma",
599
599
  data: "np.ndarray" = None,
600
600
  vrange: "tuple[float, float]" = None,
601
- **axis_kwargs
601
+ **axis_kwargs,
602
602
  ) -> "BECImageShow":
603
603
  """
604
604
  Add an image to the figure. Always access the first image widget in the figure.
@@ -872,7 +872,7 @@ class BECImageShow(RPCBase):
872
872
  downsample: "Optional[bool]" = True,
873
873
  opacity: "Optional[float]" = 1.0,
874
874
  vrange: "Optional[tuple[int, int]]" = None,
875
- **kwargs
875
+ **kwargs,
876
876
  ) -> "BECImageItem":
877
877
  """
878
878
  None
@@ -888,7 +888,7 @@ class BECImageShow(RPCBase):
888
888
  downsample: "Optional[bool]" = True,
889
889
  opacity: "Optional[float]" = 1.0,
890
890
  vrange: "Optional[tuple[int, int]]" = None,
891
- **kwargs
891
+ **kwargs,
892
892
  ):
893
893
  """
894
894
  None
@@ -5,9 +5,7 @@ from bec_widgets.widgets.figure import BECFigure
5
5
  class RPCWidgetHandler:
6
6
  """Handler class for creating widgets from RPC messages."""
7
7
 
8
- widget_classes = {
9
- "BECFigure": BECFigure,
10
- }
8
+ widget_classes = {"BECFigure": BECFigure}
11
9
 
12
10
  @staticmethod
13
11
  def create_widget(widget_type, **kwargs) -> BECConnector:
File without changes
@@ -0,0 +1,92 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ui version="4.0">
3
+ <class>MainWindow</class>
4
+ <widget class="QMainWindow" name="MainWindow">
5
+ <property name="geometry">
6
+ <rect>
7
+ <x>0</x>
8
+ <y>0</y>
9
+ <width>1433</width>
10
+ <height>689</height>
11
+ </rect>
12
+ </property>
13
+ <property name="windowTitle">
14
+ <string>MainWindow</string>
15
+ </property>
16
+ <widget class="QWidget" name="centralwidget">
17
+ <layout class="QGridLayout" name="gridLayout">
18
+ <item row="1" column="2">
19
+ <widget class="QLabel" name="label_3">
20
+ <property name="text">
21
+ <string>Plot Config 2</string>
22
+ </property>
23
+ </widget>
24
+ </item>
25
+ <item row="3" column="0" colspan="2">
26
+ <widget class="BECMonitor" name="plot_1"/>
27
+ </item>
28
+ <item row="1" column="3">
29
+ <widget class="QPushButton" name="pushButton_setting_2">
30
+ <property name="text">
31
+ <string>Setting Plot 2</string>
32
+ </property>
33
+ </widget>
34
+ </item>
35
+ <item row="3" column="2" colspan="2">
36
+ <widget class="BECMonitor" name="plot_2"/>
37
+ </item>
38
+ <item row="1" column="4">
39
+ <widget class="QLabel" name="label_2">
40
+ <property name="text">
41
+ <string>Plot Scan Types = True</string>
42
+ </property>
43
+ </widget>
44
+ </item>
45
+ <item row="1" column="1">
46
+ <widget class="QPushButton" name="pushButton_setting_1">
47
+ <property name="text">
48
+ <string>Setting Plot 1</string>
49
+ </property>
50
+ </widget>
51
+ </item>
52
+ <item row="1" column="0">
53
+ <widget class="QLabel" name="label">
54
+ <property name="text">
55
+ <string>Plot Config 1</string>
56
+ </property>
57
+ </widget>
58
+ </item>
59
+ <item row="1" column="5">
60
+ <widget class="QPushButton" name="pushButton_setting_3">
61
+ <property name="text">
62
+ <string>Setting Plot 3</string>
63
+ </property>
64
+ </widget>
65
+ </item>
66
+ <item row="3" column="4" colspan="2">
67
+ <widget class="BECMonitor" name="plot_3"/>
68
+ </item>
69
+ </layout>
70
+ </widget>
71
+ <widget class="QMenuBar" name="menubar">
72
+ <property name="geometry">
73
+ <rect>
74
+ <x>0</x>
75
+ <y>0</y>
76
+ <width>1433</width>
77
+ <height>37</height>
78
+ </rect>
79
+ </property>
80
+ </widget>
81
+ <widget class="QStatusBar" name="statusbar"/>
82
+ </widget>
83
+ <customwidgets>
84
+ <customwidget>
85
+ <class>BECMonitor</class>
86
+ <extends>QGraphicsView</extends>
87
+ <header location="global">bec_widgets.widgets.h</header>
88
+ </customwidget>
89
+ </customwidgets>
90
+ <resources/>
91
+ <connections/>
92
+ </ui>
@@ -0,0 +1,197 @@
1
+ import os
2
+
3
+ from qtpy import uic
4
+ from qtpy.QtWidgets import QApplication, QMainWindow
5
+
6
+ from bec_widgets.utils.bec_dispatcher import BECDispatcher
7
+ from bec_widgets.widgets import BECMonitor
8
+
9
+ # some default configs for demonstration purposes
10
+ CONFIG_SIMPLE = {
11
+ "plot_settings": {
12
+ "background_color": "black",
13
+ "num_columns": 2,
14
+ "colormap": "plasma",
15
+ "scan_types": False,
16
+ },
17
+ "plot_data": [
18
+ {
19
+ "plot_name": "BPM4i plots vs samx",
20
+ "x_label": "Motor X",
21
+ "y_label": "bpm4i",
22
+ "sources": [
23
+ {
24
+ "type": "scan_segment",
25
+ "signals": {
26
+ "x": [{"name": "samx"}],
27
+ "y": [{"name": "bpm4i", "entry": "bpm4i"}],
28
+ },
29
+ },
30
+ # {
31
+ # "type": "history",
32
+ # "signals": {
33
+ # "x": [{"name": "samx"}],
34
+ # "y": [{"name": "bpm4i", "entry": "bpm4i"}],
35
+ # },
36
+ # },
37
+ # {
38
+ # "type": "dap",
39
+ # 'worker':'some_worker',
40
+ # "signals": {
41
+ # "x": [{"name": "samx"}],
42
+ # "y": [{"name": "bpm4i", "entry": "bpm4i"}],
43
+ # },
44
+ # },
45
+ ],
46
+ },
47
+ {
48
+ "plot_name": "Gauss plots vs samx",
49
+ "x_label": "Motor X",
50
+ "y_label": "Gauss",
51
+ "sources": [
52
+ {
53
+ "type": "scan_segment",
54
+ "signals": {
55
+ "x": [{"name": "samx", "entry": "samx"}],
56
+ "y": [{"name": "gauss_bpm"}, {"name": "gauss_adc1"}],
57
+ },
58
+ }
59
+ ],
60
+ },
61
+ ],
62
+ }
63
+
64
+
65
+ CONFIG_SCAN_MODE = {
66
+ "plot_settings": {
67
+ "background_color": "white",
68
+ "num_columns": 3,
69
+ "colormap": "plasma",
70
+ "scan_types": True,
71
+ },
72
+ "plot_data": {
73
+ "grid_scan": [
74
+ {
75
+ "plot_name": "Grid plot 1",
76
+ "x_label": "Motor X",
77
+ "y_label": "BPM",
78
+ "sources": [
79
+ {
80
+ "type": "scan_segment",
81
+ "signals": {
82
+ "x": [{"name": "samx", "entry": "samx"}],
83
+ "y": [{"name": "gauss_bpm"}],
84
+ },
85
+ }
86
+ ],
87
+ },
88
+ {
89
+ "plot_name": "Grid plot 2",
90
+ "x_label": "Motor X",
91
+ "y_label": "BPM",
92
+ "sources": [
93
+ {
94
+ "type": "scan_segment",
95
+ "signals": {
96
+ "x": [{"name": "samx", "entry": "samx"}],
97
+ "y": [{"name": "gauss_adc1"}],
98
+ },
99
+ }
100
+ ],
101
+ },
102
+ {
103
+ "plot_name": "Grid plot 3",
104
+ "x_label": "Motor X",
105
+ "y_label": "BPM",
106
+ "sources": [
107
+ {
108
+ "type": "scan_segment",
109
+ "signals": {"x": [{"name": "samy"}], "y": [{"name": "gauss_adc2"}]},
110
+ }
111
+ ],
112
+ },
113
+ {
114
+ "plot_name": "Grid plot 4",
115
+ "x_label": "Motor X",
116
+ "y_label": "BPM",
117
+ "sources": [
118
+ {
119
+ "type": "scan_segment",
120
+ "signals": {
121
+ "x": [{"name": "samy", "entry": "samy"}],
122
+ "y": [{"name": "gauss_adc3"}],
123
+ },
124
+ }
125
+ ],
126
+ },
127
+ ],
128
+ "line_scan": [
129
+ {
130
+ "plot_name": "BPM plots vs samx",
131
+ "x_label": "Motor X",
132
+ "y_label": "Gauss",
133
+ "sources": [
134
+ {
135
+ "type": "scan_segment",
136
+ "signals": {
137
+ "x": [{"name": "samx", "entry": "samx"}],
138
+ "y": [{"name": "bpm4i"}],
139
+ },
140
+ }
141
+ ],
142
+ },
143
+ {
144
+ "plot_name": "Gauss plots vs samx",
145
+ "x_label": "Motor X",
146
+ "y_label": "Gauss",
147
+ "sources": [
148
+ {
149
+ "type": "scan_segment",
150
+ "signals": {
151
+ "x": [{"name": "samx", "entry": "samx"}],
152
+ "y": [{"name": "gauss_bpm"}, {"name": "gauss_adc1"}],
153
+ },
154
+ }
155
+ ],
156
+ },
157
+ ],
158
+ },
159
+ }
160
+
161
+
162
+ class ModularApp(QMainWindow):
163
+ def __init__(self, client=None, parent=None):
164
+ super(ModularApp, self).__init__(parent)
165
+
166
+ # Client and device manager from BEC
167
+ self.client = BECDispatcher().client if client is None else client
168
+
169
+ # Loading UI
170
+ current_path = os.path.dirname(__file__)
171
+ uic.loadUi(os.path.join(current_path, "modular.ui"), self)
172
+
173
+ self._init_plots()
174
+
175
+ def _init_plots(self):
176
+ """Initialize plots and connect the buttons to the config dialogs"""
177
+ plots = [self.plot_1, self.plot_2, self.plot_3]
178
+ configs = [CONFIG_SIMPLE, CONFIG_SCAN_MODE, CONFIG_SCAN_MODE]
179
+ buttons = [self.pushButton_setting_1, self.pushButton_setting_2, self.pushButton_setting_3]
180
+
181
+ # hook plots, configs and buttons together
182
+ for plot, config, button in zip(plots, configs, buttons):
183
+ plot.on_config_update(config)
184
+ button.clicked.connect(plot.show_config_dialog)
185
+
186
+
187
+ if __name__ == "__main__":
188
+ # BECclient global variables
189
+ client = BECDispatcher().client
190
+ client.start()
191
+
192
+ app = QApplication([])
193
+ modularApp = ModularApp(client=client)
194
+
195
+ window = modularApp
196
+ window.show()
197
+ app.exec()
@@ -42,7 +42,7 @@ CONFIG_DEFAULT = {
42
42
  "x": [{"name": "samx", "entry": "samx"}],
43
43
  "y": [{"name": "samy", "entry": "samy"}],
44
44
  },
45
- },
45
+ }
46
46
  ],
47
47
  }
48
48