Package xbot.common.properties
Class Property
java.lang.Object
xbot.common.properties.Property
- All Implemented Interfaces:
DataFrameRefreshable
- Direct Known Subclasses:
BooleanProperty,DoubleProperty,MeasureProperty,StringProperty
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumEnum to determine property persistence Ephemeral properties will not be saved or loaded from a persistent storage. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ITableProxystatic final StringNamespace used for the AdvantageKit log subtable that Property values flow through.final StringThe key for the property.final Property.PropertyLevelprotected org.apache.logging.log4j.Loggerfinal Stringfinal String -
Constructor Summary
ConstructorsConstructorDescriptionProperty(String prefix, String key, XPropertyManager manager) Creates a new property.Property(String prefix, String suffix, XPropertyManager manager, Property.PropertyLevel level) Creates a new property. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface xbot.common.advantage.DataFrameRefreshable
refreshDataFrame
-
Field Details
-
AKIT_LOG_NAMESPACE
Namespace used for the AdvantageKit log subtable that Property values flow through.Every Property records its current value as a
LoggableInputsviaLogger.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 justProperties) avoids confusion with the WPILibPreferencestable that lives at/Preferences/...in NetworkTables.- See Also:
-
key
The key for the property. -
prefix
-
suffix
-
level
-
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
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
-
akitLogPrefix
- Returns:
- The full prefix this Property uses when calling
Logger.processInputs(...). Subclasses should pass this toLogger.processInputsso their LogTable entries land under theProperties/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.
-