SendableBuilder

class wpiutil.SendableBuilder

Bases: pybind11_object

Helper class for building Sendable dashboard representations.

class BackendKind(value: SupportsInt | SupportsIndex)

Bases: pybind11_object

The backend kinds used for the sendable builder.

Members:

kUnknown : Unknown.

kNetworkTables : NetworkTables.

kNetworkTables = <BackendKind.kNetworkTables: 1>
kUnknown = <BackendKind.kUnknown: 0>
SendableBuilder.BackendKind.name -> str
property value
addBooleanArrayProperty(key: str, getter: collections.abc.Callable[[], list[int]], setter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], None]) None

Add a boolean array property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addBooleanProperty(key: str, getter: collections.abc.Callable[[], bool], setter: collections.abc.Callable[[bool], None]) None

Add a boolean property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addDoubleArrayProperty(key: str, getter: collections.abc.Callable[[], list[float]], setter: collections.abc.Callable[[List[SupportsFloat | SupportsIndex]], None]) None

Add a double array property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addDoubleProperty(key: str, getter: collections.abc.Callable[[], float], setter: collections.abc.Callable[[SupportsFloat | SupportsIndex], None]) None

Add a double property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addFloatArrayProperty(key: str, getter: collections.abc.Callable[[], list[float]], setter: collections.abc.Callable[[List[SupportsFloat | SupportsIndex]], None]) None

Add a float array property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addFloatProperty(key: str, getter: collections.abc.Callable[[], float], setter: collections.abc.Callable[[SupportsFloat | SupportsIndex], None]) None

Add a float property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addIntegerArrayProperty(key: str, getter: collections.abc.Callable[[], list[int]], setter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], None]) None

Add an integer array property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addIntegerProperty(key: str, getter: collections.abc.Callable[[], int], setter: collections.abc.Callable[[SupportsInt | SupportsIndex], None]) None

Add an integer property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addRawProperty(key: str, typeString: str, getter: collections.abc.Callable[[], list[int]], setter: collections.abc.Callable[[Buffer], None]) None

Add a raw property.

Parameters:
  • key – property name

  • typeString – type string

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallBooleanArrayProperty(key: str, getter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], List[int]], setter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], None]) None

Add a boolean array property (SmallVector form).

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallDoubleArrayProperty(key: str, getter: collections.abc.Callable[[List[SupportsFloat | SupportsIndex]], List[float]], setter: collections.abc.Callable[[List[SupportsFloat | SupportsIndex]], None]) None

Add a double array property (SmallVector form).

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallFloatArrayProperty(key: str, getter: collections.abc.Callable[[List[SupportsFloat | SupportsIndex]], List[float]], setter: collections.abc.Callable[[List[SupportsFloat | SupportsIndex]], None]) None

Add a float array property (SmallVector form).

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallIntegerArrayProperty(key: str, getter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], List[int]], setter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], None]) None

Add an integer array property (SmallVector form).

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallRawProperty(key: str, typeString: str, getter: collections.abc.Callable[[List[SupportsInt | SupportsIndex]], Buffer], setter: collections.abc.Callable[[Buffer], None]) None

Add a raw property (SmallVector form).

Parameters:
  • key – property name

  • typeString – type string

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallStringArrayProperty(key: str, getter: collections.abc.Callable[[List[str]], List[str]], setter: collections.abc.Callable[[List[str]], None]) None

Add a string array property (SmallVector form).

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addSmallStringProperty(key: str, getter: collections.abc.Callable[[List[str]], str], setter: collections.abc.Callable[[str], None]) None

Add a string property (SmallString form).

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addStringArrayProperty(key: str, getter: collections.abc.Callable[[], list[str]], setter: collections.abc.Callable[[List[str]], None]) None

Add a string array property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

addStringProperty(key: str, getter: collections.abc.Callable[[], str], setter: collections.abc.Callable[[str], None]) None

Add a string property.

Parameters:
  • key – property name

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

clearProperties() None

Clear properties.

getBackendKind() wpiutil._wpiutil.SendableBuilder.BackendKind

Gets the kind of backend being used.

Returns:

Backend kind

isPublished() bool

Return whether this sendable has been published.

Returns:

True if it has been published, false if not.

publishConstBoolean(key: str, value: bool) None

Add a constant boolean property.

Parameters:
  • key – property name

  • value – the value

publishConstBooleanArray(key: str, value: List[SupportsInt | SupportsIndex]) None

Add a constant boolean array property.

Parameters:
  • key – property name

  • value – the value

publishConstDouble(key: str, value: SupportsFloat | SupportsIndex) None

Add a constant double property.

Parameters:
  • key – property name

  • value – the value

publishConstDoubleArray(key: str, value: List[SupportsFloat | SupportsIndex]) None

Add a constant double array property.

Parameters:
  • key – property name

  • value – the value

publishConstFloat(key: str, value: SupportsFloat | SupportsIndex) None

Add a constant float property.

Parameters:
  • key – property name

  • value – the value

publishConstFloatArray(key: str, value: List[SupportsFloat | SupportsIndex]) None

Add a constant float array property.

Parameters:
  • key – property name

  • value – the value

publishConstInteger(key: str, value: SupportsInt | SupportsIndex) None

Add a constant integer property.

Parameters:
  • key – property name

  • value – the value

publishConstIntegerArray(key: str, value: List[SupportsInt | SupportsIndex]) None

Add a constant integer array property.

Parameters:
  • key – property name

  • value – the value

publishConstRaw(key: str, typeString: str, value: Buffer) None

Add a constant raw property.

Parameters:
  • key – property name

  • typeString – type string

  • value – the value

publishConstString(key: str, value: str) None

Add a constant string property.

Parameters:
  • key – property name

  • value – the value

publishConstStringArray(key: str, value: List[str]) None

Add a constant string array property.

Parameters:
  • key – property name

  • value – the value

setActuator(value: bool) None

Set a flag indicating if this sendable should be treated as an actuator. By default this flag is false.

Parameters:

value – true if actuator, false if not

setSmartDashboardType(type: str) None

Set the string representation of the named data type that will be used by the smart dashboard for this sendable.

Parameters:

type – data type

update() None

Update the published values by calling the getters for all properties.