improve HasRamp
Change-Id: I0ddabb8b2681712637a18c392da5424d30a05b4b
This commit is contained in:
@@ -22,13 +22,16 @@
|
||||
|
||||
"""modules to access parameters"""
|
||||
|
||||
from frappy.core import Drivable, IDLE, Attached, StringType, Property, Proxy
|
||||
from frappy.mixins import HasRamp
|
||||
from frappy.core import Drivable, IDLE, Attached, StringType, Property, \
|
||||
Parameter, FloatRange
|
||||
from frappy.errors import ConfigError
|
||||
from frappy_psi.convergence import HasConvergence
|
||||
from frappy_psi.mixins import HasRamp
|
||||
|
||||
|
||||
class Driv(Drivable):
|
||||
value = Parameter(datatype=FloatRange(unit='$'))
|
||||
target = Parameter(datatype=FloatRange(unit='$'))
|
||||
read = Attached(description='<module>.<parameter> for read')
|
||||
write = Attached(description='<module>.<parameter> for read')
|
||||
unit = Property('main unit', StringType())
|
||||
@@ -40,8 +43,7 @@ class Driv(Drivable):
|
||||
super().setProperty(key, value)
|
||||
|
||||
def checkProperties(self):
|
||||
self.parameters['value'].setProperty('unit', self.unit)
|
||||
self.parameters['target'].setProperty('unit', self.unit)
|
||||
self.applyMainUnit(self.unit)
|
||||
if self.read == self.name or self.write == self.name:
|
||||
raise ConfigError('illegal recursive read/write module')
|
||||
super().checkProperties()
|
||||
|
||||
Reference in New Issue
Block a user