bec-widgets 1.4.0__py3-none-any.whl → 1.5.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.
CHANGELOG.md CHANGED
@@ -1,6 +1,32 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v1.5.0 (2024-11-12)
5
+
6
+ ### Bug Fixes
7
+
8
+ - **crosshair**: Crosshair adapted for multi waveform widget
9
+ ([`0cd85ed`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0cd85ed9fa5b67a6ecce89985cd4f54b7bbe3a4b))
10
+
11
+ ### Documentation
12
+
13
+ - **multi_waveform**: Docs added
14
+ ([`42d4f18`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/42d4f182f790a97687ca3b6d0e72866070a89767))
15
+
16
+ ### Features
17
+
18
+ - **multi-waveform**: New widget added
19
+ ([`f3a39a6`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/f3a39a69e29d490b3023a508ced18028c4205772))
20
+
21
+
22
+ ## v1.4.1 (2024-11-12)
23
+
24
+ ### Bug Fixes
25
+
26
+ - **positioner_box**: Adjusted default signals
27
+ ([`8e5c0ad`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/8e5c0ad8c8eff5a9308169bc663d2b7230f0ebb1))
28
+
29
+
4
30
  ## v1.4.0 (2024-11-11)
5
31
 
6
32
  ### Bug Fixes
@@ -176,9 +202,6 @@ This property tells if expand should show a popup (by default), or if the widget
176
202
  - Emit 'device_selected' and 'scan_axis' from scan control widget
177
203
  ([`0b9b1a3`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/0b9b1a3c89a98505079f7d4078915b7bbfaa1e23))
178
204
 
179
- - New 'device_selected' signals to ScanControl, ScanGroupBox, DeviceLineEdit
180
- ([`9801d27`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9801d2769eb0ee95c94ec0c011e1dac1407142ae))
181
-
182
205
  ### Refactoring
183
206
 
184
207
  - Redesign of scan selection and scan control boxes
@@ -186,24 +209,3 @@ This property tells if expand should show a popup (by default), or if the widget
186
209
 
187
210
  - Move add/remove bundle to scan group box
188
211
  ([`e3d0a7b`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/e3d0a7bbf9918dc16eb7227a178c310256ce570d))
