Package frc.robot.utils
Class NetworkTableUtils
java.lang.Object
frc.robot.utils.NetworkTableUtils
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkTableUtils
(String table) This class is a utility class for interfacing with network tables -
Method Summary
Modifier and TypeMethodDescriptiondouble
This function gets a value from network tables as a doubledouble[]
getDoubleArray
(String key, double[] doubles) This function gets a value from Network Tables as a double arrayThis function returns a entry as whatever it isThis function gets a value from network tables as a Stringedu.wpi.first.networktables.NetworkTable
getTable()
This function returns the table of this instance of NetworkTableUtilsvoid
This function sets a double in network tablesvoid
setDoubleArray
(String key, double[] value) void
Sets a entry in Network Tables to a valuevoid
This function sets a String in network tables
-
Constructor Details
-
NetworkTableUtils
This class is a utility class for interfacing with network tables- Parameters:
table
- The string ID for a network table
-
-
Method Details
-
getTable
public edu.wpi.first.networktables.NetworkTable getTable()This function returns the table of this instance of NetworkTableUtils- Returns:
- Returns the table as a NetworkTable
-
getDouble
This function gets a value from network tables as a double- Parameters:
key
- The key in Network Tables for the valuedefaultValue
- If the entry is not found or null we will return this- Returns:
- Returns the Network Table entry as a double
-
getString
This function gets a value from network tables as a String- Parameters:
key
- The key in Network Tables for the valuedefaultValue
- If the entry is not found or null we will return this- Returns:
- Returns the Network Table entry as a String
-
getDoubleArray
This function gets a value from Network Tables as a double array- Parameters:
key
- The key in Network Tables for the valuedoubles
- If the entry is not found or null we will return this- Returns:
- Returns the Network Table entry as a double array (double[])
-
setDoubleArray
-
setDouble
This function sets a double in network tables- Parameters:
key
- The key in Network Tables for the valuevalue
- What we are setting the entry to
-
setString
This function sets a String in network tables- Parameters:
key
- The key in Network Tables for the valuevalue
- What we are setting the entry to
-
getEntry
This function returns a entry as whatever it is- Parameters:
key
- The key in Network Tables for the valuedefaultValue
- We will return this is the entry is invalid- Returns:
- Returns the entry as whatever it is
-
setEntry
Sets a entry in Network Tables to a value- Parameters:
key
- The key in Network Tables for the valuevalue
- The value we are setting the entry to.
-