bec-widgets 2.10.2__py3-none-any.whl → 2.11.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 +59 -0
- PKG-INFO +1 -1
- bec_widgets/cli/client.py +5 -5
- bec_widgets/widgets/plots/image/image.py +128 -856
- bec_widgets/widgets/plots/image/image_base.py +1062 -0
- bec_widgets/widgets/plots/image/image_item.py +7 -6
- bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py +8 -11
- bec_widgets/widgets/utility/visual/color_button_native/color_button_native.py +17 -2
- {bec_widgets-2.10.2.dist-info → bec_widgets-2.11.0.dist-info}/METADATA +1 -1
- {bec_widgets-2.10.2.dist-info → bec_widgets-2.11.0.dist-info}/RECORD +14 -13
- pyproject.toml +1 -1
- {bec_widgets-2.10.2.dist-info → bec_widgets-2.11.0.dist-info}/WHEEL +0 -0
- {bec_widgets-2.10.2.dist-info → bec_widgets-2.11.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-2.10.2.dist-info → bec_widgets-2.11.0.dist-info}/licenses/LICENSE +0 -0
@@ -21,9 +21,6 @@ logger = bec_logger.logger
|
|
21
21
|
# noinspection PyDataclass
|
22
22
|
class ImageItemConfig(ConnectionConfig): # TODO review config
|
23
23
|
parent_id: str | None = Field(None, description="The parent plot of the image.")
|
24
|
-
monitor: str | None = Field(None, description="The name of the monitor.")
|
25
|
-
monitor_type: Literal["1d", "2d", "auto"] = Field("auto", description="The type of monitor.")
|
26
|
-
source: str | None = Field(None, description="The source of the curve.")
|
27
24
|
color_map: str | None = Field("plasma", description="The color map of the image.")
|
28
25
|
downsample: bool | None = Field(True, description="Whether to downsample the image.")
|
29
26
|
opacity: float | None = Field(1.0, description="The opacity of the image.")
|
@@ -43,6 +40,7 @@ class ImageItemConfig(ConnectionConfig): # TODO review config
|
|
43
40
|
|
44
41
|
|
45
42
|
class ImageItem(BECConnector, pg.ImageItem):
|
43
|
+
|
46
44
|
RPC = True
|
47
45
|
USER_ACCESS = [
|
48
46
|
"color_map",
|
@@ -69,12 +67,13 @@ class ImageItem(BECConnector, pg.ImageItem):
|
|
69
67
|
]
|
70
68
|
|
71
69
|
vRangeChangedManually = Signal(tuple)
|
70
|
+
removed = Signal(str)
|
72
71
|
|
73
72
|
def __init__(
|
74
73
|
self,
|
75
74
|
config: Optional[ImageItemConfig] = None,
|
76
75
|
gui_id: Optional[str] = None,
|
77
|
-
parent_image=None,
|
76
|
+
parent_image=None, # FIXME: rename to parent
|
78
77
|
**kwargs,
|
79
78
|
):
|
80
79
|
if config is None:
|
@@ -274,6 +273,8 @@ class ImageItem(BECConnector, pg.ImageItem):
|
|
274
273
|
self.buffer = []
|
275
274
|
self.max_len = 0
|
276
275
|
|
277
|
-
def remove(self):
|
278
|
-
self.parent().disconnect_monitor(self.config.monitor)
|
276
|
+
def remove(self, emit: bool = True):
|
279
277
|
self.clear()
|
278
|
+
super().remove()
|
279
|
+
if emit:
|
280
|
+
self.removed.emit(self.objectName())
|
@@ -22,6 +22,7 @@ from qtpy.QtWidgets import (
|
|
22
22
|
QWidget,
|
23
23
|
)
|
24
24
|
|
25
|
+
from bec_widgets import SafeSlot
|
25
26
|
from bec_widgets.utils import ConnectionConfig, EntryValidator
|
26
27
|
from bec_widgets.utils.bec_widget import BECWidget
|
27
28
|
from bec_widgets.utils.colors import Colors
|
@@ -154,7 +155,7 @@ class CurveRow(QTreeWidgetItem):
|
|
154
155
|
"""Create columns 3..6: color button, style combo, width spin, symbol spin."""
|
155
156
|
# Color in col 3
|
156
157
|
self.color_button = ColorButtonNative(color=self.config.color)
|
157
|
-
self.color_button.
|
158
|
+
self.color_button.color_changed.connect(self._on_color_changed)
|
158
159
|
self.tree.setItemWidget(self, 3, self.color_button)
|
159
160
|
|
160
161
|
# Style in col 4
|
@@ -177,20 +178,16 @@ class CurveRow(QTreeWidgetItem):
|
|
177
178
|
self.symbol_spin.setValue(self.config.symbol_size)
|
178
179
|
self.tree.setItemWidget(self, 6, self.symbol_spin)
|
179
180
|
|
180
|
-
|
181
|
+
@SafeSlot(str, verify_sender=True)
|
182
|
+
def _on_color_changed(self, new_color: str):
|
181
183
|
"""
|
182
|
-
|
183
|
-
related configuration properties based on the chosen color.
|
184
|
+
Update configuration when the color button emits a change.
|
184
185
|
|
185
186
|
Args:
|
186
|
-
|
187
|
+
new_color (str): The new color in hex format.
|
187
188
|
"""
|
188
|
-
|
189
|
-
|
190
|
-
if chosen_color.isValid():
|
191
|
-
button.set_color(chosen_color)
|
192
|
-
self.config.color = chosen_color.name()
|
193
|
-
self.config.symbol_color = chosen_color.name()
|
189
|
+
self.config.color = new_color
|
190
|
+
self.config.symbol_color = new_color
|
194
191
|
|
195
192
|
def add_dap_row(self):
|
196
193
|
"""Create a new DAP row as a child. Only valid if source='device'."""
|
@@ -1,5 +1,8 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
|
3
|
+
from qtpy.QtCore import Signal
|
1
4
|
from qtpy.QtGui import QColor
|
2
|
-
from qtpy.QtWidgets import QPushButton
|
5
|
+
from qtpy.QtWidgets import QColorDialog, QPushButton
|
3
6
|
|
4
7
|
from bec_widgets import BECWidget, SafeProperty, SafeSlot
|
5
8
|
|
@@ -12,6 +15,8 @@ class ColorButtonNative(BECWidget, QPushButton):
|
|
12
15
|
to guarantee good readability.
|
13
16
|
"""
|
14
17
|
|
18
|
+
color_changed = Signal(str)
|
19
|
+
|
15
20
|
RPC = False
|
16
21
|
PLUGIN = True
|
17
22
|
ICON_NAME = "colors"
|
@@ -25,9 +30,10 @@ class ColorButtonNative(BECWidget, QPushButton):
|
|
25
30
|
"""
|
26
31
|
super().__init__(parent=parent, **kwargs)
|
27
32
|
self.set_color(color)
|
33
|
+
self.clicked.connect(self._open_color_dialog)
|
28
34
|
|
29
35
|
@SafeSlot()
|
30
|
-
def set_color(self, color):
|
36
|
+
def set_color(self, color: str | QColor):
|
31
37
|
"""Set the button's color and update its appearance.
|
32
38
|
|
33
39
|
Args:
|
@@ -38,6 +44,7 @@ class ColorButtonNative(BECWidget, QPushButton):
|
|
38
44
|
else:
|
39
45
|
self._color = color
|
40
46
|
self._update_appearance()
|
47
|
+
self.color_changed.emit(self._color)
|
41
48
|
|
42
49
|
@SafeProperty("QColor")
|
43
50
|
def color(self):
|
@@ -56,3 +63,11 @@ class ColorButtonNative(BECWidget, QPushButton):
|
|
56
63
|
text_color = "#000000" if brightness > 0.5 else "#FFFFFF"
|
57
64
|
self.setStyleSheet(f"background-color: {self._color}; color: {text_color};")
|
58
65
|
self.setText(self._color)
|
66
|
+
|
67
|
+
@SafeSlot()
|
68
|
+
def _open_color_dialog(self):
|
69
|
+
"""Open a QColorDialog and apply the selected color."""
|
70
|
+
current_color = QColor(self._color)
|
71
|
+
chosen_color = QColorDialog.getColor(current_color, self, "Select Curve Color")
|
72
|
+
if chosen_color.isValid():
|
73
|
+
self.set_color(chosen_color)
|
@@ -2,11 +2,11 @@
|
|
2
2
|
.gitlab-ci.yml,sha256=1nMYldzVk0tFkBWYTcUjumOrdSADASheWOAc0kOFDYs,9509
|
3
3
|
.pylintrc,sha256=eeY8YwSI74oFfq6IYIbCqnx3Vk8ZncKaatv96n_Y8Rs,18544
|
4
4
|
.readthedocs.yaml,sha256=ivqg3HTaOxNbEW3bzWh9MXAkrekuGoNdj0Mj3SdRYuw,639
|
5
|
-
CHANGELOG.md,sha256=
|
5
|
+
CHANGELOG.md,sha256=nMdkbMCLvFqpYBBfyE7DHVqGszb8k01Cl5ELsh6Ukqs,295419
|
6
6
|
LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=BLw4A-_2phKs1Sa32uDn23NpiApz4ROI9pA9vfDP3g8,1254
|
8
8
|
README.md,sha256=oY5Jc1uXehRASuwUJ0umin2vfkFh7tHF-LLruHTaQx0,3560
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=Kc5bWYH7_evTktTTuuX7SoYWWTwld_osxee161dbqnM,2835
|
10
10
|
.git_hooks/pre-commit,sha256=n3RofIZHJl8zfJJIUomcMyYGFi_rwq4CC19z0snz3FI,286
|
11
11
|
.github/pull_request_template.md,sha256=F_cJXzooWMFgMGtLK-7KeGcQt0B4AYFse5oN0zQ9p6g,801
|
12
12
|
.github/ISSUE_TEMPLATE/bug_report.yml,sha256=WdRnt7HGxvsIBLzhkaOWNfg8IJQYa_oV9_F08Ym6znQ,1081
|
@@ -35,7 +35,7 @@ bec_widgets/assets/app_icons/bec_widgets_icon.png,sha256=K8dgGwIjalDh9PRHUsSQBqg
|
|
35
35
|
bec_widgets/assets/app_icons/ui_loader_tile.png,sha256=qSK3XHqvnAVGV9Q0ulORcGFbXJ9LDq2uz8l9uTtMsNk,1812476
|
36
36
|
bec_widgets/assets/app_icons/widget_launch_tile.png,sha256=bWsICHFfSe9-ESUj3AwlE95dDOea-f6M-s9fBapsxB4,2252911
|
37
37
|
bec_widgets/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
|
-
bec_widgets/cli/client.py,sha256=
|
38
|
+
bec_widgets/cli/client.py,sha256=YcHF_WYmCy4DcgLhYsjVuzESxvjOlG5Ip6E3v2GmBCk,97938
|
39
39
|
bec_widgets/cli/client_utils.py,sha256=F2hyt--jL53bN8NoWifNUMqwwx5FbpS6I1apERdTRzM,18114
|
40
40
|
bec_widgets/cli/generate_cli.py,sha256=K_wMxo2XBUn92SnY3dSrlyUn8ax6Y20QBGCuP284DsQ,10986
|
41
41
|
bec_widgets/cli/server.py,sha256=h7QyBOOGjyrP_fxJIIOSEMc4E06cLG0JyaofjNV6oCA,5671
|
@@ -254,9 +254,10 @@ bec_widgets/widgets/games/register_minesweeper.py,sha256=8fgMBD3yB-5_eGqhG_qxpj3
|
|
254
254
|
bec_widgets/widgets/plots/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
255
255
|
bec_widgets/widgets/plots/plot_base.py,sha256=GETUsx51BE_Tuop8bC-KiFVrkR82TJ5S0cr7siouSWM,35848
|
256
256
|
bec_widgets/widgets/plots/image/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
257
|
-
bec_widgets/widgets/plots/image/image.py,sha256=
|
257
|
+
bec_widgets/widgets/plots/image/image.py,sha256=8s9DShQVAz458aPKfJTCWEmg8HoagCX3MkjFJZXSmek,17278
|
258
258
|
bec_widgets/widgets/plots/image/image.pyproject,sha256=_sRCIu4MNgToaB4D7tUMWq3xKX6T2VoRS3UzGNIseHQ,23
|
259
|
-
bec_widgets/widgets/plots/image/
|
259
|
+
bec_widgets/widgets/plots/image/image_base.py,sha256=_c4rYRX2AwGyy0WWUhaAJl3gNfXSq1ts99MG8rsa-6w,36104
|
260
|
+
bec_widgets/widgets/plots/image/image_item.py,sha256=rkL1o35Pgs1zhvv2wpSG1gt_bjP5kO4Z1oy6d2q-Yls,8577
|
260
261
|
bec_widgets/widgets/plots/image/image_plugin.py,sha256=R0Hzh2GgYlfZLPZwOMgqLKKIA5DxEnTcSrbI7zTe-tI,1204
|
261
262
|
bec_widgets/widgets/plots/image/image_processor.py,sha256=0qsQIyB__xxBwNIoXhFbB0wSiB8n7n_oX4cvfFsUzOs,4304
|
262
263
|
bec_widgets/widgets/plots/image/image_roi_plot.py,sha256=5CWy_eC-GS2ZLJTj2ItrVCoKhPN2g3fx6L4ktf5yVFQ,1191
|
@@ -316,7 +317,7 @@ bec_widgets/widgets/plots/waveform/waveform_plugin.py,sha256=2AZPtBHs75l9cdhwQnY
|
|
316
317
|
bec_widgets/widgets/plots/waveform/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
317
318
|
bec_widgets/widgets/plots/waveform/settings/curve_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
318
319
|
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_setting.py,sha256=Q-wgtzsllExbeOxQoCPmcCQfKRjp_hJeYcinSSy_0HI,4454
|
319
|
-
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py,sha256=
|
320
|
+
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py,sha256=Os5u5ZP4L7erClXtkuHMHMvf-a1dTO7ZL8W9Rk3nnWY,20742
|
320
321
|
bec_widgets/widgets/plots/waveform/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
321
322
|
bec_widgets/widgets/plots/waveform/utils/roi_manager.py,sha256=zCl3-p3qP02zi837Udz8VUzsbUAwiP-26K3VpLsvaUU,2964
|
322
323
|
bec_widgets/widgets/progress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -384,7 +385,7 @@ bec_widgets/widgets/utility/visual/color_button/color_button.pyproject,sha256=LU
|
|
384
385
|
bec_widgets/widgets/utility/visual/color_button/color_button_plugin.py,sha256=Eqp6eW1Iu1uS40_rHzgA_Hxy1F6Co7pzv2fdz5cWNGU,1282
|
385
386
|
bec_widgets/widgets/utility/visual/color_button/register_color_button.py,sha256=BD1XGznJqYX3DgUPy2HWDgzu8KdLspR6wagseG5Bo2s,507
|
386
387
|
bec_widgets/widgets/utility/visual/color_button_native/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
387
|
-
bec_widgets/widgets/utility/visual/color_button_native/color_button_native.py,sha256=
|
388
|
+
bec_widgets/widgets/utility/visual/color_button_native/color_button_native.py,sha256=M7owSqPjYIlOou9U-M9Sxp7QzaIN2Q3cWeWkDdTjlDA,2383
|
388
389
|
bec_widgets/widgets/utility/visual/color_button_native/color_button_native.pyproject,sha256=ceGob3QdHeAvyTj5RQTuxpUB2hNFh3nhRfNpHep4K_k,37
|
389
390
|
bec_widgets/widgets/utility/visual/color_button_native/color_button_native_plugin.py,sha256=RfGUHfLRqRfXGbDAR6SJ46OleXaXEmXyfCjqtQ9yjBs,1389
|
390
391
|
bec_widgets/widgets/utility/visual/color_button_native/register_color_button_native.py,sha256=-TLOcJNpg0hsUaGBNPhWFrzgVwSmXuk8xtY48zAERSc,533
|
@@ -403,8 +404,8 @@ bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py,sha256=O
|
|
403
404
|
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.pyproject,sha256=Lbi9zb6HNlIq14k6hlzR-oz6PIFShBuF7QxE6d87d64,34
|
404
405
|
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button_plugin.py,sha256=CzChz2SSETYsR8-36meqWnsXCT-FIy_J_xeU5coWDY8,1350
|
405
406
|
bec_widgets/widgets/utility/visual/dark_mode_button/register_dark_mode_button.py,sha256=rMpZ1CaoucwobgPj1FuKTnt07W82bV1GaSYdoqcdMb8,521
|
406
|
-
bec_widgets-2.
|
407
|
-
bec_widgets-2.
|
408
|
-
bec_widgets-2.
|
409
|
-
bec_widgets-2.
|
410
|
-
bec_widgets-2.
|
407
|
+
bec_widgets-2.11.0.dist-info/METADATA,sha256=BLw4A-_2phKs1Sa32uDn23NpiApz4ROI9pA9vfDP3g8,1254
|
408
|
+
bec_widgets-2.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
409
|
+
bec_widgets-2.11.0.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
|
410
|
+
bec_widgets-2.11.0.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
|
411
|
+
bec_widgets-2.11.0.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|