Improved logging. Removed Decimals.

This commit is contained in:
jupfi 2024-04-26 17:31:42 +02:00
parent 37796e5800
commit adc088aae1
2 changed files with 5 additions and 1 deletions

View file

@ -117,7 +117,7 @@ class PulseSequence:
def duration(self, duration: str): def duration(self, duration: str):
# Duration needs to be a positive number # Duration needs to be a positive number
try: try:
duration = UnitConverter.to_decimal(duration) duration = UnitConverter.to_float(duration)
except ValueError: except ValueError:
raise ValueError("Duration needs to be a number") raise ValueError("Duration needs to be a number")
if duration < 0: if duration < 0:

View file

@ -156,6 +156,7 @@ class FloatSetting(NumericalSetting):
""" """
if state: if state:
self.value = text self.value = text
self.settings_changed.emit()
@property @property
def value(self): def value(self):
@ -164,6 +165,7 @@ class FloatSetting(NumericalSetting):
@value.setter @value.setter
def value(self, value): def value(self, value):
logger.debug(f"Setting {self.name} to {value}")
self._value = float(value) self._value = float(value)
self.settings_changed.emit() self.settings_changed.emit()
@ -210,6 +212,7 @@ class IntSetting(NumericalSetting):
""" """
if state: if state:
self.value = text self.value = text
self.settings_changed.emit()
@property @property
def value(self): def value(self):
@ -218,6 +221,7 @@ class IntSetting(NumericalSetting):
@value.setter @value.setter
def value(self, value): def value(self, value):
logger.debug(f"Setting {self.name} to {value}")
value = int(float(value)) value = int(float(value))
self._value = value self._value = value
self.settings_changed.emit() self.settings_changed.emit()