From ff0f51d5040419f1ea966f1cd0c247a9365a0c5a Mon Sep 17 00:00:00 2001 From: jupfi Date: Mon, 24 Jul 2023 08:21:06 +0200 Subject: [PATCH] Implemented pulse shaping for lime. --- src/nqrduck_pulseprogrammer/controller.py | 2 +- src/nqrduck_pulseprogrammer/model.py | 2 +- src/nqrduck_pulseprogrammer/view.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nqrduck_pulseprogrammer/controller.py b/src/nqrduck_pulseprogrammer/controller.py index 5b7dfa1..194e37f 100644 --- a/src/nqrduck_pulseprogrammer/controller.py +++ b/src/nqrduck_pulseprogrammer/controller.py @@ -41,7 +41,7 @@ class PulseProgrammerController(ModuleController): def save_pulse_sequence(self, path): logger.debug("Saving pulse sequence to %s", path) - sequence = self.module.model.pulse_sequence.dump_sequence_data() + sequence = self.module.model.pulse_sequence.to_json() with open(path, "w") as file: file.write(json.dumps(sequence)) diff --git a/src/nqrduck_pulseprogrammer/model.py b/src/nqrduck_pulseprogrammer/model.py index 1be1e02..12c038a 100644 --- a/src/nqrduck_pulseprogrammer/model.py +++ b/src/nqrduck_pulseprogrammer/model.py @@ -25,7 +25,7 @@ class PulseProgrammerModel(ModuleModel): self.pulse_sequence.events[-1].parameters[name] = pulse_parameter_class(name) logger.debug("Created pulse parameter %s with object id %s", name, id(self.pulse_sequence.events[-1].parameters[name])) - logger.debug(self.pulse_sequence.dump_sequence_data()) + logger.debug(self.pulse_sequence.to_json()) self.events_changed.emit() @property diff --git a/src/nqrduck_pulseprogrammer/view.py b/src/nqrduck_pulseprogrammer/view.py index 0077733..3b9c97f 100644 --- a/src/nqrduck_pulseprogrammer/view.py +++ b/src/nqrduck_pulseprogrammer/view.py @@ -301,7 +301,7 @@ class OptionsDialog(QDialog): self.return_functions = OrderedDict() # If the options are a list , we will create a QComboBox - for key, option in options.items(): + for option in options: if option == list: pass # If the options are boolean, we will create a QCheckBox @@ -318,7 +318,7 @@ class OptionsDialog(QDialog): # If the options are a float/int we will create a QSpinBox elif isinstance(option, NumericOption): numeric_layout = QHBoxLayout() - numeric_label = QLabel(key) + numeric_label = QLabel(option.name) numeric_lineedit = QLineEdit(str(option.value)) numeric_layout.addWidget(numeric_label) numeric_layout.addWidget(numeric_lineedit)