diff --git a/bec_widgets/widgets/monitor/monitor.py b/bec_widgets/widgets/monitor/monitor.py index 40491f46..8ffee715 100644 --- a/bec_widgets/widgets/monitor/monitor.py +++ b/bec_widgets/widgets/monitor/monitor.py @@ -1,4 +1,4 @@ -import os +# pylint: disable = no-name-in-module, import time import pyqtgraph as pg @@ -16,7 +16,7 @@ from bec_widgets.qt_utils.yaml_dialog import load_yaml from bec_widgets.validation import MonitorConfigValidator # just for demonstration purposes if script run directly -config_scan_mode = { +CONFIG_SCAN_MODE = { "plot_settings": { "background_color": "white", "num_columns": 3, @@ -86,7 +86,7 @@ config_scan_mode = { }, } -config_simple = { +CONFIG_SIMPLE = { "plot_settings": { "background_color": "black", "num_columns": 2, @@ -115,7 +115,7 @@ config_simple = { ], } -config_no_entry = { +CONFIG_NO_ENTRY = { "plot_settings": { "background_color": "white", "num_columns": 5, @@ -136,7 +136,7 @@ config_no_entry = { ], } -config_wrong = { +CONFIG_WRONG = { "plot_settings": { "background_color": "white", "num_columns": 5, @@ -197,6 +197,7 @@ class BECMonitor(pg.GraphicsLayoutWidget): super(BECMonitor, self).__init__(parent=parent) # Client and device manager from BEC + self.plot_data = None self.client = bec_dispatcher.client if client is None else client self.dev = self.client.device_manager.devices self.queue = self.client.queue @@ -480,8 +481,6 @@ class BECMonitor(pg.GraphicsLayoutWidget): Args: config(dict): Configuration settings """ - if "config" in config: - config = config["config"] try: validated_config = self.validator.validate_monitor_config(config) @@ -496,6 +495,11 @@ class BECMonitor(pg.GraphicsLayoutWidget): @staticmethod def format_validation_error(error_str: str) -> str: + """ + Format the validation error string to be displayed in a popup. + Args: + error_str(str): Error string from the validation error. + """ error_lines = error_str.split("\n") # The first line contains the number of errors. error_header = f"
{error_lines[0]}