bec-widgets 2.19.4__py3-none-any.whl → 2.20.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 +23 -0
- PKG-INFO +1 -1
- bec_widgets/widgets/control/device_input/signal_combobox/signal_combobox.py +30 -0
- bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_setting.py +43 -12
- bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py +4 -14
- {bec_widgets-2.19.4.dist-info → bec_widgets-2.20.0.dist-info}/METADATA +1 -1
- {bec_widgets-2.19.4.dist-info → bec_widgets-2.20.0.dist-info}/RECORD +11 -11
- pyproject.toml +1 -1
- {bec_widgets-2.19.4.dist-info → bec_widgets-2.20.0.dist-info}/WHEEL +0 -0
- {bec_widgets-2.19.4.dist-info → bec_widgets-2.20.0.dist-info}/entry_points.txt +0 -0
- {bec_widgets-2.19.4.dist-info → bec_widgets-2.20.0.dist-info}/licenses/LICENSE +0 -0
CHANGELOG.md
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
3
|
|
4
|
+
## v2.20.0 (2025-06-26)
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
- **curve_settings**: Larger minimalWidth for the x device combobox selection
|
9
|
+
([`48a0e58`](https://github.com/bec-project/bec_widgets/commit/48a0e5831feccd30f24218821bbc9d73f8c47933))
|
10
|
+
|
11
|
+
### Features
|
12
|
+
|
13
|
+
- **waveform**: Move x axis selection to a combobox
|
14
|
+
([`d10328c`](https://github.com/bec-project/bec_widgets/commit/d10328cb5c775a9b7b40ed4e9f2889e63eb039ff))
|
15
|
+
|
16
|
+
### Refactoring
|
17
|
+
|
18
|
+
- **curve settings**: Move signal logic to SignalCombobox
|
19
|
+
([`e841468`](https://github.com/bec-project/bec_widgets/commit/e84146889210165de1c4e63eb20b39f30cc5c623))
|
20
|
+
|
21
|
+
### Testing
|
22
|
+
|
23
|
+
- **curve settings**: Add curve tree elements to the dialog test
|
24
|
+
([`1e9dd4c`](https://github.com/bec-project/bec_widgets/commit/1e9dd4cd2561d37bdda1cd86b511295c259b2831))
|
25
|
+
|
26
|
+
|
4
27
|
## v2.19.4 (2025-06-26)
|
5
28
|
|
6
29
|
### Bug Fixes
|
PKG-INFO
CHANGED
@@ -90,6 +90,36 @@ class SignalComboBox(DeviceSignalInputBase, QComboBox):
|
|
90
90
|
self.insertItem(0, "Hinted Signals")
|
91
91
|
self.model().item(0).setEnabled(False)
|
92
92
|
|
93
|
+
def set_to_obj_name(self, obj_name: str) -> bool:
|
94
|
+
"""
|
95
|
+
Set the combobox to the object name of the signal.
|
96
|
+
|
97
|
+
Args:
|
98
|
+
obj_name (str): Object name of the signal.
|
99
|
+
|
100
|
+
Returns:
|
101
|
+
bool: True if the object name was found and set, False otherwise.
|
102
|
+
"""
|
103
|
+
for i in range(self.count()):
|
104
|
+
signal_data = self.itemData(i)
|
105
|
+
if signal_data and signal_data.get("obj_name") == obj_name:
|
106
|
+
self.setCurrentIndex(i)
|
107
|
+
return True
|
108
|
+
return False
|
109
|
+
|
110
|
+
def set_to_first_enabled(self) -> bool:
|
111
|
+
"""
|
112
|
+
Set the combobox to the first enabled item.
|
113
|
+
|
114
|
+
Returns:
|
115
|
+
bool: True if an enabled item was found and set, False otherwise.
|
116
|
+
"""
|
117
|
+
for i in range(self.count()):
|
118
|
+
if self.model().item(i).isEnabled():
|
119
|
+
self.setCurrentIndex(i)
|
120
|
+
return True
|
121
|
+
return False
|
122
|
+
|
93
123
|
@SafeSlot()
|
94
124
|
def reset_selection(self):
|
95
125
|
"""Reset the selection of the combobox."""
|
@@ -2,13 +2,12 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
from typing import TYPE_CHECKING
|
4
4
|
|
5
|
-
from qtpy.QtCore import QSize
|
5
|
+
from qtpy.QtCore import QSize, Qt
|
6
6
|
from qtpy.QtWidgets import (
|
7
7
|
QComboBox,
|
8
8
|
QGroupBox,
|
9
9
|
QHBoxLayout,
|
10
10
|
QLabel,
|
11
|
-
QLineEdit,
|
12
11
|
QSizePolicy,
|
13
12
|
QVBoxLayout,
|
14
13
|
QWidget,
|
@@ -16,9 +15,8 @@ from qtpy.QtWidgets import (
|
|
16
15
|
|
17
16
|
from bec_widgets.utils.error_popups import SafeSlot
|
18
17
|
from bec_widgets.utils.settings_dialog import SettingWidget
|
19
|
-
from bec_widgets.widgets.control.device_input.
|
20
|
-
|
21
|
-
)
|
18
|
+
from bec_widgets.widgets.control.device_input.device_combobox.device_combobox import DeviceComboBox
|
19
|
+
from bec_widgets.widgets.control.device_input.signal_combobox.signal_combobox import SignalComboBox
|
22
20
|
from bec_widgets.widgets.plots.waveform.settings.curve_settings.curve_tree import CurveTree
|
23
21
|
|
24
22
|
if TYPE_CHECKING: # pragma: no cover
|
@@ -30,6 +28,7 @@ class CurveSetting(SettingWidget):
|
|
30
28
|
super().__init__(parent=parent, *args, **kwargs)
|
31
29
|
self.setProperty("skip_settings", True)
|
32
30
|
self.target_widget = target_widget
|
31
|
+
self._x_settings_connected = False
|
33
32
|
|
34
33
|
self.layout = QVBoxLayout(self)
|
35
34
|
|
@@ -51,15 +50,23 @@ class CurveSetting(SettingWidget):
|
|
51
50
|
self.mode_combo_label = QLabel("Mode")
|
52
51
|
self.mode_combo = QComboBox()
|
53
52
|
self.mode_combo.addItems(["auto", "index", "timestamp", "device"])
|
53
|
+
self.mode_combo.setMinimumWidth(120)
|
54
54
|
|
55
55
|
self.spacer = QWidget()
|
56
56
|
self.spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
57
57
|
|
58
58
|
self.device_x_label = QLabel("Device")
|
59
|
-
self.device_x =
|
59
|
+
self.device_x = DeviceComboBox(parent=self)
|
60
|
+
self.device_x.insertItem(0, "")
|
61
|
+
self.device_x.setEditable(True)
|
62
|
+
self.device_x.setMinimumWidth(180)
|
60
63
|
|
61
64
|
self.signal_x_label = QLabel("Signal")
|
62
|
-
self.signal_x =
|
65
|
+
self.signal_x = SignalComboBox(parent=self)
|
66
|
+
self.signal_x.include_config_signals = False
|
67
|
+
self.signal_x.insertItem(0, "")
|
68
|
+
self.signal_x.setEditable(True)
|
69
|
+
self.signal_x.setMinimumWidth(180)
|
63
70
|
|
64
71
|
self._get_x_mode_from_waveform()
|
65
72
|
self.switch_x_device_selection()
|
@@ -85,11 +92,32 @@ class CurveSetting(SettingWidget):
|
|
85
92
|
|
86
93
|
def switch_x_device_selection(self):
|
87
94
|
if self.mode_combo.currentText() == "device":
|
95
|
+
self._x_settings_connected = True
|
96
|
+
self.device_x.currentTextChanged.connect(self.signal_x.set_device)
|
97
|
+
self.device_x.device_reset.connect(self.signal_x.reset_selection)
|
98
|
+
|
88
99
|
self.device_x.setEnabled(True)
|
89
|
-
self.
|
90
|
-
self.
|
100
|
+
self.signal_x.setEnabled(True)
|
101
|
+
item = self.device_x.findText(self.target_widget.x_axis_mode["name"])
|
102
|
+
self.device_x.setCurrentIndex(item if item != -1 else 0)
|
103
|
+
signal_x = self.target_widget.x_axis_mode.get("entry", "")
|
104
|
+
if signal_x:
|
105
|
+
self.signal_x.set_to_obj_name(signal_x)
|
106
|
+
else:
|
107
|
+
# If no match is found, set to the first enabled item
|
108
|
+
if not self.signal_x.set_to_first_enabled():
|
109
|
+
# If no enabled item is found, set to the first item
|
110
|
+
self.signal_x.setCurrentIndex(0)
|
91
111
|
else:
|
92
112
|
self.device_x.setEnabled(False)
|
113
|
+
self.signal_x.setEnabled(False)
|
114
|
+
self.device_x.setCurrentIndex(0)
|
115
|
+
self.signal_x.setCurrentIndex(0)
|
116
|
+
|
117
|
+
if self._x_settings_connected:
|
118
|
+
self._x_settings_connected = False
|
119
|
+
self.device_x.currentTextChanged.disconnect(self.signal_x.set_device)
|
120
|
+
self.device_x.device_reset.disconnect(self.signal_x.reset_selection)
|
93
121
|
|
94
122
|
def _init_y_box(self):
|
95
123
|
self.y_axis_box = QGroupBox("Y Axis")
|
@@ -108,10 +136,11 @@ class CurveSetting(SettingWidget):
|
|
108
136
|
Accepts the changes made in the settings widget and applies them to the target widget.
|
109
137
|
"""
|
110
138
|
if self.mode_combo.currentText() == "device":
|
111
|
-
self.target_widget.x_mode = self.device_x.
|
112
|
-
signal_x = self.signal_x.
|
139
|
+
self.target_widget.x_mode = self.device_x.currentText()
|
140
|
+
signal_x = self.signal_x.currentText()
|
141
|
+
signal_data = self.signal_x.itemData(self.signal_x.currentIndex())
|
113
142
|
if signal_x != "":
|
114
|
-
self.target_widget.x_entry = signal_x
|
143
|
+
self.target_widget.x_entry = signal_data.get("obj_name", signal_x)
|
115
144
|
else:
|
116
145
|
self.target_widget.x_mode = self.mode_combo.currentText()
|
117
146
|
self.curve_manager.send_curve_json()
|
@@ -126,5 +155,7 @@ class CurveSetting(SettingWidget):
|
|
126
155
|
"""Cleanup the widget."""
|
127
156
|
self.device_x.close()
|
128
157
|
self.device_x.deleteLater()
|
158
|
+
self.signal_x.close()
|
159
|
+
self.signal_x.deleteLater()
|
129
160
|
self.curve_manager.close()
|
130
161
|
self.curve_manager.deleteLater()
|
@@ -142,20 +142,10 @@ class CurveRow(QTreeWidgetItem):
|
|
142
142
|
# If the device name is not found, set the first enabled item
|
143
143
|
self.device_edit.setCurrentIndex(0)
|
144
144
|
|
145
|
-
|
146
|
-
|
147
|
-
if
|
148
|
-
# If
|
149
|
-
self.entry_edit.setCurrentIndex(i)
|
150
|
-
break
|
151
|
-
else:
|
152
|
-
# If no match found, set the first enabled item
|
153
|
-
for i in range(self.entry_edit.count()):
|
154
|
-
model = self.entry_edit.model()
|
155
|
-
if model.flags(model.index(i, 0)) & Qt.ItemIsEnabled:
|
156
|
-
self.entry_edit.setCurrentIndex(i)
|
157
|
-
break
|
158
|
-
else:
|
145
|
+
if not self.entry_edit.set_to_obj_name(self.config.signal.entry):
|
146
|
+
# If the entry is not found, try to set it to the first enabled item
|
147
|
+
if not self.entry_edit.set_to_first_enabled():
|
148
|
+
# If no enabled item is found, set to the first item
|
159
149
|
self.entry_edit.setCurrentIndex(0)
|
160
150
|
|
161
151
|
self.tree.setItemWidget(self, 1, self.device_edit)
|
@@ -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=19JrKYv2min7IsXlShIpZJlqFjuu7VMxQQW9ILz7Los,310782
|
6
6
|
LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
|
7
|
-
PKG-INFO,sha256=
|
7
|
+
PKG-INFO,sha256=YIMH4xcyVUmPZyOCz5DOXWitRyaniptOfYVO8Yw4Pzk,1254
|
8
8
|
README.md,sha256=oY5Jc1uXehRASuwUJ0umin2vfkFh7tHF-LLruHTaQx0,3560
|
9
|
-
pyproject.toml,sha256=
|
9
|
+
pyproject.toml,sha256=N9p6-deytAR0u_o3aTLxC1TSvDaiouiC8bUUJ1hMci4,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
|
@@ -197,7 +197,7 @@ bec_widgets/widgets/control/device_input/signal_combobox/__init__.py,sha256=47DE
|
|
197
197
|
bec_widgets/widgets/control/device_input/signal_combobox/register_signal_combo_box.py,sha256=VEdFRUfLph7JE2arcnzHw8etsE-4wZkwyzlNLMJBsZk,526
|
198
198
|
bec_widgets/widgets/control/device_input/signal_combobox/signal_combo_box.pyproject,sha256=xod6iyRD-WD0Uk6LWXjSxFJCQy-831pvTkKcw2FAdnM,33
|
199
199
|
bec_widgets/widgets/control/device_input/signal_combobox/signal_combo_box_plugin.py,sha256=sstqm2KtyR5wwOIYJRbzOqHMq5_9ExKP-YS5qV5ACrA,1373
|
200
|
-
bec_widgets/widgets/control/device_input/signal_combobox/signal_combobox.py,sha256=
|
200
|
+
bec_widgets/widgets/control/device_input/signal_combobox/signal_combobox.py,sha256=qvGyjsjxEwWFqmzrBjUi5bE6kdpDYmc26gQcPPYAS6c,5852
|
201
201
|
bec_widgets/widgets/control/device_input/signal_line_edit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
202
202
|
bec_widgets/widgets/control/device_input/signal_line_edit/register_signal_line_edit.py,sha256=aQLTy_3gbji0vq5VvvAddHFimpwGGaMYJy5iGgX23aM,527
|
203
203
|
bec_widgets/widgets/control/device_input/signal_line_edit/signal_line_edit.py,sha256=-y_Oy8A7pQVQbzjvHznGxTX-wCisP-4l5py7WOm1_EY,6008
|
@@ -321,8 +321,8 @@ bec_widgets/widgets/plots/waveform/waveform.pyproject,sha256=X2T6d4JGt9YSI28e-my
|
|
321
321
|
bec_widgets/widgets/plots/waveform/waveform_plugin.py,sha256=2AZPtBHs75l9cdhwQnY3jpIMRPUUqK3RNvQbTvrFyvg,1237
|
322
322
|
bec_widgets/widgets/plots/waveform/settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
323
323
|
bec_widgets/widgets/plots/waveform/settings/curve_settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
324
|
-
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_setting.py,sha256=
|
325
|
-
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py,sha256=
|
324
|
+
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_setting.py,sha256=cEvR-M-1RIIyQQLW9LRoHgjkx7_VUCo8q_Yld0yA38I,6325
|
325
|
+
bec_widgets/widgets/plots/waveform/settings/curve_settings/curve_tree.py,sha256=IRxDsxmdoYxofXGjcYsmdtMGGOrcRxUjk19zXKDRV7U,22696
|
326
326
|
bec_widgets/widgets/plots/waveform/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
327
327
|
bec_widgets/widgets/plots/waveform/utils/roi_manager.py,sha256=zCl3-p3qP02zi837Udz8VUzsbUAwiP-26K3VpLsvaUU,2964
|
328
328
|
bec_widgets/widgets/progress/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -420,8 +420,8 @@ bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.py,sha256=O
|
|
420
420
|
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button.pyproject,sha256=Lbi9zb6HNlIq14k6hlzR-oz6PIFShBuF7QxE6d87d64,34
|
421
421
|
bec_widgets/widgets/utility/visual/dark_mode_button/dark_mode_button_plugin.py,sha256=CzChz2SSETYsR8-36meqWnsXCT-FIy_J_xeU5coWDY8,1350
|
422
422
|
bec_widgets/widgets/utility/visual/dark_mode_button/register_dark_mode_button.py,sha256=rMpZ1CaoucwobgPj1FuKTnt07W82bV1GaSYdoqcdMb8,521
|
423
|
-
bec_widgets-2.
|
424
|
-
bec_widgets-2.
|
425
|
-
bec_widgets-2.
|
426
|
-
bec_widgets-2.
|
427
|
-
bec_widgets-2.
|
423
|
+
bec_widgets-2.20.0.dist-info/METADATA,sha256=YIMH4xcyVUmPZyOCz5DOXWitRyaniptOfYVO8Yw4Pzk,1254
|
424
|
+
bec_widgets-2.20.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
425
|
+
bec_widgets-2.20.0.dist-info/entry_points.txt,sha256=dItMzmwA1wizJ1Itx15qnfJ0ZzKVYFLVJ1voxT7K7D4,214
|
426
|
+
bec_widgets-2.20.0.dist-info/licenses/LICENSE,sha256=Daeiu871NcAp8uYi4eB_qHgvypG-HX0ioRQyQxFwjeg,1531
|
427
|
+
bec_widgets-2.20.0.dist-info/RECORD,,
|
pyproject.toml
CHANGED
File without changes
|
File without changes
|
File without changes
|