|
RobotCore 1.0
WPILib port to raspberry Pi
|
Classes | |
| interface | TypeHandler |
Static Public Member Functions | |
| static void | setReportWarning (Consumer< String > func) |
| static Consumer< String > | getReportWarning () |
| static void | reportWarning (String msg) |
| static< T > void | registerTypeHandler (Class< T > cls, TypeHandler< T > handler) |
| static void | registerBackend (String prefix, TunableBackend backend) |
| static< T > TypeHandler< T > | getTypeHandler (T value) |
| static TunableBackend | getBackend (String path) |
| static long | getTuneRevision (TunableBase tunable) |
| static long | getTuneRevision (ComplexTunable tunable) |
| static void | recordTuneApplied (TunableBase tunable) |
| static void | resetChangedAfterUpdate (TunableBase tunable) |
| static void | runAfterUpdate (Runnable callback) |
| static void | updateComplexIfNeeded (ComplexTunable tunable) |
| static TunableTable | getTable (String path) |
| static void | publishComplexChildren (String path, ComplexTunable tunable) |
| static boolean | publish (String path, TunableBase tunable) |
| static boolean | publish (String path, ComplexTunable tunable) |
| static void | remove (String path) |
| static void | remove (ComplexTunable tunable) |
| static void | update () |
| static void | withUpdateMutex (Runnable func) |
| static void | reset () |
Global registry for tunable handlers and tunable backends.
Definition at line 26 of file TunableRegistry.java.
|
static |
Gets the backend for creating a tunable. Should generally only be used internally or by custom backends.
| path | full name |
Definition at line 429 of file TunableRegistry.java.
|
static |
Get function used for reporting warning messages.
Definition at line 239 of file TunableRegistry.java.
|
static |
Get a tunable table for a particular name.
| path | full name |
Definition at line 616 of file TunableRegistry.java.
|
static |
Returns a complex tunable's current tuning revision token.
This is the same token returned for the underlying registry record, and it also advances when a backend successfully applies tuning input to a descendant child tunable.
| tunable | complex tunable |
Definition at line 509 of file TunableRegistry.java.
|
static |
Returns a tunable's current tuning revision token.
The token starts at zero and changes once for each tuning input that a backend successfully applies to this tunable or one of its descendant tunables. Direct local set() calls, in-place mutations, and getter refreshes do not change it. Reading the token does not consume or reset it, so independent observers can each store a previous token and compare it to the current value with !=.
Treat this as a 64-bit equality token. Do not rely on ordering or sign. This getter follows the same threading model as the rest of the tunable API and does not make tunable access thread-safe.
| tunable | tunable |
Definition at line 494 of file TunableRegistry.java.
|
static |
Gets the handler for logging an object. Should generally only be used by Tunable.
| <T> | class |
| value | value |
Definition at line 409 of file TunableRegistry.java.
|
static |
Publishes a complex tunable.
| path | normalized path |
| tunable | the tunable |
Definition at line 672 of file TunableRegistry.java.
|
static |
Publishes a tunable.
| path | normalized path |
| tunable | the tunable |
Definition at line 640 of file TunableRegistry.java.
|
static |
Publishes a complex tunable's children.
This should generally only be used by TunableBackend implementations after they publish the complex parent entry.
| path | normalized path |
| tunable | the tunable |
Definition at line 629 of file TunableRegistry.java.
|
static |
Records that a backend successfully applied one tuning input to a tunable.
TunableBackend implementations should call this exactly once after each accepted remote tuning input has been applied to the tunable value, before scheduling any corresponding onTune callback. Rejected inputs and writes ignored due to immutability should not call this method.
| tunable | tuned tunable |
Definition at line 525 of file TunableRegistry.java.
|
static |
Registers a backend for creating tunables. When calling getBackend(), the longest prefix match is used.
| prefix | prefix for tunables covered by this backend |
| backend | backend |
Definition at line 299 of file TunableRegistry.java.
|
static |
Registers a handler for tuning objects of a particular type. The handler should populate the provided TunableTable name as appropriate for the object's data.
| <T> | class |
| cls | class object |
| handler | handler (accepts TunableTable, entry name, and object) |
Definition at line 264 of file TunableRegistry.java.
|
static |
Removes every tracked publication for a complex tunable.
| tunable | complex tunable to remove |
Definition at line 781 of file TunableRegistry.java.
|
static |
Removes a tunable.
| path | normalized path |
Definition at line 763 of file TunableRegistry.java.
|
static |
Report a warning message (e.g. type mismatch).
| msg | warning message |
Definition at line 250 of file TunableRegistry.java.
|
static |
Clear all registered types and backends and closes all entries. Should typically only be used by unit test code.
Definition at line 821 of file TunableRegistry.java.
|
static |
Resets a tunable's changed flag after the current update cycle finishes.
Backends should call this after publishing a changed tunable so every alias in every backend can observe the shared changed flag before it is cleared.
| tunable | tunable to reset |
Definition at line 539 of file TunableRegistry.java.
|
static |
Runs a callback after the current update cycle finishes resetting changed flags.
Backends should use this for callbacks that react to tuned values so callback mutations are observed as new changes in the next update cycle.
| callback | callback to run; must not throw |
Definition at line 557 of file TunableRegistry.java.
|
static |
Set function used for reporting warning messages (e.g. type mismatches).
The reporting function must not throw.
| func | reporting function; pass null to use default |
Definition at line 224 of file TunableRegistry.java.
|
static |
Updates all tunable values from backends.
Definition at line 788 of file TunableRegistry.java.
|
static |
Updates a complex tunable if it has not already been updated during the current registry update.
This should generally only be used by TunableBackend implementations.
| tunable | tunable to update |
Definition at line 575 of file TunableRegistry.java.
|
static |
Execute a function while holding the same mutex used for update(). As tunables are not thread-safe, this is designed to allow external synchronization for tunables used in secondary threads outside of the robot main loop.
Every competing access, including main-loop access, must use this method or another safe handoff. The update mutex is held while backends and user callbacks run, so the function should be short and must not allow a mutable tunable value to escape and be accessed after the function completes.
| func | function to execute |
Definition at line 810 of file TunableRegistry.java.