From 22ff707e51236d1e0e3d3b9589b28f0f004b7ccf Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Mon, 1 Apr 2019 13:56:51 +0200 Subject: [PATCH] - 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 Reviewed-by: Enrico Faulhaber --- secop/modules.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/secop/modules.py b/secop/modules.py index 07c0936c..7a983592 100644 --- a/secop/modules.py +++ b/secop/modules.py @@ -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