def __init__(self, table: NetworkTable, field: str) -> None:
        """Initialize the NetworkButton.

        :param table: the :class:`.NetworkTable` instance to use, or the name of the
                      table to use.
        :param field: field to use.
        """
        if isinstance(table, NetworkTable):
            self.entry = table.getEntry(field)
        else:
            table = NetworkTablesInstance.getDefault().getTable(table)
            self.entry = table.getEntry(field)
Beispiel #2
0
    def __init__(self, table: NetworkTable, field: str) -> None:
        """Initialize the NetworkButton.

        :param table: the :class:`.NetworkTable` instance to use, or the name of the
                      table to use.
        :param field: field to use.
        """
        if isinstance(table, NetworkTable):
            self.entry = table.getEntry(field)
        else:
            table = NetworkTablesInstance.getDefault().getTable(table)
            self.entry = table.getEntry(field)
Beispiel #3
0
    def setTable(self, table: NetworkTable) -> None:
        """
        Set the network table.  Must be called prior to any Add* functions being called.

        :param table: Network table
        """
        self.table = table
        self.controllableEntry = table.getEntry(".controllable")
 def __init__(
     self, table: NetworkTable, key: str, update: Callable, setter: Callable
 ) -> None:
     self.entry = table.getEntry(key)
     self.key = key
     self.update = update
     self.setter = setter
     self.listener = None
    def setTable(self, table: NetworkTable) -> None:
        """
        Set the network table.  Must be called prior to any Add* functions being called.

        :param table: Network table
        """
        self.table = table
        self.controllableEntry = table.getEntry(".controllable")
Beispiel #6
0
 def __init__(
     self,
     table: NetworkTable,
     key: str,
     update: Callable,
     setter: Callable,
     listen_local: bool,
 ) -> None:
     self.entry = table.getEntry(key)
     self.key = key
     self.update = update
     self.setter = setter
     self.listener = None
     # python-specific: sendable chooser needs to be able to hear local updates
     self.listen_local = listen_local
 def __init__(
     self,
     table: NetworkTable,
     key: str,
     update: Callable,
     setter: Callable,
     listen_local: bool,
 ) -> None:
     self.entry = table.getEntry(key)
     self.key = key
     self.update = update
     self.setter = setter
     self.listener = None
     # python-specific: sendable chooser needs to be able to hear local updates
     self.listen_local = listen_local