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:

UNKNOWN : Unknown.

NETWORK_TABLES : NetworkTables.

NETWORK_TABLES = <BackendKind.NETWORK_TABLES: 1>
UNKNOWN = <BackendKind.UNKNOWN: 0>
SendableBuilder.BackendKind.name -> str
property value
add_boolean_array_property(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)

add_boolean_property(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)

add_double_array_property(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)

add_double_property(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)

add_float_array_property(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)

add_float_property(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)

add_integer_array_property(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)

add_integer_property(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)

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

Add a raw property.

Parameters:
  • key – property name

  • type_string – type string

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

add_small_boolean_array_property(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)

add_small_double_array_property(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)

add_small_float_array_property(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)

add_small_integer_array_property(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)

add_small_raw_property(key: str, type_string: 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

  • type_string – type string

  • getter – getter function (returns current value)

  • setter – setter function (sets new value)

add_small_string_array_property(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)

add_small_string_property(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)

add_string_array_property(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)

add_string_property(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)

clear_properties() None

Clear properties.

get_backend_kind() wpiutil._wpiutil.SendableBuilder.BackendKind

Gets the kind of backend being used.

Returns:

Backend kind

is_published() bool

Return whether this sendable has been published.

Returns:

True if it has been published, false if not.

publish_const_boolean(key: str, value: bool) None

Add a constant boolean property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant boolean array property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant double property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant double array property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant float property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant float array property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant integer property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant integer array property.

Parameters:
  • key – property name

  • value – the value

publish_const_raw(key: str, type_string: str, value: Buffer) None

Add a constant raw property.

Parameters:
  • key – property name

  • type_string – type string

  • value – the value

publish_const_string(key: str, value: str) None

Add a constant string property.

Parameters:
  • key – property name

  • value – the value

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

Add a constant string array property.

Parameters:
  • key – property name

  • value – the value

set_actuator(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

set_smart_dashboard_type(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.