本文整理汇总了Python中networktables.NetworkTable.getGlobalTable方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkTable.getGlobalTable方法的具体用法?Python NetworkTable.getGlobalTable怎么用?Python NetworkTable.getGlobalTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类networktables.NetworkTable
的用法示例。
在下文中一共展示了NetworkTable.getGlobalTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import getGlobalTable [as 别名]
def open(self):
logger.info("NetworkTables websocket opened")
self.ioloop = IOLoop.current()
self.nt = NetworkTable.getGlobalTable()
NetworkTable.addGlobalListener(self.on_nt_change, immediateNotify=True)
self.nt.addConnectionListener(self, immediateNotify=True)
示例2: __init__
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import getGlobalTable [as 别名]
def __init__(self, update_callback):
"""
:param update_callback: A callable with signature ```callable(update)``` for processing outgoing updates
formatted as strings.
"""
self.update_callback = update_callback
self.nt = NetworkTable.getGlobalTable()
NetworkTable.addGlobalListener(self._nt_on_change, immediateNotify=True)
class Empty:
pass
self.conn_listener = Empty()
self.conn_listener.connected = self._nt_connected
self.conn_listener.disconnected = self._nt_disconnected
self.nt.addConnectionListener(self.conn_listener, immediateNotify=True)