mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-14 07:04:26 -04:00
Init commit
This commit is contained in:
commit
cf481e5f13
12 changed files with 547 additions and 0 deletions
35
pyhon/parameter.py
Normal file
35
pyhon/parameter.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
class HonParameter:
|
||||
def __init__(self, key, attributes):
|
||||
self._key = key
|
||||
self._category = attributes.get("category")
|
||||
self._typology = attributes.get("typology")
|
||||
self._mandatory = attributes.get("mandatory")
|
||||
self._value = ""
|
||||
|
||||
@property
|
||||
def value(self):
|
||||
return self._value if self._value is not None else "0"
|
||||
|
||||
|
||||
class HonParameterFixed(HonParameter):
|
||||
def __init__(self, key, attributes):
|
||||
super().__init__(key, attributes)
|
||||
self._value = attributes["fixedValue"]
|
||||
|
||||
|
||||
class HonParameterRange(HonParameter):
|
||||
def __init__(self, key, attributes):
|
||||
super().__init__(key, attributes)
|
||||
self._value = attributes.get("defaultValue")
|
||||
self._default = attributes.get("defaultValue")
|
||||
self._min = attributes["minimumValue"]
|
||||
self._max = attributes["maximumValue"]
|
||||
self._step = attributes["incrementValue"]
|
||||
|
||||
|
||||
class HonParameterEnum(HonParameter):
|
||||
def __init__(self, key, attributes):
|
||||
super().__init__(key, attributes)
|
||||
self._value = attributes.get("defaultValue", "0")
|
||||
self._default = attributes["defaultValue"]
|
||||
self._values = attributes["enumValues"]
|
Loading…
Add table
Add a link
Reference in a new issue