small fixes
This commit is contained in:
parent
c59b24a561
commit
03d8045990
@ -62,7 +62,7 @@ threading.Thread(target=worker).start()
|
||||
def register_racer():
|
||||
card_id = last_card
|
||||
index = window.racers.currentIndex()
|
||||
if not index:
|
||||
if not index.data():
|
||||
mb = QtWidgets.QMessageBox(text='Prosím vyberte závodníka!')
|
||||
mb.exec()
|
||||
return
|
||||
|
@ -1,6 +1,7 @@
|
||||
import usb.core
|
||||
import usb.util
|
||||
|
||||
import threading
|
||||
import time
|
||||
|
||||
|
||||
USB_IF = 0 # Interface
|
||||
@ -33,13 +34,13 @@ class UsbCardReader:
|
||||
control = None
|
||||
try:
|
||||
control = self.dev.read(self.endpoint.bEndpointAddress, self.endpoint.wMaxPacketSize, USB_TIMEOUT)
|
||||
if (control[2] != 40) & (control[2] != 0):
|
||||
if (control[2] != 40) and (control[2] != 0):
|
||||
receivedDigit = control[2] - 29
|
||||
if receivedDigit == 10:
|
||||
receivedDigit = 0
|
||||
receivedNumber = 10 * receivedNumber + receivedDigit
|
||||
|
||||
if (( control[0] == 0 )) & (( control[2] == 40 )) & (( not receivedNumber == 0 )):
|
||||
if ( control[0] == 0 ) and ( control[2] == 40 ) and ( not receivedNumber == 0 ):
|
||||
self.callback(receivedNumber)
|
||||
receivedNumber = 0
|
||||
except KeyboardInterrupt:
|
||||
|
Loading…
x
Reference in New Issue
Block a user