Robot Core Documentation
Loading...
Searching...
No Matches
edu.wpi.first.util.sendable.SendableBuilder Interface Reference

Classes

enum  BackendKind
 

Public Member Functions

void setSmartDashboardType (String type)
 
void setActuator (boolean value)
 
void setSafeState (Runnable func)
 
void addBooleanProperty (String key, BooleanSupplier getter, BooleanConsumer setter)
 
void publishConstBoolean (String key, boolean value)
 
void addIntegerProperty (String key, LongSupplier getter, LongConsumer setter)
 
void publishConstInteger (String key, long value)
 
void addFloatProperty (String key, FloatSupplier getter, FloatConsumer setter)
 
void publishConstFloat (String key, float value)
 
void addDoubleProperty (String key, DoubleSupplier getter, DoubleConsumer setter)
 
void publishConstDouble (String key, double value)
 
void addStringProperty (String key, Supplier< String > getter, Consumer< String > setter)
 
void publishConstString (String key, String value)
 
void addBooleanArrayProperty (String key, Supplier< boolean[]> getter, Consumer< boolean[]> setter)
 
void publishConstBooleanArray (String key, boolean[] value)
 
void addIntegerArrayProperty (String key, Supplier< long[]> getter, Consumer< long[]> setter)
 
void publishConstIntegerArray (String key, long[] value)
 
void addFloatArrayProperty (String key, Supplier< float[]> getter, Consumer< float[]> setter)
 
void publishConstFloatArray (String key, float[] value)
 
void addDoubleArrayProperty (String key, Supplier< double[]> getter, Consumer< double[]> setter)
 
void publishConstDoubleArray (String key, double[] value)
 
void addStringArrayProperty (String key, Supplier< String[]> getter, Consumer< String[]> setter)
 
void publishConstStringArray (String key, String[] value)
 
void addRawProperty (String key, String typeString, Supplier< byte[]> getter, Consumer< byte[]> setter)
 
void publishConstRaw (String key, String typeString, byte[] value)
 
BackendKind getBackendKind ()
 
boolean isPublished ()
 
void update ()
 
void clearProperties ()
 
void addCloseable (AutoCloseable closeable)
 

Detailed Description

Helper class for building Sendable dashboard representations.

Member Function Documentation

◆ addBooleanArrayProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addBooleanArrayProperty ( String key,
Supplier< boolean[]> getter,
Consumer< boolean[]> setter )

Add a boolean array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addBooleanProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addBooleanProperty ( String key,
BooleanSupplier getter,
BooleanConsumer setter )

Add a boolean property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addCloseable()

void edu.wpi.first.util.sendable.SendableBuilder.addCloseable ( AutoCloseable closeable)

Adds a closeable. The closeable.close() will be called when close() is called.

Parameters
closeablecloseable object

◆ addDoubleArrayProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addDoubleArrayProperty ( String key,
Supplier< double[]> getter,
Consumer< double[]> setter )

Add a double array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addDoubleProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addDoubleProperty ( String key,
DoubleSupplier getter,
DoubleConsumer setter )

Add a double property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addFloatArrayProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addFloatArrayProperty ( String key,
Supplier< float[]> getter,
Consumer< float[]> setter )

Add a float array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addFloatProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addFloatProperty ( String key,
FloatSupplier getter,
FloatConsumer setter )

Add a float property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addIntegerArrayProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addIntegerArrayProperty ( String key,
Supplier< long[]> getter,
Consumer< long[]> setter )

Add an integer array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addIntegerProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addIntegerProperty ( String key,
LongSupplier getter,
LongConsumer setter )

Add an integer property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addRawProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addRawProperty ( String key,
String typeString,
Supplier< byte[]> getter,
Consumer< byte[]> setter )

Add a raw property.

Parameters
keyproperty name
typeStringtype string
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addStringArrayProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addStringArrayProperty ( String key,
Supplier< String[]> getter,
Consumer< String[]> setter )

Add a string array property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ addStringProperty()

void edu.wpi.first.util.sendable.SendableBuilder.addStringProperty ( String key,
Supplier< String > getter,
Consumer< String > setter )

Add a string property.

Parameters
keyproperty name
gettergetter function (returns current value)
settersetter function (sets new value)

◆ clearProperties()

void edu.wpi.first.util.sendable.SendableBuilder.clearProperties ( )

Clear properties.

◆ getBackendKind()

BackendKind edu.wpi.first.util.sendable.SendableBuilder.getBackendKind ( )

Gets the kind of backend being used.

Returns
Backend kind

◆ isPublished()

boolean edu.wpi.first.util.sendable.SendableBuilder.isPublished ( )

Return whether this sendable has been published.

Returns
True if it has been published, false if not.

◆ publishConstBoolean()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstBoolean ( String key,
boolean value )

Add a constant boolean property.

Parameters
keyproperty name
valuethe value

◆ publishConstBooleanArray()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstBooleanArray ( String key,
boolean[] value )

Add a constant boolean array property.

Parameters
keyproperty name
valuethe value

◆ publishConstDouble()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstDouble ( String key,
double value )

Add a constant double property.

Parameters
keyproperty name
valuethe value

◆ publishConstDoubleArray()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstDoubleArray ( String key,
double[] value )

Add a constant double array property.

Parameters
keyproperty name
valuethe value

◆ publishConstFloat()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstFloat ( String key,
float value )

Add a constant float property.

Parameters
keyproperty name
valuethe value

◆ publishConstFloatArray()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstFloatArray ( String key,
float[] value )

Add a constant float array property.

Parameters
keyproperty name
valuethe value

◆ publishConstInteger()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstInteger ( String key,
long value )

Add a constant integer property.

Parameters
keyproperty name
valuethe value

◆ publishConstIntegerArray()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstIntegerArray ( String key,
long[] value )

Add a constant integer property.

Parameters
keyproperty name
valuethe value

◆ publishConstRaw()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstRaw ( String key,
String typeString,
byte[] value )

Add a constant raw property.

Parameters
keyproperty name
typeStringtype string
valuethe value

◆ publishConstString()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstString ( String key,
String value )

Add a constant string property.

Parameters
keyproperty name
valuethe value

◆ publishConstStringArray()

void edu.wpi.first.util.sendable.SendableBuilder.publishConstStringArray ( String key,
String[] value )

Add a constant string array property.

Parameters
keyproperty name
valuethe value

◆ setActuator()

void edu.wpi.first.util.sendable.SendableBuilder.setActuator ( boolean value)

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

Parameters
valuetrue if actuator, false if not

◆ setSafeState()

void edu.wpi.first.util.sendable.SendableBuilder.setSafeState ( Runnable func)

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
funcfunction

◆ setSmartDashboardType()

void edu.wpi.first.util.sendable.SendableBuilder.setSmartDashboardType ( String type)

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

Parameters
typedata type

◆ update()

void edu.wpi.first.util.sendable.SendableBuilder.update ( )

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


The documentation for this interface was generated from the following file: