From 8a1fdb99dbb30c6a304af6f7b42897e08c5a7977 Mon Sep 17 00:00:00 2001 From: jupfi Date: Thu, 13 Jul 2023 11:14:27 +0200 Subject: [PATCH] Implemented change of duration length. --- src/nqrduck_spectrometer/pulse_sequence.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nqrduck_spectrometer/pulse_sequence.py b/src/nqrduck_spectrometer/pulse_sequence.py index 187fa9c..ed47a44 100644 --- a/src/nqrduck_spectrometer/pulse_sequence.py +++ b/src/nqrduck_spectrometer/pulse_sequence.py @@ -1,5 +1,8 @@ +import logging from collections import OrderedDict +logger = logging.getLogger(__name__) + class PulseSequence: """A pulse sequence is a collection of events that are executed in a certain order.""" def __init__(self, name) -> None: @@ -20,6 +23,10 @@ class PulseSequence: def add_parameter(self, parameter) -> None: self.parameters.append(parameter) + def on_duration_changed(self, duration: float) -> None: + logger.debug("Duration of event %s changed to %s", self.name, duration) + self.duration = duration + def dump_sequence_data(self): """Returns a dict with all the data in the pulse sequence""" data = {