This commit is contained in:
gac-S_Changer
2018-09-04 13:32:11 +02:00
parent 03a3023b4d
commit 07664f8749
7 changed files with 54 additions and 7 deletions

View File

@@ -21,14 +21,17 @@ class BarcodeReader(DeviceBase):
try:
self.setState(State.Busy)
microscan.flush()
ret = microscan.waitString(int(timeout * 1000))
ret = microscan.waitString(int(timeout * 1000))
if ret is not None:
ret = ret.strip()
self.setCache(ret, None)
return ret
except:
self.setCache(None, None)
return None
finally:
self.setState(State.Ready)
if self.state == State.Busy:
self.setState(State.Ready)
def doUpdate(self):
self.get()