bec-widgets 0.53.3__py3-none-any.whl → 0.55.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 (72) hide show
  1. CHANGELOG.md +24 -26
  2. PKG-INFO +1 -1
  3. bec_widgets/cli/client.py +265 -13
  4. bec_widgets/cli/client_utils.py +0 -3
  5. bec_widgets/cli/generate_cli.py +10 -5
  6. bec_widgets/cli/rpc_wigdet_handler.py +2 -1
  7. bec_widgets/cli/server.py +5 -7
  8. bec_widgets/examples/jupyter_console/jupyter_console_window.py +11 -5
  9. bec_widgets/examples/motor_movement/motor_control_compilations.py +17 -16
  10. bec_widgets/widgets/__init__.py +1 -10
  11. bec_widgets/widgets/figure/figure.py +40 -23
  12. bec_widgets/widgets/figure/plots/__init__.py +0 -0
  13. bec_widgets/widgets/figure/plots/image/__init__.py +0 -0
  14. bec_widgets/widgets/{plots → figure/plots/image}/image.py +6 -416
  15. bec_widgets/widgets/figure/plots/image/image_item.py +277 -0
  16. bec_widgets/widgets/figure/plots/image/image_processor.py +152 -0
  17. bec_widgets/widgets/figure/plots/motor_map/__init__.py +0 -0
  18. bec_widgets/widgets/{plots → figure/plots/motor_map}/motor_map.py +2 -2
  19. bec_widgets/widgets/figure/plots/waveform/__init__.py +0 -0
  20. bec_widgets/widgets/{plots → figure/plots/waveform}/waveform.py +9 -222
  21. bec_widgets/widgets/figure/plots/waveform/waveform_curve.py +227 -0
  22. bec_widgets/widgets/motor_control/__init__.py +0 -7
  23. bec_widgets/widgets/motor_control/motor_control.py +2 -948
  24. bec_widgets/widgets/motor_control/motor_table/__init__.py +0 -0
  25. bec_widgets/widgets/motor_control/motor_table/motor_table.py +483 -0
  26. bec_widgets/widgets/motor_control/movement_absolute/__init__.py +0 -0
  27. bec_widgets/widgets/motor_control/movement_absolute/movement_absolute.py +157 -0
  28. bec_widgets/widgets/motor_control/movement_relative/__init__.py +0 -0
  29. bec_widgets/widgets/motor_control/movement_relative/movement_relative.py +227 -0
  30. bec_widgets/widgets/motor_control/selection/__init__.py +0 -0
  31. bec_widgets/widgets/motor_control/selection/selection.py +110 -0
  32. bec_widgets/widgets/spiral_progress_bar/__init__.py +1 -0
  33. bec_widgets/widgets/spiral_progress_bar/ring.py +184 -0
  34. bec_widgets/widgets/spiral_progress_bar/spiral_progress_bar.py +594 -0
  35. {bec_widgets-0.53.3.dist-info → bec_widgets-0.55.0.dist-info}/METADATA +1 -1
  36. {bec_widgets-0.53.3.dist-info → bec_widgets-0.55.0.dist-info}/RECORD +56 -53
  37. docs/requirements.txt +1 -0
  38. pyproject.toml +1 -1
  39. tests/end-2-end/test_bec_dock_rpc_e2e.py +82 -1
  40. tests/end-2-end/test_bec_figure_rpc_e2e.py +4 -4
  41. tests/end-2-end/test_rpc_register_e2e.py +1 -1
  42. tests/unit_tests/test_bec_dock.py +1 -1
  43. tests/unit_tests/test_bec_figure.py +6 -4
  44. tests/unit_tests/test_bec_motor_map.py +2 -3
  45. tests/unit_tests/test_motor_control.py +6 -5
  46. tests/unit_tests/test_spiral_progress_bar.py +338 -0
  47. tests/unit_tests/test_waveform1d.py +13 -1
  48. bec_widgets/validation/__init__.py +0 -2
  49. bec_widgets/validation/monitor_config_validator.py +0 -258
  50. bec_widgets/widgets/monitor/__init__.py +0 -1
  51. bec_widgets/widgets/monitor/config_dialog.py +0 -574
  52. bec_widgets/widgets/monitor/config_dialog.ui +0 -210
  53. bec_widgets/widgets/monitor/example_configs/config_device.yaml +0 -60
  54. bec_widgets/widgets/monitor/example_configs/config_scans.yaml +0 -92
  55. bec_widgets/widgets/monitor/monitor.py +0 -845
  56. bec_widgets/widgets/monitor/tab_template.ui +0 -180
  57. bec_widgets/widgets/motor_map/__init__.py +0 -1
  58. bec_widgets/widgets/motor_map/motor_map.py +0 -594
  59. bec_widgets/widgets/plots/__init__.py +0 -4
  60. tests/unit_tests/test_bec_monitor.py +0 -220
  61. tests/unit_tests/test_config_dialog.py +0 -178
  62. tests/unit_tests/test_motor_map.py +0 -171
  63. tests/unit_tests/test_validator_errors.py +0 -110
  64. /bec_widgets/{cli → assets}/bec_widgets_icon.png +0 -0
  65. /bec_widgets/{examples/jupyter_console → assets}/terminal_icon.png +0 -0
  66. /bec_widgets/widgets/{plots → figure/plots}/plot_base.py +0 -0
  67. /bec_widgets/widgets/motor_control/{motor_control_table.ui → motor_table/motor_table.ui} +0 -0
  68. /bec_widgets/widgets/motor_control/{motor_control_absolute.ui → movement_absolute/movement_absolute.ui} +0 -0
  69. /bec_widgets/widgets/motor_control/{motor_control_relative.ui → movement_relative/movement_relative.ui} +0 -0
  70. /bec_widgets/widgets/motor_control/{motor_control_selection.ui → selection/selection.ui} +0 -0
  71. {bec_widgets-0.53.3.dist-info → bec_widgets-0.55.0.dist-info}/WHEEL +0 -0
  72. {bec_widgets-0.53.3.dist-info → bec_widgets-0.55.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
 
4
4
 
5
+ ## v0.55.0 (2024-05-24)
6
+
7
+ ### Feature
8
+
9
+ * feat(widgets/progressbar): SpiralProgressBar added with rpc interface ([`76bd0d3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/76bd0d339ac9ae9e8a3baa0d0d4e951ec1d09670))
10
+
11
+
12
+ ## v0.54.0 (2024-05-24)
13
+
14
+ ### Build
15
+
16
+ * build: added pyqt6 as sphinx build dependency ([`a47a8ec`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a47a8ec413934cf7fce8d5b7a5913371d4b3b4a5))
17
+
18
+ ### Feature
19
+
20
+ * feat(figure): changes to support direct plot functionality ([`fc4d0f3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/fc4d0f3bb2a7c2fca9c326d86eb68b305bcd548b))
21
+
22
+ ### Refactor
23
+
24
+ * refactor(reconstruction): repository structure is changed to separate assets needed for each widget ([`3455c60`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3455c602361d3b5cc3ff9190f9d2870474becf8a))
25
+
26
+ * refactor(clean-up): 1st generation widgets are removed ([`edc25fb`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/edc25fbf9d5a0321e5f0a80b492b6337df807849))
27
+
28
+
5
29
  ## v0.53.3 (2024-05-16)
6
30
 
7
31
  ### Fix
@@ -145,29 +169,3 @@
145
169
 
146
170
 
147
171
  ## v0.49.1 (2024-04-26)
148
-
149
- ### Build
150
-
151
- * build(pyqt6): fixing PyQt6-Qt6 package to 6.6.3 ([`a222298`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/a22229849cbb57c15e4c1bae02d7e52e672f8c4c))
152
-
153
- ### Fix
154
-
155
- * fix(widgets/editor): qscintilla editor removed ([`ab85374`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/ab8537483da6c87cb9a0b0f01706208c964f292d))
156
-
157
-
158
- ## v0.49.0 (2024-04-24)
159
-
160
- ### Feature
161
-
162
- * feat(rpc/client_utils): timeout for rpc response ([`6500a00`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6500a00682a2a7ca535a138bd9496ed8470856a8))
163
-
164
- ### Fix
165
-
166
- * fix(rpc/client_utils): close clean up policy for BECFigure ([`9602085`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9602085f82cbc983f89b5bfe48bf35f08438fa87))
167
-
168
-
169
- ## v0.48.0 (2024-04-24)
170
-
171
- ### Feature
172
-
173
- * feat(cli): added auto updates plugin support ([`6238693`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/6238693ffb44b47a56b969bc4129f2af7a2c04fe))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 0.53.3
3
+ Version: 0.55.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
bec_widgets/cli/client.py CHANGED
@@ -554,17 +554,17 @@ class BECFigure(RPCBase):
554
554
  @rpc_call
555
555
  def plot(
556
556
  self,
557
- x_name: "str" = None,
558
- y_name: "str" = None,
559
- z_name: "str" = None,
560
- x_entry: "str" = None,
561
- y_entry: "str" = None,
562
- z_entry: "str" = None,
563
- x: "list | np.ndarray" = None,
564
- y: "list | np.ndarray" = None,
565
- color: "Optional[str]" = None,
566
- color_map_z: "Optional[str]" = "plasma",
567
- label: "Optional[str]" = None,
557
+ x: "list | np.ndarray | None" = None,
558
+ y: "list | np.ndarray | None" = None,
559
+ x_name: "str | None" = None,
560
+ y_name: "str | None" = None,
561
+ z_name: "str | None" = None,
562
+ x_entry: "str | None" = None,
563
+ y_entry: "str | None" = None,
564
+ z_entry: "str | None" = None,
565
+ color: "str | None" = None,
566
+ color_map_z: "str | None" = "plasma",
567
+ label: "str | None" = None,
568
568
  validate: "bool" = True,
569
569
  **axis_kwargs,
570
570
  ) -> "BECWaveform":
@@ -572,14 +572,14 @@ class BECFigure(RPCBase):
572
572
  Add a 1D waveform plot to the figure. Always access the first waveform widget in the figure.
573
573
 
574
574
  Args:
575
+ x(list | np.ndarray): Custom x data to plot.
576
+ y(list | np.ndarray): Custom y data to plot.
575
577
  x_name(str): The name of the device for the x-axis.
576
578
  y_name(str): The name of the device for the y-axis.
577
579
  z_name(str): The name of the device for the z-axis.
578
580
  x_entry(str): The name of the entry for the x-axis.
579
581
  y_entry(str): The name of the entry for the y-axis.
580
582
  z_entry(str): The name of the entry for the z-axis.
581
- x(list | np.ndarray): Custom x data to plot.
582
- y(list | np.ndarray): Custom y data to plot.
583
583
  color(str): The color of the curve.
584
584
  color_map_z(str): The color map to use for the z-axis.
585
585
  label(str): The label of the curve.
@@ -1630,3 +1630,255 @@ class BECDockArea(RPCBase, BECGuiClientMixin):
1630
1630
  """
1631
1631
  Get all registered RPC objects.
1632
1632
  """
1633
+
1634
+
1635
+ class SpiralProgressBar(RPCBase):
1636
+ @rpc_call
1637
+ def get_all_rpc(self) -> "dict":
1638
+ """
1639
+ Get all registered RPC objects.
1640
+ """
1641
+
1642
+ @property
1643
+ @rpc_call
1644
+ def rpc_id(self) -> "str":
1645
+ """
1646
+ Get the RPC ID of the widget.
1647
+ """
1648
+
1649
+ @property
1650
+ @rpc_call
1651
+ def config_dict(self) -> "dict":
1652
+ """
1653
+ Get the configuration of the widget.
1654
+
1655
+ Returns:
1656
+ dict: The configuration of the widget.
1657
+ """
1658
+
1659
+ @property
1660
+ @rpc_call
1661
+ def rings(self):
1662
+ """
1663
+ None
1664
+ """
1665
+
1666
+ @rpc_call
1667
+ def update_config(self, config: "SpiralProgressBarConfig | dict"):
1668
+ """
1669
+ Update the configuration of the widget.
1670
+
1671
+ Args:
1672
+ config(SpiralProgressBarConfig|dict): Configuration to update.
1673
+ """
1674
+
1675
+ @rpc_call
1676
+ def add_ring(self, **kwargs) -> "Ring":
1677
+ """
1678
+ Add a new progress bar.
1679
+
1680
+ Args:
1681
+ **kwargs: Keyword arguments for the new progress bar.
1682
+
1683
+ Returns:
1684
+ Ring: Ring object.
1685
+ """
1686
+
1687
+ @rpc_call
1688
+ def remove_ring(self, index: "int"):
1689
+ """
1690
+ Remove a progress bar by index.
1691
+
1692
+ Args:
1693
+ index(int): Index of the progress bar to remove.
1694
+ """
1695
+
1696
+ @rpc_call
1697
+ def set_precision(self, precision: "int", bar_index: "int" = None):
1698
+ """
1699
+ Set the precision for the progress bars. If bar_index is not provide, the precision will be set for all progress bars.
1700
+
1701
+ Args:
1702
+ precision(int): Precision for the progress bars.
1703
+ bar_index(int): Index of the progress bar to set the precision for. If provided, only a single precision can be set.
1704
+ """
1705
+
1706
+ @rpc_call
1707
+ def set_min_max_values(
1708
+ self,
1709
+ min_values: "int | float | list[int | float]",
1710
+ max_values: "int | float | list[int | float]",
1711
+ ):
1712
+ """
1713
+ Set the minimum and maximum values for the progress bars.
1714
+
1715
+ Args:
1716
+ min_values(int|float | list[float]): Minimum value(s) for the progress bars. If multiple progress bars are displayed, provide a list of minimum values for each progress bar.
1717
+ max_values(int|float | list[float]): Maximum value(s) for the progress bars. If multiple progress bars are displayed, provide a list of maximum values for each progress bar.
1718
+ """
1719
+
1720
+ @rpc_call
1721
+ def set_number_of_bars(self, num_bars: "int"):
1722
+ """
1723
+ Set the number of progress bars to display.
1724
+
1725
+ Args:
1726
+ num_bars(int): Number of progress bars to display.
1727
+ """
1728
+
1729
+ @rpc_call
1730
+ def set_value(self, values: "int | list", ring_index: "int" = None):
1731
+ """
1732
+ Set the values for the progress bars.
1733
+
1734
+ Args:
1735
+ values(int | tuple): Value(s) for the progress bars. If multiple progress bars are displayed, provide a tuple of values for each progress bar.
1736
+ ring_index(int): Index of the progress bar to set the value for. If provided, only a single value can be set.
1737
+
1738
+ Examples:
1739
+ >>> SpiralProgressBar.set_value(50)
1740
+ >>> SpiralProgressBar.set_value([30, 40, 50]) # (outer, middle, inner)
1741
+ >>> SpiralProgressBar.set_value(60, bar_index=1) # Set the value for the middle progress bar.
1742
+ """
1743
+
1744
+ @rpc_call
1745
+ def set_colors_from_map(self, colormap, color_format: "Literal['RGB', 'HEX']" = "RGB"):
1746
+ """
1747
+ Set the colors for the progress bars from a colormap.
1748
+
1749
+ Args:
1750
+ colormap(str): Name of the colormap.
1751
+ color_format(Literal["RGB","HEX"]): Format of the returned colors ('RGB', 'HEX').
1752
+ """
1753
+
1754
+ @rpc_call
1755
+ def set_colors_directly(
1756
+ self, colors: "list[str | tuple] | str | tuple", bar_index: "int" = None
1757
+ ):
1758
+ """
1759
+ Set the colors for the progress bars directly.
1760
+
1761
+ Args:
1762
+ colors(list[str | tuple] | str | tuple): Color(s) for the progress bars. If multiple progress bars are displayed, provide a list of colors for each progress bar.
1763
+ bar_index(int): Index of the progress bar to set the color for. If provided, only a single color can be set.
1764
+ """
1765
+
1766
+ @rpc_call
1767
+ def set_line_widths(self, widths: "int | list[int]", bar_index: "int" = None):
1768
+ """
1769
+ Set the line widths for the progress bars.
1770
+
1771
+ Args:
1772
+ widths(int | list[int]): Line width(s) for the progress bars. If multiple progress bars are displayed, provide a list of line widths for each progress bar.
1773
+ bar_index(int): Index of the progress bar to set the line width for. If provided, only a single line width can be set.
1774
+ """
1775
+
1776
+ @rpc_call
1777
+ def set_gap(self, gap: "int"):
1778
+ """
1779
+ Set the gap between the progress bars.
1780
+
1781
+ Args:
1782
+ gap(int): Gap between the progress bars.
1783
+ """
1784
+
1785
+ @rpc_call
1786
+ def set_diameter(self, diameter: "int"):
1787
+ """
1788
+ Set the diameter of the widget.
1789
+
1790
+ Args:
1791
+ diameter(int): Diameter of the widget.
1792
+ """
1793
+
1794
+ @rpc_call
1795
+ def reset_diameter(self):
1796
+ """
1797
+ Reset the fixed size of the widget.
1798
+ """
1799
+
1800
+ @rpc_call
1801
+ def enable_auto_updates(self, enable: "bool" = True):
1802
+ """
1803
+ Enable or disable updates based on scan status. Overrides manual updates.
1804
+ The behaviour of the whole progress bar widget will be driven by the scan queue status.
1805
+
1806
+ Args:
1807
+ enable(bool): True or False.
1808
+
1809
+ Returns:
1810
+ bool: True if scan segment updates are enabled.
1811
+ """
1812
+
1813
+
1814
+ class Ring(RPCBase):
1815
+ @rpc_call
1816
+ def get_all_rpc(self) -> "dict":
1817
+ """
1818
+ Get all registered RPC objects.
1819
+ """
1820
+
1821
+ @property
1822
+ @rpc_call
1823
+ def rpc_id(self) -> "str":
1824
+ """
1825
+ Get the RPC ID of the widget.
1826
+ """
1827
+
1828
+ @property
1829
+ @rpc_call
1830
+ def config_dict(self) -> "dict":
1831
+ """
1832
+ Get the configuration of the widget.
1833
+
1834
+ Returns:
1835
+ dict: The configuration of the widget.
1836
+ """
1837
+
1838
+ @rpc_call
1839
+ def set_value(self, value: "int | float"):
1840
+ """
1841
+ None
1842
+ """
1843
+
1844
+ @rpc_call
1845
+ def set_color(self, color: "str | tuple"):
1846
+ """
1847
+ None
1848
+ """
1849
+
1850
+ @rpc_call
1851
+ def set_background(self, color: "str | tuple"):
1852
+ """
1853
+ None
1854
+ """
1855
+
1856
+ @rpc_call
1857
+ def set_line_width(self, width: "int"):
1858
+ """
1859
+ None
1860
+ """
1861
+
1862
+ @rpc_call
1863
+ def set_min_max_values(self, min_value: "int", max_value: "int"):
1864
+ """
1865
+ None
1866
+ """
1867
+
1868
+ @rpc_call
1869
+ def set_start_angle(self, start_angle: "int"):
1870
+ """
1871
+ None
1872
+ """
1873
+
1874
+ @rpc_call
1875
+ def set_connections(self, slot: "str", endpoint: "str | EndpointInfo"):
1876
+ """
1877
+ None
1878
+ """
1879
+
1880
+ @rpc_call
1881
+ def reset_connection(self):
1882
+ """
1883
+ None
1884
+ """
@@ -13,7 +13,6 @@ from functools import wraps
13
13
  from typing import TYPE_CHECKING
14
14
 
15
15
  from bec_lib.endpoints import MessageEndpoints
16
- from bec_lib.service_config import ServiceConfig
17
16
  from bec_lib.utils.import_utils import isinstance_based_on_class_name, lazy_import, lazy_import_from
18
17
  from qtpy.QtCore import QCoreApplication
19
18
 
@@ -22,8 +21,6 @@ import bec_widgets.cli.client as client
22
21
  if TYPE_CHECKING:
23
22
  from bec_lib.device import DeviceBase
24
23
 
25
- from bec_widgets.cli.client import BECDockArea, BECFigure
26
-
27
24
  messages = lazy_import("bec_lib.messages")
28
25
  # from bec_lib.connector import MessageObject
29
26
  MessageObject = lazy_import_from("bec_lib.connector", ("MessageObject",))
@@ -109,11 +109,14 @@ if __name__ == "__main__": # pragma: no cover
109
109
  import os
110
110
 
111
111
  from bec_widgets.utils import BECConnector
112
- from bec_widgets.widgets.dock import BECDock, BECDockArea
113
- from bec_widgets.widgets.figure import BECFigure
114
- from bec_widgets.widgets.plots import BECImageShow, BECMotorMap, BECPlotBase, BECWaveform
115
- from bec_widgets.widgets.plots.image import BECImageItem
116
- from bec_widgets.widgets.plots.waveform import BECCurve
112
+ from bec_widgets.widgets import BECDock, BECDockArea, BECFigure, SpiralProgressBar
113
+ from bec_widgets.widgets.figure.plots.image.image import BECImageShow
114
+ from bec_widgets.widgets.figure.plots.image.image_item import BECImageItem
115
+ from bec_widgets.widgets.figure.plots.motor_map.motor_map import BECMotorMap
116
+ from bec_widgets.widgets.figure.plots.plot_base import BECPlotBase
117
+ from bec_widgets.widgets.figure.plots.waveform.waveform import BECWaveform
118
+ from bec_widgets.widgets.figure.plots.waveform.waveform_curve import BECCurve
119
+ from bec_widgets.widgets.spiral_progress_bar.ring import Ring
117
120
 
118
121
  current_path = os.path.dirname(__file__)
119
122
  client_path = os.path.join(current_path, "client.py")
@@ -128,6 +131,8 @@ if __name__ == "__main__": # pragma: no cover
128
131
  BECMotorMap,
129
132
  BECDock,
130
133
  BECDockArea,
134
+ SpiralProgressBar,
135
+ Ring,
131
136
  ]
