本文整理匯總了Python中channel.Channel.chopperVerre方法的典型用法代碼示例。如果您正苦於以下問題:Python Channel.chopperVerre方法的具體用法?Python Channel.chopperVerre怎麽用?Python Channel.chopperVerre使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類channel.Channel
的用法示例。
在下文中一共展示了Channel.chopperVerre方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from channel import Channel [as 別名]
# 或者: from channel.Channel import chopperVerre [as 別名]
class Processor:
def __init__(self, host, port):
self.sock = socket.socket()
self.sock.connect((HOST, PORT+5))
self.asserv_file = self.sock.makefile(mode='rw')
self.asserv = Channel(self.asserv_file.buffer,
lambda name, args: name, proto = 'asserv')
self.states = None
self.speed = SpeedOrder(self.asserv)
self.speed.start()
self.sock2 = socket.socket()
self.sock2.connect((HOST, PORT+6))
self.mother_file = self.sock2.makefile(mode='rw')
self.mother = Channel(self.mother_file.buffer,
lambda name, args: name, proto = 'mother')
def event(self, axes, buttons):
#print(axes, buttons)
self.pince = axes[2] < 0
self.speed.update(axes[0], axes[1], axes[2])
if self.states and len(self.states) == len(buttons):
for i in range(len(buttons)):
if self.states[i] == 0 and buttons[i] == 1:
#print("Button %d pressed!" %i)
if self.pince:
if i == 2:
self.mother.sortirPince()
elif i == 3:
self.mother.getNombreVerres()
elif i == 0:
self.mother.chopperVerre()
elif i == 1:
self.mother.lacherVerres()
else:
if i == 2:
self.mother.BougiesOn()
elif i == 3:
self.mother.BougiesOff()
elif i == 0:
self.mother.BougiesHitBot()
elif i == 1:
self.mother.BougiesHitTop()
if i == 4:
self.mother.startAX12()
elif i == 5:
self.mother.FunnyAction()
elif i == 6:
self.mother.stopAX12()
elif i == 7:
self.asserv.stop()
self.states = buttons