Fixxed bug with pulse paramter order in view.

This commit is contained in:
jupfi 2024-02-04 08:01:18 +01:00
parent 3ca5526701
commit 28710fc200

View file

@ -375,6 +375,7 @@ class EventOptionsWidget(QWidget):
class OptionsDialog(QDialog): class OptionsDialog(QDialog):
""" This dialog is created whenever the edit button for a pulse option is clicked. """ This dialog is created whenever the edit button for a pulse option is clicked.
It allows the user to change the options for the pulse parameter and creates the dialog in accordance to what can be set.""" It allows the user to change the options for the pulse parameter and creates the dialog in accordance to what can be set."""
def __init__(self, event, parameter, parent=None): def __init__(self, event, parameter, parent=None):
super().__init__(parent) super().__init__(parent)
self.parent = parent self.parent = parent
@ -391,6 +392,8 @@ class OptionsDialog(QDialog):
self.layout.addLayout(numeric_layout) self.layout.addLayout(numeric_layout)
# If the parameter is a string, we first need to get the parameter object from the according event
if isinstance(parameter, str):
parameter = event.parameters[parameter] parameter = event.parameters[parameter]
options = parameter.get_options() options = parameter.get_options()
@ -508,14 +511,14 @@ class FunctionOptionWidget(QWidget):
expr_layout.addStretch(1) expr_layout.addStretch(1)
self.advanced_settings_layout.addRow(expr_label, expr_layout) self.advanced_settings_layout.addRow(expr_label, expr_layout)
# Display the active function
self.load_active_function()
# Add buttton for replotting of the active function with the new parameters # Add buttton for replotting of the active function with the new parameters
self.replot_button = QPushButton("Replot") self.replot_button = QPushButton("Replot")
self.replot_button.clicked.connect(self.on_replot_button_clicked) self.replot_button.clicked.connect(self.on_replot_button_clicked)
layout.addWidget(self.replot_button) layout.addWidget(self.replot_button)
# Display the active function
self.load_active_function()
@pyqtSlot() @pyqtSlot()
def on_replot_button_clicked(self) -> None: def on_replot_button_clicked(self) -> None:
"""This function is called when the replot button is clicked. """This function is called when the replot button is clicked.