bec-widgets 0.46.6__tar.gz → 0.46.7__tar.gz
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.
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/PKG-INFO +1 -1
- bec_widgets-0.46.7/bec_widgets/utils/entry_validator.py +40 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/plots/image.py +22 -2
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets.egg-info/PKG-INFO +1 -1
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/setup.py +1 -1
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/client_mocks.py +1 -0
- bec_widgets-0.46.6/bec_widgets/utils/entry_validator.py +0 -17
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/LICENSE +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/README.md +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/cli/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/cli/client.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/cli/client_utils.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/cli/generate_cli.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/cli/server.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/eiger_plot/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/eiger_plot/eiger_plot.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/eiger_plot/eiger_plot.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/jupyter_console/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/jupyter_console/jupyter_console_window.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/jupyter_console/jupyter_console_window.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/mca_readout/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/mca_readout/mca_plot.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/mca_readout/mca_sim.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/config_example.yaml +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/csax_bec_config.yaml +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/csaxs_config.yaml +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/motor_control_compilations.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/motor_controller.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/motor_example.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/stream_plot/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/stream_plot/line_plot.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/stream_plot/stream_plot.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/simulations/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/bec_connector.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/bec_dispatcher.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/bec_table.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/colors.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/crosshair.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/ctrl_c.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/rpc_decorator.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/validator_delegate.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/widget_io.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/utils/yaml_dialog.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/validation/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/validation/monitor_config_validator.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/editor/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/editor/editor.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/figure/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/figure/figure.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/monitor/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/monitor/config_dialog.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/monitor/config_dialog.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/monitor/monitor.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/monitor/tab_template.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control_absolute.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control_relative.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control_selection.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control_table.ui +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_map/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_map/motor_map.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/plots/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/plots/motor_map.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/plots/plot_base.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/plots/waveform.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/scan_control/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/scan_control/scan_control.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/toolbar/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/toolbar/toolbar.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets.egg-info/SOURCES.txt +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets.egg-info/dependency_links.txt +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets.egg-info/requires.txt +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets.egg-info/top_level.txt +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/setup.cfg +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/conftest.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_bec_connector.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_bec_dispatcher.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_bec_figure.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_bec_monitor.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_bec_motor_map.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_client_utils.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_config_dialog.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_crosshair.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_editor.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_eiger_plot.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_generate_cli_client.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_motor_control.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_motor_map.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_msgs/__init__.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_msgs/available_scans_message.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_plot_base.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_scan_control.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_stream_plot.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_validator_errors.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_waveform1d.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_widget_io.py +0 -0
- {bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_yaml_dialog.py +0 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
class EntryValidator:
|
2
|
+
def __init__(self, devices):
|
3
|
+
self.devices = devices
|
4
|
+
|
5
|
+
def validate_signal(self, name: str, entry: str = None) -> str:
|
6
|
+
"""
|
7
|
+
Validate a signal entry for a given device. If the entry is not provided, the first signal entry will be used from the device hints.
|
8
|
+
Args:
|
9
|
+
name(str): Device name
|
10
|
+
entry(str): Signal entry
|
11
|
+
|
12
|
+
Returns:
|
13
|
+
str: Signal entry
|
14
|
+
"""
|
15
|
+
if name not in self.devices:
|
16
|
+
raise ValueError(f"Device '{name}' not found in current BEC session")
|
17
|
+
|
18
|
+
device = self.devices[name]
|
19
|
+
description = device.describe()
|
20
|
+
|
21
|
+
if entry is None:
|
22
|
+
entry = next(iter(device._hints), name) if hasattr(device, "_hints") else name
|
23
|
+
if entry not in description:
|
24
|
+
raise ValueError(f"Entry '{entry}' not found in device '{name}' signals")
|
25
|
+
|
26
|
+
return entry
|
27
|
+
|
28
|
+
def validate_monitor(self, monitor: str) -> str:
|
29
|
+
"""
|
30
|
+
Validate a monitor entry for a given device.
|
31
|
+
Args:
|
32
|
+
monitor(str): Monitor entry
|
33
|
+
|
34
|
+
Returns:
|
35
|
+
str: Monitor entry
|
36
|
+
"""
|
37
|
+
if monitor not in self.devices:
|
38
|
+
raise ValueError(f"Device '{monitor}' not found in current BEC session")
|
39
|
+
|
40
|
+
return monitor
|
@@ -12,7 +12,7 @@ from qtpy.QtCore import Signal as pyqtSignal
|
|
12
12
|
from qtpy.QtCore import Slot as pyqtSlot
|
13
13
|
from qtpy.QtWidgets import QWidget
|
14
14
|
|
15
|
-
from bec_widgets.utils import BECConnector, ConnectionConfig
|
15
|
+
from bec_widgets.utils import BECConnector, ConnectionConfig, EntryValidator
|
16
16
|
|
17
17
|
from .plot_base import BECPlotBase, WidgetConfig
|
18
18
|
|
@@ -335,7 +335,9 @@ class BECImageShow(BECPlotBase):
|
|
335
335
|
super().__init__(
|
336
336
|
parent=parent, parent_figure=parent_figure, config=config, client=client, gui_id=gui_id
|
337
337
|
)
|
338
|
-
|
338
|
+
# Get bec shortcuts dev, scans, queue, scan_storage, dap
|
339
|
+
self.get_bec_shortcuts()
|
340
|
+
self.entry_validator = EntryValidator(self.dev)
|
339
341
|
self._images = defaultdict(dict)
|
340
342
|
self.apply_config(self.config)
|
341
343
|
self.processor = ImageProcessor()
|
@@ -507,6 +509,8 @@ class BECImageShow(BECPlotBase):
|
|
507
509
|
f"Monitor with ID '{monitor}' already exists in widget '{self.gui_id}'."
|
508
510
|
)
|
509
511
|
|
512
|
+
monitor = self.entry_validator.validate_monitor(monitor)
|
513
|
+
|
510
514
|
image_config = ImageItemConfig(
|
511
515
|
widget_class="BECImageItem",
|
512
516
|
parent_id=self.gui_id,
|
@@ -785,6 +789,22 @@ class BECImageShow(BECPlotBase):
|
|
785
789
|
return True
|
786
790
|
return False
|
787
791
|
|
792
|
+
def _validate_monitor(self, monitor: str, validate_bec: bool = True):
|
793
|
+
"""
|
794
|
+
Validate the monitor name.
|
795
|
+
Args:
|
796
|
+
monitor(str): The name of the monitor.
|
797
|
+
validate_bec(bool): Whether to validate the monitor name with BEC.
|
798
|
+
|
799
|
+
Returns:
|
800
|
+
bool: True if the monitor name is valid, False otherwise.
|
801
|
+
"""
|
802
|
+
if not monitor or monitor == "":
|
803
|
+
return False
|
804
|
+
if validate_bec:
|
805
|
+
return monitor in self.dev
|
806
|
+
return True
|
807
|
+
|
788
808
|
def cleanup(self):
|
789
809
|
"""
|
790
810
|
Clean up the widget.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
class EntryValidator:
|
2
|
-
def __init__(self, devices):
|
3
|
-
self.devices = devices
|
4
|
-
|
5
|
-
def validate_signal(self, name: str, entry: str = None) -> str:
|
6
|
-
if name not in self.devices:
|
7
|
-
raise ValueError(f"Device '{name}' not found in current BEC session")
|
8
|
-
|
9
|
-
device = self.devices[name]
|
10
|
-
description = device.describe()
|
11
|
-
|
12
|
-
if entry is None:
|
13
|
-
entry = next(iter(device._hints), name) if hasattr(device, "_hints") else name
|
14
|
-
if entry not in description:
|
15
|
-
raise ValueError(f"Entry '{entry}' not found in device '{name}' signals")
|
16
|
-
|
17
|
-
return entry
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/config_example.yaml
RENAMED
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/csax_bec_config.yaml
RENAMED
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/csaxs_config.yaml
RENAMED
File without changes
|
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/motor_controller.ui
RENAMED
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/examples/motor_movement/motor_example.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/validation/monitor_config_validator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/bec_widgets/widgets/motor_control/motor_control_table.ui
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{bec_widgets-0.46.6 → bec_widgets-0.46.7}/tests/unit_tests/test_msgs/available_scans_message.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|