bec-widgets 0.88.1__py3-none-any.whl → 0.90.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 (36) hide show
  1. CHANGELOG.md +42 -42
  2. PKG-INFO +1 -1
  3. bec_widgets/assets/designer_icons/image.png +0 -0
  4. bec_widgets/assets/toolbar_icons/auto_range.svg +1 -1
  5. bec_widgets/assets/toolbar_icons/compare.svg +3 -0
  6. bec_widgets/assets/toolbar_icons/fft.svg +11 -0
  7. bec_widgets/assets/toolbar_icons/image_autorange.svg +3 -0
  8. bec_widgets/assets/toolbar_icons/line_curve.svg +3 -0
  9. bec_widgets/assets/toolbar_icons/lock_aspect_ratio.svg +3 -0
  10. bec_widgets/assets/toolbar_icons/log_scale.png +0 -0
  11. bec_widgets/assets/toolbar_icons/reset_settings.svg +3 -0
  12. bec_widgets/assets/toolbar_icons/rotate_left.svg +3 -0
  13. bec_widgets/assets/toolbar_icons/rotate_right.svg +3 -0
  14. bec_widgets/assets/toolbar_icons/transform.svg +3 -0
  15. bec_widgets/cli/client.py +187 -2
  16. bec_widgets/examples/jupyter_console/jupyter_console_window.py +18 -19
  17. bec_widgets/widgets/figure/figure.py +1 -3
  18. bec_widgets/widgets/figure/plots/axis_settings.ui +86 -100
  19. bec_widgets/widgets/figure/plots/image/image.py +85 -3
  20. bec_widgets/widgets/figure/plots/image/image_item.py +14 -0
  21. bec_widgets/widgets/image/__init__.py +0 -0
  22. bec_widgets/widgets/image/bec_image_widget.pyproject +1 -0
  23. bec_widgets/widgets/image/bec_image_widget_plugin.py +59 -0
  24. bec_widgets/widgets/image/image_widget.py +475 -0
  25. bec_widgets/widgets/image/register_bec_image_widget.py +15 -0
  26. {bec_widgets-0.88.1.dist-info → bec_widgets-0.90.0.dist-info}/METADATA +1 -1
  27. {bec_widgets-0.88.1.dist-info → bec_widgets-0.90.0.dist-info}/RECORD +36 -19
  28. pyproject.toml +1 -1
  29. tests/unit_tests/client_mocks.py +9 -1
  30. tests/unit_tests/test_bec_image_widget.py +218 -0
  31. tests/unit_tests/test_device_input_base.py +1 -1
  32. tests/unit_tests/test_device_input_widgets.py +2 -0
  33. tests/unit_tests/test_waveform_widget.py +1 -1
  34. {bec_widgets-0.88.1.dist-info → bec_widgets-0.90.0.dist-info}/WHEEL +0 -0
  35. {bec_widgets-0.88.1.dist-info → bec_widgets-0.90.0.dist-info}/entry_points.txt +0 -0
  36. {bec_widgets-0.88.1.dist-info → bec_widgets-0.90.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v0.90.0 (2024-07-23)
4
+
5
+ ### Feature
6
+
7
+ * feat(image_widget): plugin added ([`4371168`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/43711680ba253f81fb0ffe764bcaae701b02bb49))
8
+
9
+ * feat(image_widget): all toolbar actions added ([`501eb92`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/501eb923f12fa6aaa93f5428ca78e57694edfbc0))
10
+
11
+ * feat(image_widget): image_widget added ([`6a9317f`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6a9317facda896ee784c7fc1db0cd3d68cdfcf73))
12
+
13
+ ### Fix
14
+
15
+ * fix(axis_setting): fix compatibility for issue with horizontal line for PyQt6 ([`1cf6e32`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/1cf6e32303f82bc7c3f3391d0e96a88bc31f29fc))
16
+
17
+ * fix(image_widget): image_widget autorange fixed ([`7f49893`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/7f49893d2ce3b9d02efa764f7f10442ed6ab8f3c))
18
+
19
+ * fix(image_widget): image widget adjusted ([`3d2ca48`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3d2ca4855c36fe0af59a4b540caa3c8023a81773))
20
+
21
+ * fix(image): only single monitor image is allowed ([`fe7e542`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fe7e542b19dc5b401523501acb74ac03edf62ad4))
22
+
23
+ * fix(image): raw data are saved in image item to always have precise processing ([`c15035b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/c15035b6b769a96780a16da9e7f75af3b823654c))
24
+
25
+ ### Refactor
26
+
27
+ * refactor(jupyter_console_example): added examples of standalone widgets ([`ba0d1ea`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ba0d1ea9031b4ae2e2e73bf269fbfad973b924a5))
28
+
29
+ ### Test
30
+
31
+ * test(image_widget): tests added ([`70fb276`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/70fb276fdf31dffc105435d3dfe7c5caea0b10ce))
32
+
33
+ ## v0.89.0 (2024-07-22)
34
+
35
+ ### Feature
36
+
37
+ * feat(themes): moved themes to bec_qthemes ([`3798714`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3798714369adf4023f833b7749d2f46a0ec74eee))
38
+
39
+ ### Unknown
40
+
41
+ * Revert "feat(themes): moved themes to bec_qthemes"
42
+
43
+ This reverts commit 3798714369adf4023f833b7749d2f46a0ec74eee ([`fd6ae91`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fd6ae91993a23a7b8dbb2cf3c4b7c3eda6d2b0f6))
44
+
3
45
  ## v0.88.1 (2024-07-22)
4
46
 
5
47
  ### Documentation
@@ -103,45 +145,3 @@ Handles closeEvent() and RPC registering/unregistering ([`c7feb69`](https://gitl
103
145
  * tests: add unit tests for error and warning message boxes ([`8f104cf`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8f104cf4024d3a4516e6aba5daa8fb78c85e2bfd))
104
146
 
105
147
  ## v0.86.0 (2024-07-17)
106
-
107
- ### Feature
108
-
109
- * feat(toolbar): added separator action ([`ba69e79`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ba69e7957cd20df1557ac0c3a9ca43a54493c34d))
110
-
111
- ## v0.85.1 (2024-07-17)
112
-
113
- ### Fix
114
-
115
- * fix(waveform): readout_priority dict fixed, not overwritten to 'baseline' key ([`b5b0aa4`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b5b0aa4f82a998bb0162dc319591e854204a7354))
116
-
117
- ## v0.85.0 (2024-07-16)
118
-
119
- ### Feature
120
-
121
- * feat(color_map_selector): added colormap selector with plugin ([`b98fd00`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b98fd00adef97adf57f49b60ade99972b9f5a6bc))
122
-
123
- ## v0.84.0 (2024-07-15)
124
-
125
- ### Feature
126
-
127
- * feat(waveform): async readback update implemented for async devices ([`0c6a9f2`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0c6a9f2310df31ddcd68050a17cfbf52c3e2e226))
128
-
129
- ### Fix
130
-
131
- * fix(waveform): timestamp are not converted to human readable format ([`e495fd3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e495fd30c4c16474689943c7263e3060cb09ffb4))
132
-
133
- * fix(waveform): set_x method various bugs fixed ([`8516a1d`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8516a1d639925a877f174fa13f427a71131cc918))
134
-
135
- * fix(waveform): x axis switching logic fixed when axis are not compatible ([`e4e1a90`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e4e1a905d19def22f970b364c18c953f00e10389))
136
-
137
- * fix(waveform): dap leaked RID for all daps in current process; dap RID is now f"{scan_id}-{gui_id}" to distinguish for each plot instance ([`d23fd8b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/d23fd8bd074ede6e14eb8e85e025cbced4bd45ef))
138
-
139
- ### Refactor
140
-
141
- * refactor(waveform): plot can be prompted without specifying kwargs ([`48911e9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/48911e934815923c94edb5ced6042058a11a97f5))
142
-
143
- * refactor(jupyter_console_window): added more examples of waveforms ([`fc935d9`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fc935d9fc81067c3a67389ff88ea97da2e0c903e))
144
-
145
- ### Test
146
-
147
- * test(waveform): tests extended ([`006992e`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/006992e43cc56d56261bc4fd3e9cae9abcab2153))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.88.1
3
+ Version: 0.90.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
@@ -1,3 +1,3 @@
1
1
  <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
- <path d="M571.91-279.09h191v-194h-60v134h-131v60ZM198.09-486.91h60v-134h131v-60h-191v194Zm-53 341.04q-32.51 0-55.87-23.35-23.35-23.36-23.35-55.87v-509.82q0-32.74 23.35-56.26 23.36-23.53 55.87-23.53h669.82q32.74 0 56.26 23.53 23.53 23.52 23.53 56.26v509.82q0 32.51-23.53 55.87-23.52 23.35-56.26 23.35H145.09Zm0-79.22h669.82v-509.82H145.09v509.82Zm0 0v-509.82 509.82Z"/>
2
+ <path d="M114.02-114.02v-308.13h68.13v192.02l547.72-547.72H537.85v-68.37h308.37v308.37h-68.37v-192.02L230.13-182.15h192.02v68.13H114.02Z"/>
3
3
  </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="m311.5-154.02-47.74-47.74 116.94-116.7H74.02v-68.37H380.7L263.76-503.76l47.74-47.74 198.98 198.74L311.5-154.02Zm337-254.72L449.76-607.48 648.5-806.22l47.74 47.74-116.7 116.94h306.68v68.37H579.54l116.7 116.69-47.74 47.74Z"/>
3
+ </svg>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 100 96" version="1.1" xmlns="http://www.w3.org/2000/svg"
4
+ xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/"
5
+ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
6
+ <rect id="Artboard1" x="0" y="0" width="100" height="96.486" style="fill:none;"/>
7
+ <g id="Artboard11" serif:id="Artboard1">
8
+ <path d="M11.379,24.832C11.379,24.261 11.843,23.798 12.414,23.798C18.11,23.798 20.117,19.072 22.06,14.503C23.704,10.634 25.403,6.634 29.483,6.634C33.902,6.634 35.376,12.91 36.934,19.555C38.473,26.113 40.065,32.893 44.138,32.893C48.25,32.893 50.78,28.962 53.457,24.8C56.279,20.412 59.198,15.876 64.31,15.876C69.322,15.876 72.165,20.305 74.915,24.588C77.707,28.935 80.343,33.04 84.999,33.04C85.571,33.04 86.034,33.503 86.034,34.075C86.034,34.647 85.571,35.11 84.999,35.11C79.212,35.11 76.004,30.115 73.175,25.708C70.612,21.716 68.192,17.946 64.31,17.946C60.328,17.946 57.835,21.819 55.197,25.92C52.338,30.366 49.381,34.963 44.138,34.963C38.425,34.963 36.643,27.371 34.92,20.028C33.613,14.46 32.262,8.703 29.482,8.703C26.953,8.703 25.71,11.2 23.963,15.311C21.964,20.014 19.479,25.867 12.413,25.867C11.843,25.867 11.379,25.403 11.379,24.832M44.361,44.584C43.504,44.584 42.557,44.882 42.557,45.739L42.586,50.703L39.522,50.703L43.922,61.878L48.807,50.703L45.691,50.703L45.604,46.255C45.602,45.398 45.218,44.584 44.361,44.584ZM6.034,37.487L6.034,6.674L5,6.674L5,38.522L95,38.522L95,37.487L6.034,37.487M77.414,91.881L77.414,63.849C77.414,63.277 76.951,62.814 76.379,62.814C75.808,62.814 75.345,63.277 75.345,63.849L75.345,91.881C75.345,92.045 75.391,92.194 75.458,92.332L61.955,92.332C62.022,92.194 62.068,92.045 62.068,91.881L62.068,82.718C62.068,82.146 61.605,81.683 61.034,81.683C60.462,81.683 59.999,82.146 59.999,82.718L59.999,91.881C59.999,92.045 60.045,92.194 60.112,92.332L45.059,92.332C45.126,92.194 45.172,92.045 45.172,91.881L45.172,75.943C45.172,75.372 44.709,74.909 44.138,74.909C43.567,74.909 43.104,75.372 43.104,75.943L43.104,91.881C43.104,92.045 43.15,92.194 43.217,92.332L23.852,92.332C23.92,92.194 23.966,92.045 23.966,91.881L23.966,63.849C23.966,63.277 23.502,62.814 22.931,62.814C22.36,62.814 21.897,63.277 21.897,63.849L21.897,91.881C21.897,92.045 21.943,92.194 22.011,92.332L6.034,92.332L6.034,62.881L5,62.881L5,93.366L95,93.366L95,92.332L77.301,92.332C77.368,92.194 77.414,92.045 77.414,91.881"
9
+ style="fill:white;fill-rule:nonzero;stroke:white;stroke-width:5px;"/>
10
+ </g>
11
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M283.85-289.91h67.41l42.32-112.66h172.59l43.33 112.66h68.85l-164-428h-67.5l-163 428Zm127.74-165.72 67.34-182.87H481l68.41 182.87H411.59Zm68.53 381.61q-86.32 0-160.51-31t-128.89-85.7q-54.7-54.7-85.7-128.89-31-74.19-31-160.51 0-85.31 30.94-159.4t85.7-128.9q54.76-54.8 128.95-86.3t160.51-31.5q85.31 0 159.42 31.47 74.1 31.47 128.91 86.27 54.82 54.8 86.29 128.88 31.48 74.08 31.48 159.6 0 86.2-31.5 160.39-31.5 74.19-86.3 128.95-54.81 54.76-128.9 85.7-74.09 30.94-159.4 30.94ZM480-480Zm-.04 337.85q144.08 0 240.99-96.74 96.9-96.74 96.9-241.07 0-144.32-96.86-241.11-96.86-96.78-240.95-96.78-144.08 0-240.99 96.74-96.9 96.74-96.9 241.07 0 144.32 96.86 241.11 96.86 96.78 240.95 96.78Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M725.93-155.93q0-118.18-45-222.09t-122-180.91q-77-77-180.91-122t-222.09-45v-68.14q132.68 0 248.61 50.23 115.92 50.23 202.5 136.75 86.57 86.53 136.8 202.53 50.23 116.01 50.23 248.63h-68.14Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M571.91-279.09h191v-194h-60v134h-131v60ZM198.09-486.91h60v-134h131v-60h-191v194Zm-53 341.04q-32.51 0-55.87-23.35-23.35-23.36-23.35-55.87v-509.82q0-32.74 23.35-56.26 23.36-23.53 55.87-23.53h669.82q32.74 0 56.26 23.53 23.53 23.52 23.53 56.26v509.82q0 32.51-23.53 55.87-23.52 23.35-56.26 23.35H145.09Zm0-79.22h669.82v-509.82H145.09v509.82Zm0 0v-509.82 509.82Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M473.54-344.48v-63.59h187.18v63.59H473.54Zm81.92 230.46v-56.15h-81.92v-63.59h81.92v-56.39h63.58v176.13h-63.58Zm103.58-56.15v-63.59h187.18v63.59H659.04Zm41.68-116.92v-177.13h63.58v56.15h81.92v63.59H764.3v57.39h-63.58ZM841.22-540h-68.46q-22.98-101.89-103.94-170.83-80.95-68.93-188.89-68.93-125.29 0-212.37 87.18T180.48-480q0 78.61 36.59 143.32 36.58 64.7 96.95 104.46v-108.26h66.46v226.46H154.02v-66.46h117.41q-71.56-48.72-114.48-127.36-42.93-78.64-42.93-172.16 0-76.22 28.86-142.78 28.86-66.57 78.29-116.04 49.42-49.47 116.01-78.43 66.58-28.97 142.82-28.97 136.52 0 237.87 87.8Q819.22-670.63 841.22-540Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M435-72.11q-49.67-7-95.99-25.36-46.31-18.36-86.55-49.55l49.21-49.74q31.76 24 65.29 37.26 33.52 13.26 68.04 19.02v68.37Zm90 0v-68.37q109.28-21.24 181.07-102.9 71.78-81.66 71.78-197.71 0-124.37-84.11-210.87t-208.72-86.5h-18.8L540.67-664l-49.74 49.74L332.2-773l158.73-158.74 49.74 49.26-75.41 75.65h19.28q75.48 0 141.34 28.72t114.98 78.56q49.12 49.83 77.24 116.29 28.12 66.46 28.12 142.17 0 142.39-90.8 245.07Q664.63-93.35 525-72.11ZM189.46-209.78q-28.96-38.72-47.82-86.3-18.86-47.57-25.62-100.01h68.89q5 37.76 18.38 72.17 13.38 34.4 36.14 64.16l-49.97 49.98Zm-73.44-276.31q6.52-50.71 25-97.29 18.48-46.58 48.44-87.77l50.21 48.26q-22.76 33-36.14 67.52-13.38 34.52-18.62 69.28h-68.89Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M527-72.11v-68.37q34.52-5.76 68.04-19.02 33.53-13.26 65.29-37.26l49.21 49.74q-40.24 31.19-86.55 49.55Q576.67-79.11 527-72.11Zm-90 0Q297.37-93.35 206.7-196.02q-90.68-102.68-90.68-245.07 0-75.71 28-142.17t77.12-116.29q49.12-49.84 114.98-78.56 65.86-28.72 141.34-28.72h19.28l-75.41-75.65 49.74-49.26L629.8-773 471.07-614.26 421.33-664l74.69-74.46h-19.04q-124.61 0-208.72 86.5t-84.11 210.87q0 116.05 71.78 197.71 71.79 81.66 181.07 102.9v68.37Zm335.54-137.67-49.97-49.98q22.76-29.76 36.14-64.16 13.38-34.41 18.38-72.17h69.13q-7 52.44-25.86 100.01-18.86 47.58-47.82 86.3Zm73.68-276.31h-69.13q-5.24-34.76-18.62-69.28t-36.14-67.52l50.21-48.26q29.96 41.19 48.44 87.77 18.48 46.58 25.24 97.29Z"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48px" viewBox="0 -960 960 960" width="48px" fill="#FFFFFF">
2
+ <path d="M636.17-32.59 480.35-188.41l45.82-46.07 77.13 77.37v-137.32H356.93q-28.1 0-46.8-18.55-18.7-18.54-18.7-46.95V-600.3H74.02v-65.27h217.41v-137.32l-77.36 77.37-45.59-45.83 155.59-155.82 156.06 155.82-46.06 45.83-77.14-77.37v442.96h529.29v65.5H669.04v137.32l77.13-77.37L792-188.41 636.17-32.59ZM603.3-419.93V-600.3H416.93v-65.27H603.3q28.37 0 47.06 18.56 18.68 18.55 18.68 46.71v180.37H603.3Z"/>
3
+ </svg>
bec_widgets/cli/client.py CHANGED
@@ -16,6 +16,7 @@ class Widgets(str, enum.Enum):
16
16
  BECDock = "BECDock"
17
17
  BECDockArea = "BECDockArea"
18
18
  BECFigure = "BECFigure"
19
+ BECImageWidget = "BECImageWidget"
19
20
  BECMotorMapWidget = "BECMotorMapWidget"
20
21
  BECQueue = "BECQueue"
21
22
  BECStatusBox = "BECStatusBox"
@@ -822,7 +823,7 @@ class BECImageShow(RPCBase):
822
823
  """
823
824
 
824
825
  @rpc_call
825
- def add_monitor_image(
826
+ def image(
826
827
  self,
827
828
  monitor: "str",
828
829
  color_map: "Optional[str]" = "magma",
@@ -833,7 +834,17 @@ class BECImageShow(RPCBase):
833
834
  **kwargs,
834
835
  ) -> "BECImageItem":
835
836
  """
836
- None
837
+ Add an image to the figure. Always access the first image widget in the figure.
838
+
839
+ Args:
840
+ monitor(str): The name of the monitor to display.
841
+ color_bar(Literal["simple","full"]): The type of color bar to display.
842
+ color_map(str): The color map to use for the image.
843
+ data(np.ndarray): Custom data to display.
844
+ vrange(tuple[float, float]): The range of values to display.
845
+
846
+ Returns:
847
+ BECImageItem: The image item.
837
848
  """
838
849
 
839
850
  @rpc_call
@@ -1125,6 +1136,180 @@ class BECImageShow(RPCBase):
1125
1136
  """
1126
1137
 
1127
1138
 
1139
+ class BECImageWidget(RPCBase):
1140
+ @rpc_call
1141
+ def image(
1142
+ self,
1143
+ monitor: "str",
1144
+ color_map: "Optional[str]" = "magma",
1145
+ color_bar: "Optional[Literal['simple', 'full']]" = "full",
1146
+ downsample: "Optional[bool]" = True,
1147
+ opacity: "Optional[float]" = 1.0,
1148
+ vrange: "Optional[tuple[int, int]]" = None,
1149
+ **kwargs,
1150
+ ) -> "BECImageItem":
1151
+ """
1152
+ None
1153
+ """
1154
+
1155
+ @rpc_call
1156
+ def set(self, **kwargs):
1157
+ """
1158
+ Set the properties of the plot widget.
1159
+
1160
+ Args:
1161
+ **kwargs: Keyword arguments for the properties to be set.
1162
+
1163
+ Possible properties:
1164
+ - title: str
1165
+ - x_label: str
1166
+ - y_label: str
1167
+ - x_scale: Literal["linear", "log"]
1168
+ - y_scale: Literal["linear", "log"]
1169
+ - x_lim: tuple
1170
+ - y_lim: tuple
1171
+ - legend_label_size: int
1172
+ """
1173
+
1174
+ @rpc_call
1175
+ def set_title(self, title: "str"):
1176
+ """
1177
+ Set the title of the plot widget.
1178
+
1179
+ Args:
1180
+ title(str): Title of the plot.
1181
+ """
1182
+
1183
+ @rpc_call
1184
+ def set_x_label(self, x_label: "str"):
1185
+ """
1186
+ Set the x-axis label of the plot widget.
1187
+
1188
+ Args:
1189
+ x_label(str): Label of the x-axis.
1190
+ """
1191
+
1192
+ @rpc_call
1193
+ def set_y_label(self, y_label: "str"):
1194
+ """
1195
+ Set the y-axis label of the plot widget.
1196
+
1197
+ Args:
1198
+ y_label(str): Label of the y-axis.
1199
+ """
1200
+
1201
+ @rpc_call
1202
+ def set_x_scale(self, x_scale: "Literal['linear', 'log']"):
1203
+ """
1204
+ Set the scale of the x-axis of the plot widget.
1205
+
1206
+ Args:
1207
+ x_scale(Literal["linear", "log"]): Scale of the x-axis.
1208
+ """
1209
+
1210
+ @rpc_call
1211
+ def set_y_scale(self, y_scale: "Literal['linear', 'log']"):
1212
+ """
1213
+ Set the scale of the y-axis of the plot widget.
1214
+
1215
+ Args:
1216
+ y_scale(Literal["linear", "log"]): Scale of the y-axis.
1217
+ """
1218
+
1219
+ @rpc_call
1220
+ def set_x_lim(self, x_lim: "tuple"):
1221
+ """
1222
+ Set the limits of the x-axis of the plot widget.
1223
+
1224
+ Args:
1225
+ x_lim(tuple): Limits of the x-axis.
1226
+ """
1227
+
1228
+ @rpc_call
1229
+ def set_y_lim(self, y_lim: "tuple"):
1230
+ """
1231
+ Set the limits of the y-axis of the plot widget.
1232
+
1233
+ Args:
1234
+ y_lim(tuple): Limits of the y-axis.
1235
+ """
1236
+
1237
+ @rpc_call
1238
+ def set_vrange(self, vmin: "float", vmax: "float", name: "str" = None):
1239
+ """
1240
+ Set the range of the color bar.
1241
+ If name is not specified, then set vrange for all images.
1242
+
1243
+ Args:
1244
+ vmin(float): Minimum value of the color bar.
1245
+ vmax(float): Maximum value of the color bar.
1246
+ name(str): The name of the image. If None, apply to all images.
1247
+ """
1248
+
1249
+ @rpc_call
1250
+ def set_fft(self, enable: "bool" = False, name: "str" = None):
1251
+ """
1252
+ Set the FFT of the image.
1253
+ If name is not specified, then set FFT for all images.
1254
+
1255
+ Args:
1256
+ enable(bool): Whether to perform FFT on the monitor data.
1257
+ name(str): The name of the image. If None, apply to all images.
1258
+ """
1259
+
1260
+ @rpc_call
1261
+ def set_transpose(self, enable: "bool" = False, name: "str" = None):
1262
+ """
1263
+ Set the transpose of the image.
1264
+ If name is not specified, then set transpose for all images.
1265
+
1266
+ Args:
1267
+ enable(bool): Whether to transpose the monitor data before displaying.
1268
+ name(str): The name of the image. If None, apply to all images.
1269
+ """
1270
+
1271
+ @rpc_call
1272
+ def set_rotation(self, deg_90: "int" = 0, name: "str" = None):
1273
+ """
1274
+ Set the rotation of the image.
1275
+ If name is not specified, then set rotation for all images.
1276
+
1277
+ Args:
1278
+ deg_90(int): The rotation angle of the monitor data before displaying.
1279
+ name(str): The name of the image. If None, apply to all images.
1280
+ """
1281
+
1282
+ @rpc_call
1283
+ def set_log(self, enable: "bool" = False, name: "str" = None):
1284
+ """
1285
+ Set the log of the image.
1286
+ If name is not specified, then set log for all images.
1287
+
1288
+ Args:
1289
+ enable(bool): Whether to perform log on the monitor data.
1290
+ name(str): The name of the image. If None, apply to all images.
1291
+ """
1292
+
1293
+ @rpc_call
1294
+ def set_grid(self, x_grid: "bool", y_grid: "bool"):
1295
+ """
1296
+ Set the grid visibility of the plot widget.
1297
+
1298
+ Args:
1299
+ x_grid(bool): Visibility of the x-axis grid.
1300
+ y_grid(bool): Visibility of the y-axis grid.
1301
+ """
1302
+
1303
+ @rpc_call
1304
+ def lock_aspect_ratio(self, lock: "bool"):
1305
+ """
1306
+ Lock the aspect ratio of the plot widget.
1307
+
1308
+ Args:
1309
+ lock(bool): Lock the aspect ratio.
1310
+ """
1311
+
1312
+
1128
1313
  class BECMotorMap(RPCBase):
1129
1314
  @property
1130
1315
  @rpc_call
@@ -49,9 +49,11 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
49
49
  "d0": self.d0,
50
50
  "d1": self.d1,
51
51
  "d2": self.d2,
52
- "wave": self.wave,
53
- "bar": self.bar,
54
- "cm": self.colormap,
52
+ "wave": self.wf,
53
+ # "bar": self.bar,
54
+ # "cm": self.colormap,
55
+ "im": self.im,
56
+ "mm": self.mm,
55
57
  }
