本文整理汇总了Python中channel.Channel.stop方法的典型用法代码示例。如果您正苦于以下问题:Python Channel.stop方法的具体用法?Python Channel.stop怎么用?Python Channel.stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类channel.Channel
的用法示例。
在下文中一共展示了Channel.stop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from channel import Channel [as 别名]
# 或者: from channel.Channel import stop [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