Read in the full config dictionary, making sure not to fail if a user manually typed
the import file out. For each config preset, set the widgets to match the value, which will
send signals out that will actually cause the plot to change
Source code in trace/mixins/plot_config.py
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 | def plot_setup(self, config: Dict):
"""Read in the full config dictionary, making sure not to fail if a user manually typed
the import file out. For each config preset, set the widgets to match the value, which will
send signals out that will actually cause the plot to change"""
if "title" in config:
self.ui.plot_title_edit.setText(str(config["title"]))
if "xGrid" in config:
self.ui.x_grid_chckbx.setChecked(bool(config["xGrid"]))
if "yGrid" in config:
self.ui.y_grid_chckbx.setChecked(bool(config["yGrid"]))
if "opacity" in config:
self.ui.opacity_sldr.setValue(int(config["opacity"]))
if "backgroundColor" in config:
self.background_color_button.color = QColor(config["backgroundColor"])
if "legend" in config:
self.ui.legend_chckbx.setChecked(bool(config["legend"]))
if "mouseMode" in config:
self.ui.mouse_mode_cmbbx.setCurrentIndex(int(config["mouseMode"] / 3))
if "crosshair" in config:
self.ui.crosshair_chckbx.setChecked(bool(config["crosshair"]))
if "refreshInterval" in config:
self.ui.refresh_interval_spnbx.setValue(int(config["refreshInterval"]))
|