本文整理汇总了Python中action.Action.addDevice方法的典型用法代码示例。如果您正苦于以下问题:Python Action.addDevice方法的具体用法?Python Action.addDevice怎么用?Python Action.addDevice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类action.Action
的用法示例。
在下文中一共展示了Action.addDevice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from action import Action [as 别名]
# 或者: from action.Action import addDevice [as 别名]
def main():
"""! @brief Main of the software"""
## Qt Application
app = QtGui.QApplication(sys.argv)
app.setOrganizationName('Digiclever')
app.setApplicationName('NFC Golf Ball Dispenser')
## Frame instance
frame = Frame()
frame.show()
## PiFaceControl instance
piface = PiFaceControl()
## Action instance
action = Action(piface)
## CardReader instance
cardReader = CardReader(action)
# connect signals to slots
frame.b1.clicked.connect(cardReader.someBalls)
frame.b2.clicked.connect(cardReader.manyBalls)
frame.transaction.clicked.connect(lambda: action.getLastTransactions(cardReader.cardUid))
frame.admin.clicked.connect(frame.toggleAdminView)
frame.log.clicked.connect(lambda: frame.displayAdmin(frame.adminUsername.text(), frame.adminPassword.text()))
frame.bRecharge.clicked.connect(lambda: cardReader.recharge(frame.moneyBox.value()))
frame.bCreateAccount.clicked.connect(lambda: action.addUser(frame.username.text(), frame.name.text(), frame.surname.text()))
frame.bAddDevice.clicked.connect(lambda: action.addDevice(frame.username2.text(), cardReader.cardUid, cardReader.ATR))
action.status.connect(frame.displayStatus)
action.transactionsLoaded.connect(frame.displayTransactions)
frame.connect(frame.warningTimer, SIGNAL("timeout()"), cardReader.start)
frame.connect(frame.releaseCardTimer, SIGNAL("timeout()"), cardReader.start)
cardReader.connect(cardReader.timer, SIGNAL("timeout()"), cardReader.waitForCard)
cardReader.updateWaiting.connect(frame.update)
cardReader.cardDetected.connect(frame.displayCard)
cardReader.warning.connect(frame.displayWarning)
frame.activateButton.connect(piface.activateButtonListener)
frame.deactivateButton.connect(piface.deactivateButtonListener)
piface.b1.connect(cardReader.someBalls)
piface.b2.connect(cardReader.manyBalls)
piface.b3.connect(lambda: action.getLastTransactions(cardReader.cardUid))
piface.b4.connect(frame.toggleAdminView)
cardReader.start()
sys.exit(app.exec_())