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

fix: extreme.py ui is initialised for the first scan of config in scan mode

This commit is contained in:
wyzula-jan
2023-10-02 16:38:12 +02:00
parent daf4ee190e
commit fc6098414e

View File

@ -11,7 +11,7 @@ from pyqtgraph.Qt import QtWidgets
from bec_lib.core import MessageEndpoints
from bec_widgets.qt_utils import Crosshair, Colors
from bec_widgets.bec_dispatcher import bec_dispatcher
# TODO implement:
# - implement scanID database for visualizing previous scans
@ -123,16 +123,15 @@ class PlotApp(QWidget):
self.plot_data_config = config.get("plot_data", {})
self.scan_types = self.plot_settings.get("scan_types", False)
if self.scan_types is False:
if self.scan_types is False: # Device tracking mode
self.plot_data = self.plot_data_config # TODO logic has to be improved
else:
self.plot_data = {}
else: # setup first line scan as default, then changed with different scan type
self.plot_data = self.plot_data_config[list(self.plot_data_config.keys())[0]]
# Setting global plot settings
self.init_plot_background(self.plot_settings["background_color"])
# Initialize the UI
if self.scan_types is False:
self.init_ui(self.plot_settings["num_columns"])
self.spinBox_N_columns.setValue(
self.plot_settings["num_columns"]
@ -535,7 +534,10 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Plotting App")
parser.add_argument(
"--config", "-c", help="Path to the .yaml configuration file", default="config_example.yaml"
"--config",
"-c",
help="Path to the .yaml configuration file",
default="config_scans_example.yaml",
)
args = parser.parse_args()