0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 11:41:49 +02:00

fix: monitor.py fixed not updating config changes after receiving refresh from BECPlotter

This commit is contained in:
wyzula-jan
2023-12-18 15:42:10 +01:00
parent 90d8069cc3
commit 00ef3ae925
2 changed files with 23 additions and 2 deletions

View File

@ -236,7 +236,8 @@ class MonitorConfigValidator:
Raises: Raises:
ValidationError: If the configuration data does not conform to the schema. ValidationError: If the configuration data does not conform to the schema.
""" """
if config_data["plot_settings"]["scan_types"]: config_type = config_data.get("plot_settings", {}).get("scan_types", False)
if config_type:
validated_config = ScanModeConfig(**config_data) validated_config = ScanModeConfig(**config_data)
else: else:
validated_config = DeviceMonitorConfig(**config_data) validated_config = DeviceMonitorConfig(**config_data)

View File

@ -193,7 +193,7 @@ CONFIG_SIMPLE = {
"plot_data": [ "plot_data": [
{ {
"plot_name": "BPM4i plots vs samx", "plot_name": "BPM4i plots vs samx",
"x_label": "Motor Y", "x_label": "Motor X",
"y_label": "bpm4i", "y_label": "bpm4i",
"sources": [ "sources": [
{ {
@ -203,6 +203,21 @@ CONFIG_SIMPLE = {
"y": [{"name": "bpm4i", "entry": "bpm4i"}], "y": [{"name": "bpm4i", "entry": "bpm4i"}],
}, },
}, },
# {
# "type": "history",
# "signals": {
# "x": [{"name": "samx"}],
# "y": [{"name": "bpm4i", "entry": "bpm4i"}],
# },
# },
# {
# "type": "dap",
# 'worker':'some_worker',
# "signals": {
# "x": [{"name": "samx"}],
# "y": [{"name": "bpm4i", "entry": "bpm4i"}],
# },
# },
], ],
}, },
{ {
@ -585,6 +600,11 @@ class BECMonitor(pg.GraphicsLayoutWidget):
Args: Args:
config(dict): Configuration settings config(dict): Configuration settings
""" """
# convert config from BEC CLI to correct formatting
config_tag = config.get("config", None)
if config_tag is not None:
config = config["config"]
if self.skip_validation is True: if self.skip_validation is True:
self.config = config self.config = config
self._init_config() self._init_config()