Package edu.wpi.first.util.sendable
Interface SendableBuilder
- All Superinterfaces:
- AutoCloseable
- All Known Subinterfaces:
- NTSendableBuilder
- All Known Implementing Classes:
- LogBackedSendableBuilder,- SendableBuilderImpl
Helper class for building Sendable dashboard representations.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumThe backend kinds used for the sendable builder.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBooleanArrayProperty(String key, Supplier<boolean[]> getter, Consumer<boolean[]> setter) Add a boolean array property.voidaddBooleanProperty(String key, BooleanSupplier getter, BooleanConsumer setter) Add a boolean property.voidaddCloseable(AutoCloseable closeable) Adds a closeable.voidaddDoubleArrayProperty(String key, Supplier<double[]> getter, Consumer<double[]> setter) Add a double array property.voidaddDoubleProperty(String key, DoubleSupplier getter, DoubleConsumer setter) Add a double property.voidaddFloatArrayProperty(String key, Supplier<float[]> getter, Consumer<float[]> setter) Add a float array property.voidaddFloatProperty(String key, FloatSupplier getter, FloatConsumer setter) Add a float property.voidaddIntegerArrayProperty(String key, Supplier<long[]> getter, Consumer<long[]> setter) Add an integer array property.voidaddIntegerProperty(String key, LongSupplier getter, LongConsumer setter) Add an integer property.voidaddRawProperty(String key, String typeString, Supplier<byte[]> getter, Consumer<byte[]> setter) Add a raw property.voidAdd a string array property.voidAdd a string property.voidClear properties.Gets the kind of backend being used.booleanReturn whether this sendable has been published.voidpublishConstBoolean(String key, boolean value) Add a constant boolean property.voidpublishConstBooleanArray(String key, boolean[] value) Add a constant boolean array property.voidpublishConstDouble(String key, double value) Add a constant double property.voidpublishConstDoubleArray(String key, double[] value) Add a constant double array property.voidpublishConstFloat(String key, float value) Add a constant float property.voidpublishConstFloatArray(String key, float[] value) Add a constant float array property.voidpublishConstInteger(String key, long value) Add a constant integer property.voidpublishConstIntegerArray(String key, long[] value) Add a constant integer property.voidpublishConstRaw(String key, String typeString, byte[] value) Add a constant raw property.voidpublishConstString(String key, String value) Add a constant string property.voidpublishConstStringArray(String key, String[] value) Add a constant string array property.voidsetActuator(boolean value) Set a flag indicating if this Sendable should be treated as an actuator.voidsetSafeState(Runnable func) Set the function that should be called to set the Sendable into a safe state.voidsetSmartDashboardType(String type) Set the string representation of the named data type that will be used by the smart dashboard for this sendable.voidupdate()Update the published values by calling the getters for all properties.Methods inherited from interface java.lang.AutoCloseableclose
- 
Method Details- 
setSmartDashboardTypeSet the string representation of the named data type that will be used by the smart dashboard for this sendable.- Parameters:
- type- data type
 
- 
setActuatorSet 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
 
- 
setSafeStateSet 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
 
- 
addBooleanPropertyAdd a boolean property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstBooleanAdd a constant boolean property.- Parameters:
- key- property name
- value- the value
 
- 
addIntegerPropertyAdd an integer property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstIntegerAdd a constant integer property.- Parameters:
- key- property name
- value- the value
 
- 
addFloatPropertyAdd a float property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstFloatAdd a constant float property.- Parameters:
- key- property name
- value- the value
 
- 
addDoublePropertyAdd a double property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstDoubleAdd a constant double property.- Parameters:
- key- property name
- value- the value
 
- 
addStringPropertyAdd a string property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstStringAdd a constant string property.- Parameters:
- key- property name
- value- the value
 
- 
addBooleanArrayPropertyAdd a boolean array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstBooleanArrayAdd a constant boolean array property.- Parameters:
- key- property name
- value- the value
 
- 
addIntegerArrayPropertyAdd an integer array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstIntegerArrayAdd a constant integer property.- Parameters:
- key- property name
- value- the value
 
- 
addFloatArrayPropertyAdd a float array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstFloatArrayAdd a constant float array property.- Parameters:
- key- property name
- value- the value
 
- 
addDoubleArrayPropertyAdd a double array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstDoubleArrayAdd a constant double array property.- Parameters:
- key- property name
- value- the value
 
- 
addStringArrayPropertyAdd a string array property.- Parameters:
- key- property name
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstStringArrayAdd a constant string array property.- Parameters:
- key- property name
- value- the value
 
- 
addRawPropertyvoid addRawProperty(String key, String typeString, Supplier<byte[]> getter, Consumer<byte[]> setter) Add a raw property.- Parameters:
- key- property name
- typeString- type string
- getter- getter function (returns current value)
- setter- setter function (sets new value)
 
- 
publishConstRawAdd a constant raw property.- Parameters:
- key- property name
- typeString- type string
- value- the value
 
- 
getBackendKindGets the kind of backend being used.- Returns:
- Backend kind
 
- 
isPublishedboolean isPublished()Return whether this sendable has been published.- Returns:
- True if it has been published, false if not.
 
- 
updatevoid update()Update the published values by calling the getters for all properties.
- 
clearPropertiesvoid clearProperties()Clear properties.
- 
addCloseableAdds a closeable. The closeable.close() will be called when close() is called.- Parameters:
- closeable- closeable object
 
 
-