Class TunableTable

java.lang.Object
org.team1126.lib.tunable.TunableTable

public final class TunableTable extends Object
A TunableTable represents a nested table of tunable values in the NetworkTables tree.
  • Method Details

    • getNested

      public TunableTable getNested(String name)
      Gets a table that can be used to add nested tunable values under a specified path.
      Parameters:
      name - The name of the table. Must be unique.
    • add

      public <T> T add(String name, T obj)
      Adds an object to be tuned. The specified object must implement Tunables.Tunable, or have a registered Tunables.TunableHandler in order for it to be added.
      Type Parameters:
      T - The object's class.
      Parameters:
      name - The name for the tunable. Must be unique.
      obj - The object to be tuned.
      Returns:
      The provided object.
    • value

      public Tunables.TunableBoolean value(String name, boolean defaultValue)
      Adds a tunable boolean value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
    • value

      public Tunables.TunableBoolean value(String name, boolean defaultValue, edu.wpi.first.util.function.BooleanConsumer onChange)
      Adds a tunable boolean value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
      onChange - A consumer that is invoked when the value of the tunable is modified.
    • value

      public Tunables.TunableInteger value(String name, int defaultValue)
      Adds a tunable integer value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
    • value

      public Tunables.TunableInteger value(String name, int defaultValue, IntConsumer onChange)
      Adds a tunable integer value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
      onChange - A consumer that is invoked when the value of the tunable is modified.
    • value

      public Tunables.TunableFloat value(String name, float defaultValue)
      Adds a tunable float value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
    • value

      public Tunables.TunableFloat value(String name, float defaultValue, edu.wpi.first.util.function.FloatConsumer onChange)
      Adds a tunable float value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
      onChange - A consumer that is invoked when the value of the tunable is modified.
    • value

      public Tunables.TunableDouble value(String name, double defaultValue)
      Adds a tunable double value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
    • value

      public Tunables.TunableDouble value(String name, double defaultValue, DoubleConsumer onChange)
      Adds a tunable double value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
      onChange - A consumer that is invoked when the value of the tunable is modified.
    • value

      public Tunables.TunableString value(String name, String defaultValue)
      Adds a tunable string value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
    • value

      public Tunables.TunableString value(String name, String defaultValue, Consumer<String> onChange)
      Adds a tunable string value to the table.
      Parameters:
      name - The name for the tunable value. Must be unique.
      defaultValue - The default value of the tunable (e.g. a programmed constant).
      onChange - A consumer that is invoked when the value of the tunable is modified.