本文整理汇总了Python中device.Device.allowRemoteShutdown方法的典型用法代码示例。如果您正苦于以下问题:Python Device.allowRemoteShutdown方法的具体用法?Python Device.allowRemoteShutdown怎么用?Python Device.allowRemoteShutdown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类device.Device
的用法示例。
在下文中一共展示了Device.allowRemoteShutdown方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onRun
# 需要导入模块: from device import Device [as 别名]
# 或者: from device.Device import allowRemoteShutdown [as 别名]
def onRun(self):
#todo: process inputs values, or some of them @ each cycle (transfer output world into ios.value)
#self.li0.value=...
#todo: update outputs values (or some of them @ each cycle)
#self.lo0.value=xxx+yyyy
#cpu saver
self.sleep(0.1)
def onUpdateOutput(self, io):
#todo: process the given output (apply io.value to the output world)
#xxxx=io.value
pass
def onStop(self):
# do a clean exit
self.resetAllOutputs()
def onRelease(self):
pass
def onTimeout(self, timer):
#todo: process the given timer
pass
dev=Device(MyIOManager, 8888)
dev.allowRemoteShutdown(True)
dev.start()