mirror of
https://github.com/Andre0512/pyhOn.git
synced 2024-12-22 18:55:32 +00:00
Fixed setting wrong current value
This commit is contained in:
parent
0f630e854e
commit
00ac6912e2
|
@ -76,7 +76,7 @@ class HonParameterRange(HonParameter):
|
|||
@value.setter
|
||||
def value(self, value):
|
||||
if self._min <= value <= self._max and not value % self._step:
|
||||
self._value = self._value
|
||||
self._value = value
|
||||
else:
|
||||
raise ValueError(f"Allowed: min {self._min} max {self._max} step {self._step}")
|
||||
|
||||
|
@ -102,7 +102,7 @@ class HonParameterEnum(HonParameter):
|
|||
@value.setter
|
||||
def value(self, value):
|
||||
if value in self.values:
|
||||
self._value = self._value
|
||||
self._value = value
|
||||
else:
|
||||
raise ValueError(f"Allowed values {self._value}")
|
||||
|
||||
|
@ -123,4 +123,4 @@ class HonParameterProgram(HonParameterEnum):
|
|||
if value in self.values:
|
||||
self._command.set_program(value)
|
||||
else:
|
||||
raise ValueError(f"Allowed values {self._value}")
|
||||
raise ValueError(f"Allowed values {self._values}")
|
||||
|
|
Loading…
Reference in a new issue