Class NetworkTablesTunableBackend

java.lang.Object
org.wpilib.backend.NetworkTablesTunableBackend
All Implemented Interfaces:
AutoCloseable, TunableBackend

public class NetworkTablesTunableBackend extends Object implements TunableBackend
A tunable backend that publishes tunables through NetworkTables.
  • Constructor Details

    • NetworkTablesTunableBackend

      public NetworkTablesTunableBackend(NetworkTableInstance inst, String prefix)
      Construct.
      Parameters:
      inst - NetworkTables instance
      prefix - prefix to put in front of tunable paths in NT
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • publish

      public boolean publish(String path, TunableBase tunable)
      Description copied from interface: TunableBackend
      Publishes a tunable.

      Backend implementations must not throw from this method. Recoverable publication failures should be reported through TunableRegistry.reportWarning(String) and skipped.

      Specified by:
      publish in interface TunableBackend
      Parameters:
      path - normalized path
      tunable - the tunable
      Returns:
      true if the tunable was published, false otherwise
    • publishComplex

      public boolean publishComplex(String path, ComplexTunable tunable)
      Description copied from interface: TunableBackend
      Publishes a complex tunable.

      Backend implementations must not throw from this method. Recoverable publication failures should be reported through TunableRegistry.reportWarning(String) and skipped.

      Specified by:
      publishComplex in interface TunableBackend
      Parameters:
      path - normalized path
      tunable - the tunable
      Returns:
      true if the tunable was published, false otherwise
    • remove

      public void remove(String path)
      Description copied from interface: TunableBackend
      Removes a tunable.

      Backend implementations must not throw from this method.

      Specified by:
      remove in interface TunableBackend
      Parameters:
      path - normalized path
    • removePrefix

      public List<TunableBackend.PublishedTunable> removePrefix(String prefix)
      Description copied from interface: TunableBackend
      Removes all tunables under a prefix.

      Backend implementations must not throw from this method. The returned list must describe the tunables actually removed from the backend.

      Specified by:
      removePrefix in interface TunableBackend
      Parameters:
      prefix - normalized path prefix
      Returns:
      removed tunables
    • markDirty

      public void markDirty(TunableBase tunable)
      Description copied from interface: TunableBackend
      Notifies the backend that a tunable has local changes.

      Backend implementations must not throw from this method.

      Specified by:
      markDirty in interface TunableBackend
      Parameters:
      tunable - the changed tunable
    • update

      public void update()
      Description copied from interface: TunableBackend
      Updates all tunable values and calls callbacks where appropriate.

      Backend implementations must not throw from this method. Recoverable update failures should be reported through TunableRegistry.reportWarning(String) and skipped so the robot loop and registry state can continue updating.

      Specified by:
      update in interface TunableBackend