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

refactor: config_dialog.py clean up

This commit is contained in:
wyzula-jan
2023-10-26 15:36:03 +02:00
committed by wyzula_j
parent 7e99920fc5
commit 93db0c21ef
4 changed files with 55 additions and 82 deletions

View File

@ -435,7 +435,9 @@ class PlotApp(QWidget):
curve.setData(data_x, data_y)
@pyqtSlot(dict, dict)
def on_scan_segment(self, msg, metadata) -> None:
def on_scan_segment(
self, msg, metadata
) -> None: # TODO the logic should be separated from GUI operation
"""
Handle new scan segments and saves data to a dictionary. Linked through bec_dispatcher.
@ -566,7 +568,7 @@ class PlotApp(QWidget):
except Exception as e:
print(f"An error occurred while saving the settings to {file_path}: {e}")
def load_settings_from_yaml(self) -> dict:
def load_settings_from_yaml(self) -> dict: # TODO can be replace by the qt_utils function
"""Load settings from a .yaml file using a file dialog and update the current settings."""
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog

View File

@ -150,7 +150,7 @@ config_scan_mode = {
"label": "Multi",
"signals": [
{"name": "gauss_bpm", "entry": "gauss_bpm"},
{"name": "samx", "entry": ["samx", "samx_setpoint"]},
{"name": "samx", "entry": "samx"},
],
},
},
@ -161,7 +161,7 @@ config_scan_mode = {
"label": "Multi",
"signals": [
{"name": "gauss_bpm", "entry": "gauss_bpm"},
{"name": "samx", "entry": ["samx", "samx_setpoint"]},
{"name": "samx", "entry": "samx"},
],
},
},