SendableBuilder

class wpiutil.SendableBuilder

Bases: pybind11_object

Helper class for building Sendable dashboard representations.

class BackendKind(value: int)

Bases: pybind11_object

The backend kinds used for the sendable builder.

Members:

kUnknown : Unknown.

kNetworkTables : NetworkTables.

kNetworkTables = <BackendKind.kNetworkTables: 1>
kUnknown = <BackendKind.kUnknown: 0>
property name
property value
addBooleanArrayProperty(key: str, getter: Callable[[], list[int]], setter: Callable[[List[int]], 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: Callable[[], bool], setter: 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: Callable[[], list[float]], setter: Callable[[List[float]], 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: Callable[[], float], setter: Callable[[float], 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: Callable[[], list[float]], setter: Callable[[List[float]], 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: Callable[[], float], setter: Callable[[float], 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: Callable[[], list[int]], setter: Callable[[List[int]], 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: Callable[[], int], setter: Callable[[int], 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: Callable[[], list[int]], setter: 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: Callable[[List[int]], List[int]], setter: Callable[[List[int]], 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: Callable[[List[float]], List[float]], setter: Callable[[List[float]], 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: Callable[[List[float]], List[float]], setter: Callable[[List[float]], 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: Callable[[List[int]], List[int]], setter: Callable[[List[int]], 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: Callable[[List[int]], Buffer], setter: 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: Callable[[List[str]], List[str]], setter: 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: Callable[[List[str]], str], setter: 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: Callable[[], list[str]], setter: 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: Callable[[], str], setter: 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[int]) None

Add a constant boolean array property.

Parameters:
  • key – property name

  • value – the value

publishConstDouble(key: str, value: float) None

Add a constant double property.

Parameters:
  • key – property name

  • value – the value

publishConstDoubleArray(key: str, value: List[float]) None

Add a constant double array property.

Parameters:
  • key – property name

  • value – the value

publishConstFloat(key: str, value: float) None

Add a constant float property.

Parameters:
  • key – property name

  • value – the value

publishConstFloatArray(key: str, value: List[float]) None

Add a constant float array property.

Parameters:
  • key – property name

  • value – the value

publishConstInteger(key: str, value: int) None

Add a constant integer property.

Parameters:
  • key – property name

  • value – the value

publishConstIntegerArray(key: str, value: List[int]) 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

setSafeState(func: Callable[[], None]) None

Set the function that should be called to set the Sendable into a safe state. This is called when entering and exiting Live Window mode.

Parameters:

func – function

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.