70 def check(self, stringvalue):
71 typedvalue = self.value_type(stringvalue)
72 if self.min_value is not None and typedvalue < self.min_value:
73 raise HardwareException("%s is too low (%s, min=%s)" %
74 (self.name, stringvalue, str(self.min_value)),
75 sleeptime=self.sleeptime)
76 if self.max_value is not None and typedvalue > self.max_value:
77 raise HardwareException("%s is too high (%s, max=%s)" %
78 (self.name, stringvalue, str(self.max_value)),
79 sleeptime=self.sleeptime)
80 if self.exact_value is not None and typedvalue != self.exact_value:
81 raise HardwareException("unexpected %s (%s, expected=%s)" %
82 (self.name, stringvalue, str(self.exact_value)),
83 sleeptime=self.sleeptime)
84
#define check(reporter, ref, unref, make, kill)