189
-
190
-
191
- ## v0.118.0 (2024-10-13)
192
-
193
- ### Documentation
194
-
195
- - **sphinx-build**: Adjusted pyside verion
196
- ([`b236951`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/b23695167ab969f754a058ffdccca2b40f00a008))
197
-
198
- ### Features
199
-
200
- - **image**: Image widget can take data from monitor_1d endpoint
201
- ([`9ef1d1c`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/9ef1d1c9ac2178d9fa2e655942208f8abbdf5c1b))
202
-
203
-
204
- ## v0.117.1 (2024-10-11)
205
-
206
- ### Bug Fixes
207
-
208
- - **FPS**: Qtimer cleanup leaking
209
- ([`3a22392`](https://gitlab.psi.ch/bec/bec_widgets/-/commit/3a2239278075de7489ad10a58c31d7d89715e221))
PKG-INFO CHANGED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bec_widgets
3
- Version: 1.4.0
3
+ Version: 1.5.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
@@ -22,6 +22,7 @@ class Widgets(str, enum.Enum):
22
22
  BECFigure = "BECFigure"
23
23
  BECImageWidget = "BECImageWidget"
24
24
  BECMotorMapWidget = "BECMotorMapWidget"
25
+ BECMultiWaveformWidget = "BECMultiWaveformWidget"
25
26
  BECProgressBar = "BECProgressBar"
26
27
  BECQueue = "BECQueue"
27
28
  BECStatusBox = "BECStatusBox"
@@ -1574,6 +1575,436 @@ class BECMotorMapWidget(RPCBase):
1574
1575
  """
1575
1576
 
1576
1577
 
1578
+ class BECMultiWaveform(RPCBase):
1579
+ @property
1580
+ @rpc_call
1581
+ def _rpc_id(self) -> "str":
1582
+ """
1583
+ Get the RPC ID of the widget.
1584
+ """
1585
+
1586
+ @property
1587
+ @rpc_call
1588
+ def _config_dict(self) -> "dict":
1589
+ """
1590
+ Get the configuration of the widget.
1591
+
1592
+ Returns:
1593
+ dict: The configuration of the widget.
1594
+ """
1595
+
1596
+ @property
1597
+ @rpc_call
1598
+ def curves(self) -> collections.deque:
1599
+ """
1600
+ Get the curves of the plot widget as a deque.
1601
+ Returns:
1602
+ deque: Deque of curves.
1603
+ """
1604
+
1605
+ @rpc_call
1606
+ def set_monitor(self, monitor: str):
1607
+ """
1608
+ Set the monitor for the plot widget.
1609
+ Args:
1610
+ monitor (str): The monitor to set.
1611
+ """
1612
+
1613
+ @rpc_call
1614
+ def set_opacity(self, opacity: int):
1615
+ """
1616
+ Set the opacity of the curve on the plot.
1617
+
1618
+ Args:
1619
+ opacity(int): The opacity of the curve. 0-100.
1620
+ """
1621
+
1622
+ @rpc_call
1623
+ def set_curve_limit(self, max_trace: int, flush_buffer: bool = False):
1624
+ """
1625
+ Set the maximum number of traces to display on the plot.
1626
+
1627
+ Args:
1628
+ max_trace (int): The maximum number of traces to display.
1629
+ flush_buffer (bool): Flush the buffer.
1630
+ """
1631
+
1632
+ @rpc_call
1633
+ def set_curve_highlight(self, index: int):
1634
+ """
1635
+ Set the curve highlight based on visible curves.
1636
+
1637
+ Args:
1638
+ index (int): The index of the curve to highlight among visible curves.
1639
+ """
1640
+
1641
+ @rpc_call
1642
+ def set_colormap(self, colormap: str):
1643
+ """
1644
+ Set the colormap for the scatter plot z gradient.
1645
+
1646
+ Args:
1647
+ colormap(str): Colormap for the scatter plot.
1648
+ """
1649
+
1650
+ @rpc_call
1651
+ def set(self, **kwargs) -> "None":
1652
+ """
1653
+ Set the properties of the plot widget.
1654
+
1655
+ Args:
1656
+ **kwargs: Keyword arguments for the properties to be set.
1657
+
1658
+ Possible properties:
1659
+ - title: str
1660
+ - x_label: str
1661
+ - y_label: str
1662
+ - x_scale: Literal["linear", "log"]
1663
+ - y_scale: Literal["linear", "log"]
1664
+ - x_lim: tuple
1665
+ - y_lim: tuple
1666
+ - legend_label_size: int
1667
+ """
1668
+
1669
+ @rpc_call
1670
+ def set_title(self, title: "str", size: "int" = None):
1671
+ """
1672
+ Set the title of the plot widget.
1673
+
1674
+ Args:
1675
+ title(str): Title of the plot widget.
1676
+ size(int): Font size of the title.
1677
+ """
1678
+
1679
+ @rpc_call
1680
+ def set_x_label(self, label: "str", size: "int" = None):
1681
+ """
1682
+ Set the label of the x-axis.
1683
+
1684
+ Args:
1685
+ label(str): Label of the x-axis.
1686
+ size(int): Font size of the label.
1687
+ """
1688
+
1689
+ @rpc_call
1690
+ def set_y_label(self, label: "str", size: "int" = None):
1691
+ """
1692
+ Set the label of the y-axis.
1693
+
1694
+ Args:
1695
+ label(str): Label of the y-axis.
1696
+ size(int): Font size of the label.
1697
+ """
1698
+
1699
+ @rpc_call
1700
+ def set_x_scale(self, scale: "Literal['linear', 'log']" = "linear"):
1701
+ """
1702
+ Set the scale of the x-axis.
1703
+
1704
+ Args:
1705
+ scale(Literal["linear", "log"]): Scale of the x-axis.
1706
+ """
1707
+
1708
+ @rpc_call
1709
+ def set_y_scale(self, scale: "Literal['linear', 'log']" = "linear"):
1710
+ """
1711
+ Set the scale of the y-axis.
1712
+
1713
+ Args:
1714
+ scale(Literal["linear", "log"]): Scale of the y-axis.
1715
+ """
1716
+
1717
+ @rpc_call
1718
+ def set_x_lim(self, *args) -> "None":
1719
+ """
1720
+ Set the limits of the x-axis. This method can accept either two separate arguments
1721
+ for the minimum and maximum x-axis values, or a single tuple containing both limits.
1722
+
1723
+ Usage:
1724
+ set_x_lim(x_min, x_max)
1725
+ set_x_lim((x_min, x_max))
1726
+
1727
+ Args:
1728
+ *args: A variable number of arguments. Can be two integers (x_min and x_max)
1729
+ or a single tuple with two integers.
1730
+ """
1731
+
1732
+ @rpc_call
1733
+ def set_y_lim(self, *args) -> "None":
1734
+ """
1735
+ Set the limits of the y-axis. This method can accept either two separate arguments
1736
+ for the minimum and maximum y-axis values, or a single tuple containing both limits.
1737
+
1738
+ Usage:
1739
+ set_y_lim(y_min, y_max)
1740
+ set_y_lim((y_min, y_max))
1741
+
1742
+ Args:
1743
+ *args: A variable number of arguments. Can be two integers (y_min and y_max)
1744
+ or a single tuple with two integers.
1745
+ """
1746
+
1747
+ @rpc_call
1748
+ def set_grid(self, x: "bool" = False, y: "bool" = False):
1749
+ """
1750
+ Set the grid of the plot widget.
1751
+
1752
+ Args:
1753
+ x(bool): Show grid on the x-axis.
1754
+ y(bool): Show grid on the y-axis.
1755
+ """
1756
+
1757
+ @rpc_call
1758
+ def set_colormap(self, colormap: str):
1759
+ """
1760
+ Set the colormap for the scatter plot z gradient.
1761
+
1762
+ Args:
1763
+ colormap(str): Colormap for the scatter plot.
1764
+ """
1765
+
1766
+ @rpc_call
1767
+ def enable_fps_monitor(self, enable: "bool" = True):
1768
+ """
1769
+ Enable the FPS monitor.
1770
+
1771
+ Args:
1772
+ enable(bool): True to enable, False to disable.
1773
+ """
1774
+
1775
+ @rpc_call
1776
+ def lock_aspect_ratio(self, lock):
1777
+ """
1778
+ Lock aspect ratio.
1779
+
1780
+ Args:
1781
+ lock(bool): True to lock, False to unlock.
1782
+ """
1783
+
1784
+ @rpc_call
1785
+ def get_all_data(self, output: Literal["dict", "pandas"] = "dict") -> dict:
1786
+ """
1787
+ Extract all curve data into a dictionary or a pandas DataFrame.
1788
+
1789
+ Args:
1790
+ output (Literal["dict", "pandas"]): Format of the output data.
1791
+
1792
+ Returns:
1793
+ dict | pd.DataFrame: Data of all curves in the specified format.
1794
+ """
1795
+
1796
+ @rpc_call
1797
+ def export(self):
1798
+ """
1799
+ Show the Export Dialog of the plot widget.
1800
+ """
1801
+
1802
+ @rpc_call
1803
+ def remove(self):
1804
+ """
1805
+ Remove the plot widget from the figure.
1806
+ """
1807
+
1808
+
1809
+ class BECMultiWaveformWidget(RPCBase):
1810
+ @property
1811
+ @rpc_call
1812
+ def curves(self) -> list[pyqtgraph.graphicsItems.PlotDataItem.PlotDataItem]:
1813
+ """
1814
+ Get the curves of the plot widget as a list
1815
+ Returns:
1816
+ list: List of curves.
1817
+ """
1818
+
1819
+ @rpc_call
1820
+ def set_monitor(self, monitor: str) -> None:
1821
+ """
1822
+ Set the monitor of the plot widget.
1823
+
1824
+ Args:
1825
+ monitor(str): The monitor to set.
1826
+ """
1827
+
1828
+ @rpc_call
1829
+ def set_curve_highlight(self, index: int) -> None:
1830
+ """
1831
+ Set the curve highlight of the plot widget by index
1832
+
1833
+ Args:
1834
+ index(int): The index of the curve to highlight.
1835
+ """
1836
+
1837
+ @rpc_call
1838
+ def set_opacity(self, opacity: int) -> None:
1839
+ """
1840
+ Set the opacity of the plot widget.
1841
+
1842
+ Args:
1843
+ opacity(int): The opacity to set.
1844
+ """
1845
+
1846
+ @rpc_call
1847
+ def set_curve_limit(self, curve_limit: int) -> None:
1848
+ """
1849
+ Set the maximum number of traces to display on the plot widget.
1850
+
1851
+ Args:
1852
+ curve_limit(int): The maximum number of traces to display.
1853
+ """
1854
+
1855
+ @rpc_call
1856
+ def set_buffer_flush(self, flush_buffer: bool) -> None:
1857
+ """
1858
+ Set the buffer flush property of the plot widget.
1859
+
1860
+ Args:
1861
+ flush_buffer(bool): True to flush the buffer, False to not flush the buffer.
1862
+ """
1863
+
1864
+ @rpc_call
1865
+ def set_highlight_last_curve(self, enable: bool) -> None:
1866
+ """
1867
+ Enable or disable highlighting of the last curve.
1868
+
1869
+ Args:
1870
+ enable(bool): True to enable highlighting of the last curve, False to disable.
1871
+ """
1872
+
1873
+ @rpc_call
1874
+ def set_colormap(self, colormap: str) -> None:
1875
+ """
1876
+ Set the colormap of the plot widget.
1877
+
1878
+ Args:
1879
+ colormap(str): The colormap to set.
1880
+ """
1881
+
1882
+ @rpc_call
1883
+ def set(self, **kwargs):
1884
+ """
1885
+ Set the properties of the plot widget.
1886
+
1887
+ Args:
1888
+ **kwargs: Keyword arguments for the properties to be set.
1889
+
1890
+ Possible properties:
1891
+ - title: str
1892
+ - x_label: str
1893
+ - y_label: str
1894
+ - x_scale: Literal["linear", "log"]
1895
+ - y_scale: Literal["linear", "log"]
1896
+ - x_lim: tuple
1897
+ - y_lim: tuple
1898
+ - legend_label_size: int
1899
+ """
1900
+
1901
+ @rpc_call
1902
+ def set_title(self, title: str):
1903
+ """
1904
+ Set the title of the plot widget.
1905
+
1906
+ Args:
1907
+ title(str): The title to set.
1908
+ """
1909
+
1910
+ @rpc_call
1911
+ def set_x_label(self, x_label: str):
1912
+ """
1913
+ Set the x-axis label of the plot widget.
1914
+
1915
+ Args:
1916
+ x_label(str): The x-axis label to set.
1917
+ """
1918
+
1919
+ @rpc_call
1920
+ def set_y_label(self, y_label: str):
1921
+ """
1922
+ Set the y-axis label of the plot widget.
1923
+
1924
+ Args:
1925
+ y_label(str): The y-axis label to set.
1926
+ """
1927
+
1928
+ @rpc_call
1929
+ def set_x_scale(self, x_scale: Literal["linear", "log"]):
1930
+ """
1931
+ Set the x-axis scale of the plot widget.
1932
+
1933
+ Args:
1934
+ x_scale(str): The x-axis scale to set.
1935
+ """
1936
+
1937
+ @rpc_call
1938
+ def set_y_scale(self, y_scale: Literal["linear", "log"]):
1939
+ """
1940
+ Set the y-axis scale of the plot widget.
1941
+
1942
+ Args:
1943
+ y_scale(str): The y-axis scale to set.
1944
+ """
1945
+
1946
+ @rpc_call
1947
+ def set_x_lim(self, x_lim: tuple):
1948
+ """
1949
+ Set x-axis limits of the plot widget.
1950
+
1951
+ Args:
1952
+ x_lim(tuple): The x-axis limits to set.
1953
+ """
1954
+
1955
+ @rpc_call
1956
+ def set_y_lim(self, y_lim: tuple):
1957
+ """
1958
+ Set y-axis limits of the plot widget.
1959
+
1960
+ Args:
1961
+ y_lim(tuple): The y-axis limits to set.
1962
+ """
1963
+
1964
+ @rpc_call
1965
+ def set_grid(self, x_grid: bool, y_grid: bool):
1966
+ """
1967
+ Set the grid of the plot widget.
1968
+
1969
+ Args:
1970
+ x_grid(bool): True to enable the x-grid, False to disable.
1971
+ y_grid(bool): True to enable the y-grid, False to disable.
1972
+ """
1973
+
1974
+ @rpc_call
1975
+ def set_colormap(self, colormap: str) -> None:
1976
+ """
1977
+ Set the colormap of the plot widget.
1978
+
1979
+ Args:
1980
+ colormap(str): The colormap to set.
1981
+ """
1982
+
1983
+ @rpc_call
1984
+ def enable_fps_monitor(self, enabled: bool):
1985
+ """
1986
+ Enable or disable the FPS monitor
1987
+
1988
+ Args:
1989
+ enabled(bool): True to enable the FPS monitor, False to disable.
1990
+ """
1991
+
1992
+ @rpc_call
1993
+ def lock_aspect_ratio(self, lock: bool):
1994
+ """
1995
+ Lock the aspect ratio of the plot widget.
1996
+
1997
+ Args:
1998
+ lock(bool): True to lock the aspect ratio, False to unlock.
1999
+ """
2000
+
2001
+ @rpc_call
2002
+ def export(self):
2003
+ """
2004
+ Export the plot widget.
2005
+ """
2006
+
2007
+
1577
2008
  class BECPlotBase(RPCBase):
1578
2009
  @property
1579
2010
  @rpc_call
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from threading import Lock
2
4
  from weakref import WeakValueDictionary
3
5
 
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from bec_widgets.utils import BECConnector
2
4
 
3
5
 
@@ -56,6 +56,7 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
56
56
  # "cm": self.colormap,
57
57
  "im": self.im,
58
58
  "mm": self.mm,
59
+ "mw": self.mw,
59
60
  }
60
61
  )
61
62
 
@@ -167,9 +168,11 @@ class JupyterConsoleWindow(QWidget): # pragma: no cover:
167
168
  self.im.image("waveform", "1d")
168
169
 
169
170
  self.d2 = self.dock.add_dock(name="dock_2", position="bottom")
170
- self.wf = self.d2.add_widget("BECWaveformWidget", row=0, col=0)
171
- self.wf.plot(x_name="samx", y_name="bpm3a")
172
- self.wf.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
171
+ self.wf = self.d2.add_widget("BECFigure", row=0, col=0)
172
+
173
+ self.mw = self.wf.multi_waveform(monitor="waveform") # , config=config)
174
+ # self.wf.plot(x_name="samx", y_name="bpm3a")
175
+ # self.wf.plot(x_name="samx", y_name="bpm4i", dap="GaussianModel")
173
176
  # self.bar = self.d2.add_widget("RingProgressBar", row=0, col=1)
174
177
  # self.bar.set_diameter(200)
175
178
 
@@ -210,6 +213,7 @@ if __name__ == "__main__": # pragma: no cover
210
213
 
211
214
  win = JupyterConsoleWindow()
212
215
  win.show()
216
+ win.resize(1200, 800)
213
217
 
214
218
  app.aboutToQuit.connect(win.close)
215
219
  sys.exit(app.exec_())