Class LoggedNetworkString
java.lang.Object
org.littletonrobotics.junction.networktables.LoggedNetworkInput
org.littletonrobotics.junction.networktables.LoggedNetworkString
Manages a String value published to the root table of NT.
-
Field Summary
Fields inherited from class org.littletonrobotics.junction.networktables.LoggedNetworkInput
prefix -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LoggedNetworkString, for handling a string input sent via NetworkTables.LoggedNetworkString(String key, String defaultValue) Creates a new LoggedNetworkString, for handling a string input sent via NetworkTables. -
Method Summary
Methods inherited from class org.littletonrobotics.junction.networktables.LoggedNetworkInput
removeSlash
-
Constructor Details
-
LoggedNetworkString
Creates a new LoggedNetworkString, for handling a string input sent via NetworkTables.- Parameters:
key- The key for the number, published to the root table of NT or "/DashboardInputs/{key}" when logged.
-
LoggedNetworkString
Creates a new LoggedNetworkString, for handling a string input sent via NetworkTables.- Parameters:
key- The key for the number, published to the root table of NT or "/DashboardInputs/{key}" when logged.defaultValue- The default value if no value in NT is found.
-
-
Method Details
-
setDefault
Updates the default value, which is used if no value in NT is found.- Parameters:
defaultValue- The new default value.
-
set
Publishes a new value. Note that the value will not be returned byget()until the next cycle.- Parameters:
value- The new value.
-
get
Returns the current value. -
periodic
public void periodic()Description copied from class:LoggedNetworkInputUpdate the current value and save/replay the input. This function should never be called by user code.- Specified by:
periodicin classLoggedNetworkInput
-