132
137
  generator = ClientGenerator()
133
138
  generator.generate_client(clss)
@@ -1,11 +1,12 @@
1
1
  from bec_widgets.utils import BECConnector
2
2
  from bec_widgets.widgets.figure import BECFigure
3
+ from bec_widgets.widgets.spiral_progress_bar.spiral_progress_bar import SpiralProgressBar
3
4
 
4
5
 
5
6
  class RPCWidgetHandler:
6
7
  """Handler class for creating widgets from RPC messages."""
7
8
 
8
- widget_classes = {"BECFigure": BECFigure}
9
+ widget_classes = {"BECFigure": BECFigure, "SpiralProgressBar": SpiralProgressBar}
9
10
 
10
11
  @staticmethod
11
12
  def create_widget(widget_type, **kwargs) -> BECConnector:
bec_widgets/cli/server.py CHANGED
@@ -1,7 +1,5 @@
1
1
  import inspect
2
- import threading
3
- import time
4
- from typing import Literal, Union
2
+ from typing import Union
5
3
 
6
4
  from bec_lib.endpoints import MessageEndpoints
7
5
  from bec_lib.utils.import_utils import lazy_import
@@ -12,13 +10,11 @@ from bec_widgets.utils import BECDispatcher
12
10
  from bec_widgets.utils.bec_connector import BECConnector
