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

refactor: clean up

This commit is contained in:
wyzula-jan
2023-11-11 21:05:06 +01:00
parent cd9cd9ef9d
commit 6b114c2461
2 changed files with 11 additions and 22 deletions

View File

@ -62,7 +62,9 @@ class Signal(BaseModel):
# Set entry based on hints if not provided
if v is None and hasattr(device, "_hints"):
v = next(iter(device._hints), device_name)
v = next(
iter(device._hints), device_name
) # TODO check if device_manager[device_name]._hints in not enough?
elif v is None:
v = device_name

View File

@ -14,7 +14,6 @@ from PyQt5 import uic
from bec_widgets.bec_dispatcher import bec_dispatcher
from bec_widgets.qt_utils import Crosshair, Colors
# from bec_widgets.validation import validate_monitor_config, ValidationError
from bec_widgets.validation import MonitorConfigValidator
# just for demonstration purposes if script run directly
@ -132,35 +131,23 @@ config_simple = {
],
}
config_wrong = {
config_no_entry = {
"plot_settings": {
"background_color": "black",
"num_columns": 2,
# "colormap": "plasma",
"background_color": "white",
"num_columns": 5,
"colormap": "plasma",
"scan_types": False,
},
"plot_data": [
{
"plot_name": "BPM4i plots vs samx",
"x": {
"label": "Motor Y",
"signals": [{"name": "samx", "entry": "samx"}],
},
"y": {
"label": "bpm4i",
"signals": [{"name": "bpm4i", "entry": "bpm4i"}],
},
"x": {"label": "Motor Y", "signals": [{"name": "samx"}]},
"y": {"label": "bpm4i", "signals": [{"name": "bpm4i"}]},
},
{
"plot_name": "Gauss plots vs samx",
"x": {
"label": "Motor X",
"signals": [{"name": "samx", "entry": ["samx", "samx_setpoint"]}],
},
"y": {
"label": "Gauss",
"signals": [{"name": "gauss_bpm", "entry": "BS"}],
},
"x": {"label": "Motor X", "signals": [{"name": "samx"}]},
"y": {"label": "Gauss", "signals": [{"name": "gauss_bpm"}, {"name": "gauss_adc1"}]},
},
],
}