SendableRegistry
- class wpiutil.SendableRegistry
Bases:
pybind11_object
The SendableRegistry class is the public interface for registering sensors and actuators for use on dashboards and LiveWindow.
- static add(*args, **kwargs)
Overloaded function.
add(sendable: wpiutil._wpiutil.Sendable, name: str) -> None
Adds an object to the registry.
- Parameters:
sendable – object to add
name – component name
add(sendable: wpiutil._wpiutil.Sendable, moduleType: str, channel: int) -> None
Adds an object to the registry.
- Parameters:
sendable – object to add
moduleType – A string that defines the module name in the label for the value
channel – The channel number the device is plugged into
add(sendable: wpiutil._wpiutil.Sendable, moduleType: str, moduleNumber: int, channel: int) -> None
Adds an object to the registry.
- Parameters:
sendable – object to add
moduleType – A string that defines the module name in the label for the value
moduleNumber – The number of the particular module type
channel – The channel number the device is plugged into
add(sendable: wpiutil._wpiutil.Sendable, subsystem: str, name: str) -> None
Adds an object to the registry.
- Parameters:
sendable – object to add
subsystem – subsystem name
name – component name
- static addChild(parent: wpiutil._wpiutil.Sendable, child: wpiutil._wpiutil.Sendable) None
Adds a child object to an object. Adds the child object to the registry if it’s not already present.
- Parameters:
parent – parent object
child – child object
- static addLW(*args, **kwargs)
Overloaded function.
addLW(sendable: wpiutil._wpiutil.Sendable, name: str) -> None
Adds an object to the registry and LiveWindow.
- Parameters:
sendable – object to add
name – component name
addLW(sendable: wpiutil._wpiutil.Sendable, moduleType: str, channel: int) -> None
Adds an object to the registry and LiveWindow.
- Parameters:
sendable – object to add
moduleType – A string that defines the module name in the label for the value
channel – The channel number the device is plugged into
addLW(sendable: wpiutil._wpiutil.Sendable, moduleType: str, moduleNumber: int, channel: int) -> None
Adds an object to the registry and LiveWindow.
- Parameters:
sendable – object to add
moduleType – A string that defines the module name in the label for the value
moduleNumber – The number of the particular module type
channel – The channel number the device is plugged into
addLW(sendable: wpiutil._wpiutil.Sendable, subsystem: str, name: str) -> None
Adds an object to the registry and LiveWindow.
- Parameters:
sendable – object to add
subsystem – subsystem name
name – component name
- static contains(sendable: wpiutil._wpiutil.Sendable) bool
Determines if an object is in the registry.
- Parameters:
sendable – object to check
- Returns:
True if in registry, false if not.
- static disableLiveWindow(sendable: wpiutil._wpiutil.Sendable) None
Disables LiveWindow for an object.
- Parameters:
sendable – object
- static enableLiveWindow(sendable: wpiutil._wpiutil.Sendable) None
Enables LiveWindow for an object.
- Parameters:
sendable – object
- static getName(sendable: wpiutil._wpiutil.Sendable) str
Gets the name of an object.
- Parameters:
sendable – object
- Returns:
Name (empty if object is not in registry)
- static getSendable(uid: int) wpiutil._wpiutil.Sendable
Get sendable object for a given unique id.
- Parameters:
uid – unique id
- Returns:
sendable object (may be null)
- static getSubsystem(sendable: wpiutil._wpiutil.Sendable) str
Gets the subsystem name of an object.
- Parameters:
sendable – object
- Returns:
Subsystem name (empty if object is not in registry)
- static getUniqueId(sendable: wpiutil._wpiutil.Sendable) int
Get unique id for an object. Since objects can move, use this instead of storing Sendable* directly if ownership is in question.
- Parameters:
sendable – object
- Returns:
unique id
- static publish(sendableUid: int, builder: wpiutil._wpiutil.SendableBuilder) None
Publishes an object in the registry.
- Parameters:
sendableUid – sendable unique id
builder – publisher backend
- static remove(sendable: wpiutil._wpiutil.Sendable) bool
Removes an object from the registry.
- Parameters:
sendable – object to remove
- Returns:
true if the object was removed; false if it was not present
- static setLiveWindowBuilderFactory(factory: Callable[[], wpiutil._wpiutil.SendableBuilder]) None
Sets the factory for LiveWindow builders.
- Parameters:
factory – factory function
- static setName(*args, **kwargs)
Overloaded function.
setName(sendable: wpiutil._wpiutil.Sendable, name: str) -> None
Sets the name of an object.
- Parameters:
sendable – object
name – name
setName(sendable: wpiutil._wpiutil.Sendable, moduleType: str, channel: int) -> None
Sets the name of an object with a channel number.
- Parameters:
sendable – object
moduleType – A string that defines the module name in the label for the value
channel – The channel number the device is plugged into
setName(sendable: wpiutil._wpiutil.Sendable, moduleType: str, moduleNumber: int, channel: int) -> None
Sets the name of an object with a module and channel number.
- Parameters:
sendable – object
moduleType – A string that defines the module name in the label for the value
moduleNumber – The number of the particular module type
channel – The channel number the device is plugged into
setName(sendable: wpiutil._wpiutil.Sendable, subsystem: str, name: str) -> None
Sets both the subsystem name and device name of an object.
- Parameters:
sendable – object
subsystem – subsystem name
name – device name
- static setSubsystem(sendable: wpiutil._wpiutil.Sendable, subsystem: str) None
Sets the subsystem name of an object.
- Parameters:
sendable – object
subsystem – subsystem name
- static update(sendableUid: int) None
Updates published information from an object.
- Parameters:
sendableUid – sendable unique id