- added Module.is_busy() for treating substates of BUSY correctly
Change-Id: I17f6b2daf8a5b31e9ab8dcd808b84806df47eb76 Reviewed-on: https://forge.frm2.tum.de/review/20293 Tested-by: JenkinsCodeReview <bjoern_pedersen@frm2.tum.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
This commit is contained in:
parent
0bb4c3730e
commit
22ff707e51
@ -211,6 +211,10 @@ class Module(object):
|
||||
if '$' in v.unit:
|
||||
v.unit = v.unit.replace('$', self.accessibles['value'].unit)
|
||||
|
||||
def isBusy(self):
|
||||
'''helper function for treating substates of BUSY correctly'''
|
||||
# defined even for non drivable (used for dynamic polling)
|
||||
return False
|
||||
|
||||
def early_init(self):
|
||||
# may be overriden in derived classes to init stuff
|
||||
@ -342,6 +346,10 @@ class Drivable(Writable):
|
||||
'status' : Override(datatype=TupleOf(EnumType(Status), StringType())),
|
||||
}
|
||||
|
||||
def isBusy(self):
|
||||
'''helper function for treating substates of BUSY correctly'''
|
||||
return 300 <= self.status[0] < 400
|
||||
|
||||
# improved polling: may poll faster if module is BUSY
|
||||
def poll(self, nr=0):
|
||||
# poll status first
|
||||
|
Loading…
x
Reference in New Issue
Block a user