13
11
  from bec_widgets.widgets.dock.dock_area import BECDockArea
14
12
  from bec_widgets.widgets.figure import BECFigure
15
- from bec_widgets.widgets.plots import BECCurve, BECImageShow, BECWaveform
16
13
 
17
14
  messages = lazy_import("bec_lib.messages")
18
15
 
19
16
 
20
17
  class BECWidgetsCLIServer:
21
- WIDGETS = [BECWaveform, BECFigure, BECCurve, BECImageShow]
22
18
 
23
19
  def __init__(
24
20
  self,
@@ -127,11 +123,13 @@ if __name__ == "__main__": # pragma: no cover
127
123
  from qtpy.QtGui import QIcon
128
124
  from qtpy.QtWidgets import QApplication, QMainWindow
129
125
 
126
+ import bec_widgets
127
+
130
128
  app = QApplication(sys.argv)
131
129
  app.setApplicationName("BEC Figure")
132
- current_path = os.path.dirname(__file__)
130
+ module_path = os.path.dirname(bec_widgets.__file__)
133
131
  icon = QIcon()
134
- icon.addFile(os.path.join(current_path, "bec_widgets_icon.png"), size=QSize(48, 48))
132
+ icon.addFile(os.path.join(module_path, "assets", "bec_widgets_icon.png"), size=QSize(48, 48))
135
133
  app.setWindowIcon(icon)
136
134
 
137
135
  win = QMainWindow()
@@ -13,6 +13,7 @@ from bec_widgets.cli.rpc_register import RPCRegister
13
13
  from bec_widgets.utils import BECDispatcher
14
14
  from bec_widgets.widgets import BECFigure
15
15
  from bec_widgets.widgets.dock.dock_area import BECDockArea
16
+ from bec_widgets.widgets.spiral_progress_bar.spiral_progress_bar import SpiralProgressBar
16
17
 
17
18
 
18
19
  class JupyterConsoleWidget(RichJupyterWidget): # pragma: no cover:
@@ -62,6 +63,7 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
62
63
  "d1": self.d1,
63
64
  "d2": self.d2,
64
65
  "d3": self.d3,
66
+ "bar": self.bar,
65
67
  "b2a": self.button_2_a,
66
68
  "b2b": self.button_2_b,
67
69
  "b2c": self.button_2_c,
@@ -93,7 +95,7 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
93
95
  self.console.set_default_style("linux")
94
96
 
95
97
  def _init_figure(self):
96
- self.figure.plot("samx", "bpm4d")
98
+ self.figure.plot(x_name="samx", y_name="bpm4d")
97
99
  self.figure.motor_map("samx", "samy")
98
100
  self.figure.image("eiger", color_map="viridis", vrange=(0, 100))
99
101
 
@@ -114,17 +116,17 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
114
116
  self.button_2_b = QtWidgets.QPushButton("button after without postions specified")
115
117
  self.button_2_c = QtWidgets.QPushButton("button super late")
116
118
  self.button_3 = QtWidgets.QPushButton("Button above Figure ")
117
- self.label_1 = QtWidgets.QLabel("some scan info label with useful information")
119
+ self.bar = SpiralProgressBar()
118
120
 
119
121
  self.label_2 = QtWidgets.QLabel("label which is added separately")
120
122
  self.label_3 = QtWidgets.QLabel("Label above figure")
121
123
 
122
124
  self.d1 = self.dock.add_dock(widget=self.button_1, position="left")
123
125
  self.d1.addWidget(self.label_2)
124
- self.d2 = self.dock.add_dock(widget=self.label_1, position="right")
126
+ self.d2 = self.dock.add_dock(widget=self.bar, position="right")
125
127
  self.d3 = self.dock.add_dock(name="figure")
126
128
  self.fig_dock3 = BECFigure()
127
- self.fig_dock3.plot("samx", "bpm4d")
129
+ self.fig_dock3.plot(x_name="samx", y_name="bpm4d")
128
130
  self.d3.add_widget(self.label_3)
129
131
  self.d3.add_widget(self.button_3)
130
132
  self.d3.add_widget(self.fig_dock3)
@@ -142,6 +144,10 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
142
144
  if __name__ == "__main__": # pragma: no cover
143
145
  import sys
144
146
 
147
+ import bec_widgets
148
+
149
+ module_path = os.path.dirname(bec_widgets.__file__)
150
+
145
151
  bec_dispatcher = BECDispatcher()
146
152
  client = bec_dispatcher.client
147
153
  client.start()
@@ -150,7 +156,7 @@ if __name__ == "__main__": # pragma: no cover
150
156
  app.setApplicationName("Jupyter Console")
151
157
  app.setApplicationDisplayName("Jupyter Console")
152
158
  icon = QIcon()
153
- icon.addFile("terminal_icon.png", size=QSize(48, 48))
159
+ icon.addFile(os.path.join(module_path, "assets", "terminal_icon.png"), size=QSize(48, 48))
154
160
  app.setWindowIcon(icon)
155
161
  win = JupyterConsoleWindow()
156
162
  win.show()
@@ -5,14 +5,15 @@ from qtpy.QtCore import Qt
5
5
  from qtpy.QtWidgets import QApplication, QSplitter, QVBoxLayout, QWidget
6
6
 
7
7
  from bec_widgets.utils.bec_dispatcher import BECDispatcher
8
- from bec_widgets.widgets import (
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 (
9
11
  MotorControlAbsolute,
12
+ )
13
+ from bec_widgets.widgets.motor_control.movement_relative.movement_relative import (
10
14
  MotorControlRelative,
11
- MotorControlSelection,
12
- MotorCoordinateTable,
13
- MotorMap,
14
- MotorThread,
15
15
  )
16
+ from bec_widgets.widgets.motor_control.selection.selection import MotorControlSelection
16
17
 
17
18
  CONFIG_DEFAULT = {
18
19
  "motor_control": {
@@ -58,13 +59,13 @@ class MotorControlApp(QWidget):
58
59
  # Widgets
59
60
  self.motor_control_panel = MotorControlPanel(client=self.client, config=self.config)
60
61
  # Create MotorMap
61
- self.motion_map = MotorMap(client=self.client, config=self.config)
62
+ # self.motion_map = MotorMap(client=self.client, config=self.config)
62
63
  # Create MotorCoordinateTable
63
64
  self.motor_table = MotorCoordinateTable(client=self.client, config=self.config)
64
65
 
65
66
  # Create the splitter and add MotorMap and MotorControlPanel
66
67
  splitter = QSplitter(Qt.Horizontal)
67
- splitter.addWidget(self.motion_map)
68
+ # splitter.addWidget(self.motion_map)
68
69
  splitter.addWidget(self.motor_control_panel)
69
70
  splitter.addWidget(self.motor_table)
70
71
 
@@ -74,9 +75,9 @@ class MotorControlApp(QWidget):
74
75
  self.setLayout(layout)
75
76
 
76
77
  # Connecting signals and slots
77
- self.motor_control_panel.selection_widget.selected_motors_signal.connect(
78
- lambda x, y: self.motion_map.change_motors(x, y, 0)
79
- )
78
+ # self.motor_control_panel.selection_widget.selected_motors_signal.connect(
79
+ # lambda x, y: self.motion_map.change_motors(x, y, 0)
80
+ # )
80
81
  self.motor_control_panel.absolute_widget.coordinates_signal.connect(
81
82
  self.motor_table.add_coordinate
82
83
  )
@@ -87,7 +88,7 @@ class MotorControlApp(QWidget):
87
88
  self.motor_control_panel.absolute_widget.set_precision
88
89
  )
89
90
 
90
- self.motor_table.plot_coordinates_signal.connect(self.motion_map.plot_saved_coordinates)
91
+ # self.motor_table.plot_coordinates_signal.connect(self.motion_map.plot_saved_coordinates)
91
92
 
92
93
 
93
94
  class MotorControlMap(QWidget):
@@ -101,11 +102,11 @@ class MotorControlMap(QWidget):
101
102
  # Widgets
102
103
  self.motor_control_panel = MotorControlPanel(client=self.client, config=self.config)
103
104
  # Create MotorMap
104
- self.motion_map = MotorMap(client=self.client, config=self.config)
105
+ # self.motion_map = MotorMap(client=self.client, config=self.config)
105
106
 
106
107
  # Create the splitter and add MotorMap and MotorControlPanel
107
108
  splitter = QSplitter(Qt.Horizontal)
108
- splitter.addWidget(self.motion_map)
109
+ # splitter.addWidget(self.motion_map)
109
110
  splitter.addWidget(self.motor_control_panel)
110
111
 
111
112
  # Set the main layout
@@ -114,9 +115,9 @@ class MotorControlMap(QWidget):
114
115
  self.setLayout(layout)
115
116
 
116
117
  # Connecting signals and slots
117
- self.motor_control_panel.selection_widget.selected_motors_signal.connect(
118
- lambda x, y: self.motion_map.change_motors(x, y, 0)
119
- )
118
+ # self.motor_control_panel.selection_widget.selected_motors_signal.connect(
119
+ # lambda x, y: self.motion_map.change_motors(x, y, 0)
120
+ # )
120
121
 
121
122
 
122
123
  class MotorControlPanel(QWidget):
@@ -1,13 +1,4 @@
1
1
  from .dock import BECDock, BECDockArea
2
2
  from .figure import BECFigure, FigureConfig
3
- from .monitor import BECMonitor
4
- from .motor_control import (
5
- MotorControlAbsolute,
6
- MotorControlRelative,
7
- MotorControlSelection,
8
- MotorCoordinateTable,
9
- MotorThread,
10
- )
11
- from .motor_map import MotorMap
12
- from .plots import BECCurve, BECMotorMap, BECWaveform
13
3
  from .scan_control import ScanControl
4
+ from .spiral_progress_bar import SpiralProgressBar