1
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2026-03-05 00:12:49 +01:00

fix(curve_dialog): changed LineEdits to SignalLineEdits

This commit is contained in:
2024-10-25 15:11:16 +02:00
parent d8c80293c7
commit 54598cffb6
4 changed files with 32 additions and 5 deletions

View File

@@ -21,6 +21,8 @@ class EntryValidator:
if entry is None or entry == "":
entry = next(iter(device._hints), name) if hasattr(device, "_hints") else name
if entry == "readback":
entry = f"{name}"
if entry not in description:
raise ValueError(f"Entry '{entry}' not found in device '{name}' signals")

View File

@@ -265,7 +265,7 @@ class DeviceSignalInputBase(BECWidget):
if device in self.dev:
return True
if raise_on_false is True:
raise ValueError(f"Device {device} not found in devicemanager.")
raise ValueError(f"Device {device} not found in device manager.")
return False
def validate_signal(self, signal: str) -> bool:

View File

@@ -15,6 +15,7 @@ from bec_widgets.utils import Colors, UILoader
from bec_widgets.widgets.color_button.color_button import ColorButton
from bec_widgets.widgets.dap_combo_box.dap_combo_box import DapComboBox
from bec_widgets.widgets.device_line_edit.device_line_edit import DeviceLineEdit
from bec_widgets.widgets.signal_line_edit.signal_line_edit import SignalLineEdit
MODULE_PATH = os.path.dirname(bec_widgets.__file__)
@@ -240,7 +241,7 @@ class DialogRow(QObject):
# Name and Entry
self.device_line_edit = DeviceLineEdit()
self.entry_line_edit = QLineEdit()
self.entry_line_edit = SignalLineEdit()
self.dap_combo = DapComboBox()
self.dap_combo.populate_fit_model_combobox()
@@ -262,6 +263,7 @@ class DialogRow(QObject):
self.remove_button.clicked.connect(
lambda: self.remove_row()
) # From some reason do not work without lambda
self.device_line_edit.device_selected.connect(self.entry_line_edit.set_device)
def add_scan_row(self):
if self.config is not None:
@@ -319,6 +321,7 @@ class DialogRow(QObject):
def cleanup(self):
self.device_line_edit.cleanup()
self.entry_line_edit.cleanup()
class StyleComboBox(QComboBox):

View File

@@ -31,7 +31,7 @@
<property name="title">
<string>X Axis</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,1,3,1,3">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="0,0,0,0,1,3,1,0">
<item>
<widget class="QLabel" name="x_mode_label">
<property name="text">
@@ -113,7 +113,7 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="x_entry"/>
<widget class="SignalLineEdit" name="x_entry"/>
</item>
</layout>
</widget>
@@ -348,11 +348,33 @@
<header>device_line_edit</header>
</customwidget>
<customwidget>
<class>SignalLineEdit</class>
<extends>QLineEdit</extends>
<header>signal_line_edit</header>
</customwidget>
<customwidget>
<class>ColormapSelector</class>
<extends>QWidget</extends>
<header>colormap_selector</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
<connections>
<connection>
<sender>x_name</sender>
<signal>device_selected(QString)</signal>
<receiver>x_entry</receiver>
<slot>set_device(QString)</slot>
<hints>
<hint type="sourcelabel">
<x>465</x>
<y>34</y>
</hint>
<hint type="destinationlabel">
<x>609</x>
<y>39</y>
</hint>
</hints>
</connection>
</connections>
</ui>