RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.tunable.TunableConfig Class Reference

Classes

enum  Polling

Public Member Functions

 TunableConfig ()
 TunableConfig (Map< String, String > propertiesMap, boolean robust, String typeString, boolean isMutable, Runnable onTune, boolean alwaysGet)
 TunableConfig (Map< String, String > propertiesMap, boolean robust, String typeString, boolean isMutable, Runnable onTune, Polling polling)
TunableConfig withProperty (String key, String value)
TunableConfig withRobust (boolean robust)
TunableConfig withTypeString (String typeString)
TunableConfig withMutable (boolean isMutable)
TunableConfig withOnTune (Runnable onTune)
TunableConfig withAlwaysGet (boolean alwaysGet)
TunableConfig withPolling (Polling polling)
String getProperties ()
boolean isRobust ()
String getTypeString ()
boolean isMutable ()
Runnable getOnTune ()
boolean isAlwaysGet ()
Polling getPolling ()

Static Public Member Functions

static TunableConfig of (TunableOption... options)

Detailed Description

Additional optional configuration for tunables. This class is immutable.

Definition at line 15 of file TunableConfig.java.

Constructor & Destructor Documentation

◆ TunableConfig() [1/3]

org.wpilib.tunable.TunableConfig.TunableConfig ( )

Creates a TunableConfig with default configuration: no properties, robust=false, no type string, isMutable=true, no callback, and polling=DEFAULT.

Definition at line 45 of file TunableConfig.java.

◆ TunableConfig() [2/3]

org.wpilib.tunable.TunableConfig.TunableConfig ( Map< String, String > propertiesMap,
boolean robust,
String typeString,
boolean isMutable,
Runnable onTune,
boolean alwaysGet )

Creates a TunableConfig.

Parameters
propertiesMapproperties
robustrobust flag
typeStringtype string
isMutablemutable flag
onTuneonTune callback; must not throw
alwaysGetalways get flag

Definition at line 64 of file TunableConfig.java.

◆ TunableConfig() [3/3]

org.wpilib.tunable.TunableConfig.TunableConfig ( Map< String, String > propertiesMap,
boolean robust,
String typeString,
boolean isMutable,
Runnable onTune,
Polling polling )

Creates a TunableConfig.

Parameters
propertiesMapproperties
robustrobust flag
typeStringtype string
isMutablemutable flag
onTuneonTune callback; must not throw
pollingpolling behavior

Definition at line 90 of file TunableConfig.java.

Member Function Documentation

◆ getOnTune()

Runnable org.wpilib.tunable.TunableConfig.getOnTune ( )

Returns callback to call when the tunable is modified via tune(). This is called immediately after the tunable's tune() function is called. The callback will be called by TunableRegistry#update() and must not throw.

Returns
the onTune callback

Definition at line 320 of file TunableConfig.java.

◆ getPolling()

Polling org.wpilib.tunable.TunableConfig.getPolling ( )

Returns when the backend should poll the tunable's local value.

Returns
polling behavior

Definition at line 338 of file TunableConfig.java.

◆ getProperties()

String org.wpilib.tunable.TunableConfig.getProperties ( )

Gets properties as a JSON string.

Returns
JSON string

Definition at line 270 of file TunableConfig.java.

◆ getTypeString()

String org.wpilib.tunable.TunableConfig.getTypeString ( )

Returns the custom type string for the tunable.

Returns
the type string, or null if none was set

Definition at line 299 of file TunableConfig.java.

◆ isAlwaysGet()

boolean org.wpilib.tunable.TunableConfig.isAlwaysGet ( )

Returns whether the tunable should always get its value.

Returns
whether the tunable should always get its value

Definition at line 329 of file TunableConfig.java.

◆ isMutable()

boolean org.wpilib.tunable.TunableConfig.isMutable ( )

Returns whether the tunable is mutable. Setting this to false makes the tunable immutable, meaning that the Tunable's set() function will not be called.

Returns
whether the tunable is mutable

Definition at line 309 of file TunableConfig.java.

◆ isRobust()

boolean org.wpilib.tunable.TunableConfig.isRobust ( )

Returns whether the tunable should separately echo back its new value after being set.

Returns
whether the tunable is robust

Definition at line 290 of file TunableConfig.java.

◆ of()

TunableConfig org.wpilib.tunable.TunableConfig.of ( TunableOption... options)
static

Creates a TunableConfig from an array of TunableOption.

Parameters
optionsoptions
Returns
tunable config

Definition at line 128 of file TunableConfig.java.

◆ withAlwaysGet()

TunableConfig org.wpilib.tunable.TunableConfig.withAlwaysGet ( boolean alwaysGet)

Sets the polling behavior to always get or get on change.

Parameters
alwaysGetwhether the tunable should always get its value
Returns
new TunableConfig with the polling behavior set

Definition at line 250 of file TunableConfig.java.

◆ withMutable()

TunableConfig org.wpilib.tunable.TunableConfig.withMutable ( boolean isMutable)

Sets the mutable flag.

Parameters
isMutablewhether the tunable is mutable; setting this to false makes the tunable immutable, meaning that the Tunable's set() function will not be called
Returns
new TunableConfig with the mutable flag set

Definition at line 226 of file TunableConfig.java.

◆ withOnTune()

TunableConfig org.wpilib.tunable.TunableConfig.withOnTune ( Runnable onTune)

Sets the onTune callback.

Parameters
onTunecallback to call when the tunable is modified via tune(); this is called immediately after the tunable's tune() function is called. The callback will be called by TunableRegistry#update(). This callback must not throw.
Returns
new TunableConfig with the onTune callback set

Definition at line 239 of file TunableConfig.java.

◆ withPolling()

TunableConfig org.wpilib.tunable.TunableConfig.withPolling ( Polling polling)

Sets the polling behavior.

Parameters
pollingpolling behavior
Returns
new TunableConfig with the polling behavior set

Definition at line 260 of file TunableConfig.java.

◆ withProperty()

TunableConfig org.wpilib.tunable.TunableConfig.withProperty ( String key,
String value )

Sets a property value.

Parameters
keyproperty key
valueproperty value; must be a valid JSON value string (e.g. quoted string, number, true, false, null, object, or array)
Returns
new TunableConfig with the property set

Definition at line 157 of file TunableConfig.java.

◆ withRobust()

TunableConfig org.wpilib.tunable.TunableConfig.withRobust ( boolean robust)

Sets the robust flag.

Parameters
robustwhether the tunable should separately echo back its value after setting
Returns
new TunableConfig with the robust flag set

Definition at line 203 of file TunableConfig.java.

◆ withTypeString()

TunableConfig org.wpilib.tunable.TunableConfig.withTypeString ( String typeString)

Sets the type string.

Parameters
typeStringthe type string to use for the tunable
Returns
new TunableConfig with the type string set

Definition at line 214 of file TunableConfig.java.


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