Class TunableTable
java.lang.Object
org.wpilib.tunable.TunableTable
Tunables are used to allow values in the robot program to be changed from dashboards or debug
tools.
Getter/setter-backed publish methods take getters and setters that must not throw.
For more advanced use cases, use NetworkTables directly.
-
Method Summary
Modifier and TypeMethodDescriptiongetPath()Gets the table path.Gets a child tunable table.booleanpublish(String name, ComplexTunable tunable) Publishes a complex tunable.booleanpublish(String name, TunableBase tunable) Publishes a tunable.publishBoolean(String name, BooleanSupplier getter, BooleanConsumer setter) Publishes a tunable boolean value using a getter and setter.publishBoolean(String name, BooleanSupplier getter, BooleanConsumer setter, TunableConfig config) Publishes a tunable boolean value using a getter and setter.publishDouble(String name, DoubleSupplier getter, DoubleConsumer setter) Publishes a tunable double value using a getter and setter.publishDouble(String name, DoubleSupplier getter, DoubleConsumer setter, TunableConfig config) Publishes a tunable double value using a getter and setter.publishFloat(String name, FloatSupplier getter, FloatConsumer setter) Publishes a tunable float value using a getter and setter.publishFloat(String name, FloatSupplier getter, FloatConsumer setter, TunableConfig config) Publishes a tunable float value using a getter and setter.publishInt(String name, IntSupplier getter, IntConsumer setter) Publishes a tunable integer value using a getter and setter.publishInt(String name, IntSupplier getter, IntConsumer setter, TunableConfig config) Publishes a tunable integer value using a getter and setter.publishLong(String name, LongSupplier getter, LongConsumer setter) Publishes a tunable long value using a getter and setter.publishLong(String name, LongSupplier getter, LongConsumer setter, TunableConfig config) Publishes a tunable long value using a getter and setter.<T> Tunable<T> publishValue(String name, Supplier<T> getter, Consumer<T> setter, Class<T> cls) Publishes a tunable value using a getter and setter.<T> Tunable<T> publishValue(String name, Supplier<T> getter, Consumer<T> setter, Class<T> cls, TunableConfig config) Publishes a tunable value using a getter and setter.voidRemoves a tunable.
-
Method Details
-
getPath
-
getTable
Gets a child tunable table.- Parameters:
name- table name- Returns:
- table
-
publish
Publishes a tunable.- Parameters:
name- the nametunable- the tunable- Returns:
- true if the backend accepted the tunable
-
publish
Publishes a complex tunable.- Parameters:
name- the nametunable- the tunable- Returns:
- true if the backend accepted the tunable
-
publishValue
public <T> Tunable<T> publishValue(String name, Supplier<T> getter, Consumer<T> setter, Class<T> cls) Publishes a tunable value using a getter and setter.- Type Parameters:
T- value type- Parameters:
name- the namegetter- the gettersetter- the settercls- the class of the value- Returns:
- the tunable
-
publishValue
public <T> Tunable<T> publishValue(String name, Supplier<T> getter, Consumer<T> setter, Class<T> cls, TunableConfig config) Publishes a tunable value using a getter and setter.- Type Parameters:
T- value type- Parameters:
name- the namegetter- the gettersetter- the settercls- the class of the valueconfig- tunable config- Returns:
- the tunable
-
publishBoolean
Publishes a tunable boolean value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setter- Returns:
- the tunable
-
publishBoolean
public TunableBoolean publishBoolean(String name, BooleanSupplier getter, BooleanConsumer setter, TunableConfig config) Publishes a tunable boolean value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setterconfig- tunable config- Returns:
- the tunable
-
publishInt
Publishes a tunable integer value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setter- Returns:
- the tunable
-
publishInt
public TunableInt publishInt(String name, IntSupplier getter, IntConsumer setter, TunableConfig config) Publishes a tunable integer value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setterconfig- tunable config- Returns:
- the tunable
-
publishLong
Publishes a tunable long value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setter- Returns:
- the tunable
-
publishLong
public TunableLong publishLong(String name, LongSupplier getter, LongConsumer setter, TunableConfig config) Publishes a tunable long value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setterconfig- tunable config- Returns:
- the tunable
-
publishFloat
Publishes a tunable float value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setter- Returns:
- the tunable
-
publishFloat
public TunableFloat publishFloat(String name, FloatSupplier getter, FloatConsumer setter, TunableConfig config) Publishes a tunable float value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setterconfig- tunable config- Returns:
- the tunable
-
publishDouble
Publishes a tunable double value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setter- Returns:
- the tunable
-
publishDouble
public TunableDouble publishDouble(String name, DoubleSupplier getter, DoubleConsumer setter, TunableConfig config) Publishes a tunable double value using a getter and setter.- Parameters:
name- the namegetter- the gettersetter- the setterconfig- tunable config- Returns:
- the tunable
-
remove
-