diff --git a/src/nqrduck_spectrometer/base_spectrometer_model.py b/src/nqrduck_spectrometer/base_spectrometer_model.py index 359eeb3..b25004e 100644 --- a/src/nqrduck_spectrometer/base_spectrometer_model.py +++ b/src/nqrduck_spectrometer/base_spectrometer_model.py @@ -29,6 +29,12 @@ class BaseSpectrometerModel(ModuleModel): def get_setting(self): return float(self.value) + def get_setting_by_name(self, name : str) -> "Setting": + for setting in self.settings: + if setting.name == name: + return setting + raise ValueError("Setting with name %s not found" % name) + class PulseParameter: """A pulse parameter is a value that can be different for each event in a pulse sequence.