Package org.parts3492.partslib.network
Class PARTsNT
java.lang.Object
org.parts3492.partslib.network.PARTsNT
PARTs NetworkTables Easy API.
PARTsNT partsNT = new PARTsNT(this)
This class is meant to be used as an instance for each class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(String name) Gets boolean value from the requested entry.doubleGets the double value from the requested entry.intgetInteger(String name) Gets the integer value from the requested entry.Gets the string value from the requested entry.voidputBoolean(String name, boolean value) Sets the boolean value for the requested entry.voidSets the double value for the requested entry.voidputInteger(String name, int value) Sets the integer value for the requested entry.voidSets the double value for the requested entry.voidSets the integer value for the requested entry.voidputSmartDashboardSendable(String key, edu.wpi.first.util.sendable.Sendable data) Adds a sendable to smart dashboard network table entry.voidSets the string value for the requested entry.voidRemoves all previously created entries.voidremoveEntry(String name) Removes a previously created entry.
-
Field Details
-
name
-
-
Constructor Details
-
PARTsNT
public PARTsNT()Creates a new PARTsNT instance.Creates/uses the subtable "Generic" instead of the class subtable.
The object variation should be used instead.
-
PARTsNT
Creates a new PARTsNT instance.Creates/uses the class subtable.
- Parameters:
o- The class object. (E.g. passing in 'this'.)
-
PARTsNT
Creates a new PARTsNT instance.Creates/uses the subtable of the class via its name.
If the name is empty, then the "Generic" table will be used instead.
- Parameters:
className- The name of the class.
-
-
Method Details
-
getBoolean
Gets boolean value from the requested entry.- Parameters:
name- The topic name.- Returns:
- Returns the boolean value if entry is found, otherwise returns false.
-
putBoolean
Sets the boolean value for the requested entry.- Parameters:
name- The name of the entry.value- The new value to publish to the entry.
-
getInteger
Gets the integer value from the requested entry.- Parameters:
name- The name of the entry.- Returns:
- Returns the value if entry is found, otherwise returns zero.
-
putInteger
Sets the integer value for the requested entry.- Parameters:
name- The name of the entry.value- The new value to publish to the entry.
-
getDouble
Gets the double value from the requested entry.- Parameters:
name- The name of the entry.- Returns:
- Returns the value if entry is found, otherwise returns zero.
-
putDouble
Sets the double value for the requested entry.- Parameters:
name- The name of the entry.value- The new value to publish to the entry.
-
putNumber
Sets the double value for the requested entry.- Parameters:
name- The name of the entry.value- The new value to publish to the entry.
-
putNumber
Sets the integer value for the requested entry.- Parameters:
name- The name of the entry.value- The new value to publish to the entry.
-
getString
Gets the string value from the requested entry.- Parameters:
name- The name of the entry.- Returns:
- Returns the value if entry is found, otherwise returns an empty string.
-
putString
Sets the string value for the requested entry.- Parameters:
name- The name of the entry.value- The new value to publish to the entry.
-
removeAllEntries
public void removeAllEntries()Removes all previously created entries. -
removeEntry
Removes a previously created entry.- Parameters:
name- The name of the entry to remove.
-
putSmartDashboardSendable
Adds a sendable to smart dashboard network table entry.- Parameters:
data- The sendable to add.
-