56
58
  )
57
59
 
@@ -155,26 +157,23 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
155
157
  def _init_dock(self):
156
158
 
157
159
  self.d0 = self.dock.add_dock(name="dock_0")
158
- self.fig0 = self.d0.add_widget("BECFigure")
159
- data = np.random.rand(10, 2)
160
- self.fig0.plot(data, label="2d Data")
161
- self.fig0.image("eiger", vrange=(0, 100))
160
+ self.mm = self.d0.add_widget("BECMotorMapWidget")
161
+ self.mm.change_motors("samx", "samy")
162
162
 
163
163
  self.d1 = self.dock.add_dock(name="dock_1", position="right")
164
- self.fig1 = self.d1.add_widget("BECFigure")
165
- self.fig1.plot(x_name="samx", y_name="bpm4i")
166
- self.fig1.plot(x_name="samx", y_name="bpm3a")
164
+ self.im = self.d1.add_widget("BECImageWidget")
165
+ self.im.image("eiger")
167
166
 
168
167
  self.d2 = self.dock.add_dock(name="dock_2", position="bottom")
169
- self.wave = self.d2.add_widget("BECWaveformWidget", row=0, col=0)
170
- # self.wave.plot(x_name="samx", y_name="bpm3a")
171
- # self.wave.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
172
- self.bar = self.d2.add_widget("RingProgressBar", row=0, col=1)
173
- self.bar.set_diameter(200)
174
-
175
- self.d3 = self.dock.add_dock(name="dock_3", position="bottom")
176
- self.colormap = pg.GradientWidget()
177
- self.d3.add_widget(self.colormap, row=0, col=0)
168
+ self.wf = self.d2.add_widget("BECWaveformWidget", row=0, col=0)
169
+ self.wf.plot(x_name="samx", y_name="bpm3a")
170
+ self.wf.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
171
+ # self.bar = self.d2.add_widget("RingProgressBar", row=0, col=1)
172
+ # self.bar.set_diameter(200)
173
+
174
+ # self.d3 = self.dock.add_dock(name="dock_3", position="bottom")
175
+ # self.colormap = pg.GradientWidget()
176
+ # self.d3.add_widget(self.colormap, row=0, col=0)
178
177
 
179
178
  self.dock.save_state()
180
179
 
@@ -335,9 +335,7 @@ class BECFigure(BECWidget, pg.GraphicsLayoutWidget):
335
335
  data (np.ndarray): Custom data to display.
336
336
  """
337
337
  if monitor is not None and data is None:
338
- image.add_monitor_image(
339
- monitor=monitor, color_map=color_map, vrange=vrange, color_bar=color_bar
340
- )
338
+ image.image(monitor=monitor, color_map=color_map, vrange=vrange, color_bar=color_bar)
341
339
  elif data is not None and monitor is None:
342
340
  image.add_custom_image(
343
341
  name="custom", data=data, color_map=color_map, vrange=vrange, color_bar=color_bar