From adc088aae1c3982707a3886af4c3f3917d9c01b8 Mon Sep 17 00:00:00 2001 From: jupfi Date: Fri, 26 Apr 2024 17:31:42 +0200 Subject: [PATCH] Improved logging. Removed Decimals. --- src/nqrduck_spectrometer/pulsesequence.py | 2 +- src/nqrduck_spectrometer/settings.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/nqrduck_spectrometer/pulsesequence.py b/src/nqrduck_spectrometer/pulsesequence.py index 6c24c43..b0499fd 100644 --- a/src/nqrduck_spectrometer/pulsesequence.py +++ b/src/nqrduck_spectrometer/pulsesequence.py @@ -117,7 +117,7 @@ class PulseSequence: def duration(self, duration: str): # Duration needs to be a positive number try: - duration = UnitConverter.to_decimal(duration) + duration = UnitConverter.to_float(duration) except ValueError: raise ValueError("Duration needs to be a number") if duration < 0: diff --git a/src/nqrduck_spectrometer/settings.py b/src/nqrduck_spectrometer/settings.py index 4528b79..7187f1d 100644 --- a/src/nqrduck_spectrometer/settings.py +++ b/src/nqrduck_spectrometer/settings.py @@ -156,6 +156,7 @@ class FloatSetting(NumericalSetting): """ if state: self.value = text + self.settings_changed.emit() @property def value(self): @@ -164,6 +165,7 @@ class FloatSetting(NumericalSetting): @value.setter def value(self, value): + logger.debug(f"Setting {self.name} to {value}") self._value = float(value) self.settings_changed.emit() @@ -210,6 +212,7 @@ class IntSetting(NumericalSetting): """ if state: self.value = text + self.settings_changed.emit() @property def value(self): @@ -218,6 +221,7 @@ class IntSetting(NumericalSetting): @value.setter def value(self, value): + logger.debug(f"Setting {self.name} to {value}") value = int(float(value)) self._value = value self.settings_changed.emit()