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

Public Member Functions

record Robust (boolean value) implements TunableOption
record Property (String key, String value) implements TunableOption
record TypeString (String typeString) implements TunableOption
record Mutable (boolean isMutable) implements TunableOption
record OnTune (Runnable callback) implements TunableOption
record Polling (TunableConfig.Polling polling) implements TunableOption

Static Public Member Functions

static TunableOption property (String key, String value)
static TunableOption typeString (String typeString)
static TunableOption onTune (Runnable callback)
static TunableOption polling (TunableConfig.Polling polling)

Public Attributes

TunableOption ROBUST = new Robust(true)
TunableOption NOT_ROBUST = new Robust(false)
TunableOption MUTABLE = new Mutable(true)
TunableOption IMMUTABLE = new Mutable(false)
TunableOption GET_ON_CHANGE = new Polling(TunableConfig.Polling.GET_ON_CHANGE)
TunableOption ALWAYS_GET = new Polling(TunableConfig.Polling.ALWAYS_GET)

Detailed Description

Tunable option.

Definition at line 10 of file TunableOption.java.

Member Function Documentation

◆ Mutable()

record org.wpilib.tunable.TunableOption.Mutable ( boolean isMutable)

By default, Tunables may be set by a remote source (e.g. a dashboard). Setting mutability to false makes the tunable immutable, meaning that the Tunable's set() function will not be called. This is useful for tunables that should only be changed locally, such as ones that represent a constant or a tunable that is only meant to be changed programmatically.

Parameters
isMutablewhether the tunable is mutable

Definition at line 42 of file TunableOption.java.

◆ OnTune()

record org.wpilib.tunable.TunableOption.OnTune ( Runnable callback)

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.

Parameters
callbackthe callback to call when the tunable is modified

Definition at line 51 of file TunableOption.java.

◆ onTune()

TunableOption org.wpilib.tunable.TunableOption.onTune ( Runnable callback)
static

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.

Parameters
callbackthe callback to call when the tunable is modified via tune()
Returns
tunable option

Definition at line 121 of file TunableOption.java.

◆ Polling()

record org.wpilib.tunable.TunableOption.Polling ( TunableConfig.Polling polling)

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

Parameters
pollingpolling behavior

Creates a polling option.

Parameters
pollingpolling behavior

Definition at line 58 of file TunableOption.java.

◆ polling()

TunableOption org.wpilib.tunable.TunableOption.polling ( TunableConfig.Polling polling)
static

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

Parameters
pollingpolling behavior
Returns
tunable option

Definition at line 131 of file TunableOption.java.

◆ Property()

record org.wpilib.tunable.TunableOption.Property ( String key,
String value )

Property for tunable.

Parameters
keyproperty key
valueproperty value; must be a valid JSON value string (e.g. quoted string, number, true, false, null, object, or array)

Definition at line 25 of file TunableOption.java.

◆ property()

TunableOption org.wpilib.tunable.TunableOption.property ( String key,
String value )
static

Property for tunable.

Parameters
keyproperty key
valueproperty value; must be a valid JSON value string (e.g. quoted string, number, true, false, null, object, or array)
Returns
tunable option

Definition at line 99 of file TunableOption.java.

◆ Robust()

record org.wpilib.tunable.TunableOption.Robust ( boolean value)

Indicates whether the tunable should separately echo back its value after setting.

Parameters
valuewhether the tunable should echo back its value

Definition at line 16 of file TunableOption.java.

◆ TypeString()

record org.wpilib.tunable.TunableOption.TypeString ( String typeString)

Type string for tunable.

Parameters
typeStringthe type string

Definition at line 32 of file TunableOption.java.

◆ typeString()

TunableOption org.wpilib.tunable.TunableOption.typeString ( String typeString)
static

Type string for tunable.

Parameters
typeStringthe type string to use for the tunable
Returns
tunable option

Definition at line 109 of file TunableOption.java.

Member Data Documentation

◆ ALWAYS_GET

TunableOption org.wpilib.tunable.TunableOption.ALWAYS_GET = new Polling(TunableConfig.Polling.ALWAYS_GET)

Indicates the tunable should get its value on every loop.

Definition at line 89 of file TunableOption.java.

◆ GET_ON_CHANGE

TunableOption org.wpilib.tunable.TunableOption.GET_ON_CHANGE = new Polling(TunableConfig.Polling.GET_ON_CHANGE)

Indicates the tunable should get its value only when it is changed.

Definition at line 86 of file TunableOption.java.

◆ IMMUTABLE

TunableOption org.wpilib.tunable.TunableOption.IMMUTABLE = new Mutable(false)

Indicates the tunable is immutable. Immutable tunables never call the Tunable's set() function.

Definition at line 83 of file TunableOption.java.

◆ MUTABLE

TunableOption org.wpilib.tunable.TunableOption.MUTABLE = new Mutable(true)

Indicates the tunable is mutable (default). Mutable tunables call the Tunable's set() function.

Definition at line 78 of file TunableOption.java.

◆ NOT_ROBUST

TunableOption org.wpilib.tunable.TunableOption.NOT_ROBUST = new Robust(false)

Indicates the tunable should not separately echo back its value after setting (default).

Definition at line 73 of file TunableOption.java.

◆ ROBUST

TunableOption org.wpilib.tunable.TunableOption.ROBUST = new Robust(true)

Indicates the tunable should separately echo back its value after setting.

Definition at line 70 of file TunableOption.java.


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