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:
@ -62,7 +62,9 @@ class Signal(BaseModel):
|
|||||||
|
|
||||||
# Set entry based on hints if not provided
|
# Set entry based on hints if not provided
|
||||||
if v is None and hasattr(device, "_hints"):
|
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:
|
elif v is None:
|
||||||
v = device_name
|
v = device_name
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ from PyQt5 import uic
|
|||||||
from bec_widgets.bec_dispatcher import bec_dispatcher
|
from bec_widgets.bec_dispatcher import bec_dispatcher
|
||||||
from bec_widgets.qt_utils import Crosshair, Colors
|
from bec_widgets.qt_utils import Crosshair, Colors
|
||||||
|
|
||||||
# from bec_widgets.validation import validate_monitor_config, ValidationError
|
|
||||||
from bec_widgets.validation import MonitorConfigValidator
|
from bec_widgets.validation import MonitorConfigValidator
|
||||||
|
|
||||||
# just for demonstration purposes if script run directly
|
# just for demonstration purposes if script run directly
|
||||||
@ -132,35 +131,23 @@ config_simple = {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
config_wrong = {
|
config_no_entry = {
|
||||||
"plot_settings": {
|
"plot_settings": {
|
||||||
"background_color": "black",
|
"background_color": "white",
|
||||||
"num_columns": 2,
|
"num_columns": 5,
|
||||||
# "colormap": "plasma",
|
"colormap": "plasma",
|
||||||
"scan_types": False,
|
"scan_types": False,
|
||||||
},
|
},
|
||||||
"plot_data": [
|
"plot_data": [
|
||||||
{
|
{
|
||||||
"plot_name": "BPM4i plots vs samx",
|
"plot_name": "BPM4i plots vs samx",
|
||||||
"x": {
|
"x": {"label": "Motor Y", "signals": [{"name": "samx"}]},
|
||||||
"label": "Motor Y",
|
"y": {"label": "bpm4i", "signals": [{"name": "bpm4i"}]},
|
||||||
"signals": [{"name": "samx", "entry": "samx"}],
|
|
||||||
},
|
|
||||||
"y": {
|
|
||||||
"label": "bpm4i",
|
|
||||||
"signals": [{"name": "bpm4i", "entry": "bpm4i"}],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"plot_name": "Gauss plots vs samx",
|
"plot_name": "Gauss plots vs samx",
|
||||||
"x": {
|
"x": {"label": "Motor X", "signals": [{"name": "samx"}]},
|
||||||
"label": "Motor X",
|
"y": {"label": "Gauss", "signals": [{"name": "gauss_bpm"}, {"name": "gauss_adc1"}]},
|
||||||
"signals": [{"name": "samx", "entry": ["samx", "samx_setpoint"]}],
|
|
||||||
},
|
|
||||||
"y": {
|
|
||||||
"label": "Gauss",
|
|
||||||
"signals": [{"name": "gauss_bpm", "entry": "BS"}],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user