Class Property

java.lang.Object
xbot.common.properties.Property
All Implemented Interfaces:
DataFrameRefreshable
Direct Known Subclasses:
BooleanProperty, DoubleProperty, MeasureProperty, StringProperty

public abstract class Property extends Object implements DataFrameRefreshable
There are many values on the robot that we want to configure on the fly as well as persist once we're happy with the result. We call these Properties. They can be read/written to rapidly using a RandomAccessStore, and know how to save themselves to PermanentStorage when a save is necessary.
  • Field Details

    • AKIT_LOG_NAMESPACE

      public static final String AKIT_LOG_NAMESPACE
      Namespace used for the AdvantageKit log subtable that Property values flow through.

      Every Property records its current value as a LoggableInputs via Logger.processInputs(akitLogPrefix(), inputs) so replay sees the value the robot actually used. The AKit-side mirror is then forwarded to NetworkTables by default — which is redundant, because dashboards already see the value via WPILib's /Preferences/... surface. Routing the Property log entries through this dedicated subtable lets the NT publisher drop them by prefix without touching the on-disk log receiver (which still gets everything, keeping replay correct).

      The name PropertyMirror (rather than just Properties) avoids confusion with the WPILib Preferences table that lives at /Preferences/... in NetworkTables.

      See Also:
    • key

      public final String key
      The key for the property.
    • prefix

      public final String prefix
    • suffix

      public final String suffix
    • level

      public final Property.PropertyLevel level
    • activeStore

      protected ITableProxy activeStore
    • log

      protected org.apache.logging.log4j.Logger log
  • Constructor Details

    • Property

      public Property(String prefix, String suffix, XPropertyManager manager, Property.PropertyLevel level)
      Creates a new property.
      Parameters:
      prefix - The property prefix. This should be unique unless you really know what you're doing.
      suffix - The property suffix. This should be unique unless you really know what you're doing.
      manager - The property manager.
      level - The property level.
    • Property

      public Property(String prefix, String key, XPropertyManager manager)
      Creates a new property.
      Parameters:
      prefix - The property prefix. This should be unique unless you really know what you're doing.
      key - The property key. This should be unique unless you really know what you're doing.
      manager - The property manager.
  • Method Details

    • getLevel

      public Property.PropertyLevel getLevel()
    • akitLogPrefix

      protected String akitLogPrefix()
      Returns:
      The full prefix this Property uses when calling Logger.processInputs(...). Subclasses should pass this to Logger.processInputs so their LogTable entries land under the Properties/ subtable rather than mixing in with subsystem telemetry.
    • isSetToDefault

      public abstract boolean isSetToDefault()
      Checks if the property's current value matches the default.
      Returns:
      True if the current value is the default.