public class SmartDashboard extends java.lang.Object
SmartDashboard
class is the bridge between robot programs and the SmartDashboard on the
laptop.
When a value is put into the SmartDashboard here, it pops up on the SmartDashboard on the laptop. Users can put values into and get values from the SmartDashboard
Constructor and Description |
---|
SmartDashboard() |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBoolean(java.lang.String key)
Returns the value at the specified key.
|
static boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Returns the value at the specified key.
|
static Sendable |
getData(java.lang.String key)
Returns the value at the specified key.
|
static double |
getDouble(java.lang.String key)
Deprecated.
Use
getNumber instead |
static double |
getDouble(java.lang.String key,
double defaultValue)
Deprecated.
Use
getNumber instead. |
static int |
getInt(java.lang.String key)
Deprecated.
Use
getNumber instead |
static int |
getInt(java.lang.String key,
int defaultValue)
Deprecated.
Use
getNumber instead |
static double |
getNumber(java.lang.String key)
Returns the value at the specified key.
|
static double |
getNumber(java.lang.String key,
double defaultValue)
Returns the value at the specified key.
|
static java.lang.String |
getString(java.lang.String key)
Returns the value at the specified key.
|
static java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Returns the value at the specified key.
|
static void |
putBoolean(java.lang.String key,
boolean value)
Maps the specified key to the specified value in this table.
|
static void |
putData(NamedSendable value)
Maps the specified key (where the key is the name of the
NamedSendable SmartDashboardNamedData
to the specified value in this table. |
static void |
putData(java.lang.String key,
Sendable data)
Maps the specified key to the specified value in this table.
|
static void |
putDouble(java.lang.String key,
double value)
Deprecated.
Use
putNumber instead |
static void |
putInt(java.lang.String key,
int value)
Deprecated.
Use
putNumber method instead |
static void |
putNumber(java.lang.String key,
double value)
Maps the specified key to the specified value in this table.
|
static void |
putString(java.lang.String key,
java.lang.String value)
Maps the specified key to the specified value in this table.
|
public SmartDashboard()
public static void putData(java.lang.String key, Sendable data)
key
- the keydata
- the valuejava.lang.IllegalArgumentException
- if key is nullpublic static void putData(NamedSendable value)
NamedSendable
SmartDashboardNamedData
to the specified value in this table.
The value can be retrieved by calling the get method with a key that is equal to the original key.value
- the valuejava.lang.IllegalArgumentException
- if key is nullpublic static Sendable getData(java.lang.String key)
key
- the keyNetworkTableKeyNotDefined
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the key is nullpublic static void putBoolean(java.lang.String key, boolean value)
key
- the keyvalue
- the valuejava.lang.IllegalArgumentException
- if key is nullpublic static boolean getBoolean(java.lang.String key) throws TableKeyNotDefinedException
key
- the keyNetworkTableKeyNotDefined
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a booleanjava.lang.IllegalArgumentException
- if the key is nullTableKeyNotDefinedException
public static boolean getBoolean(java.lang.String key, boolean defaultValue)
key
- the keydefaultValue
- returned if the key doesn't existjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a booleanjava.lang.IllegalArgumentException
- if the key is nullpublic static void putNumber(java.lang.String key, double value)
key
- the keyvalue
- the valuejava.lang.IllegalArgumentException
- if key is nullpublic static double getNumber(java.lang.String key) throws TableKeyNotDefinedException
key
- the keyTableKeyNotDefinedException
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a doublejava.lang.IllegalArgumentException
- if the key is nullpublic static double getNumber(java.lang.String key, double defaultValue)
key
- the keydefaultValue
- the value returned if the key is undefinedNetworkTableKeyNotDefined
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a doublejava.lang.IllegalArgumentException
- if the key is nullpublic static void putString(java.lang.String key, java.lang.String value)
key
- the keyvalue
- the valuejava.lang.IllegalArgumentException
- if key or value is nullpublic static java.lang.String getString(java.lang.String key) throws TableKeyNotDefinedException
key
- the keyNetworkTableKeyNotDefined
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a stringjava.lang.IllegalArgumentException
- if the key is nullTableKeyNotDefinedException
public static java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
key
- the keydefaultValue
- The value returned if the key is undefinedNetworkTableKeyNotDefined
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a stringjava.lang.IllegalArgumentException
- if the key is nullpublic static void putInt(java.lang.String key, int value)
putNumber method
insteadkey
- the keyvalue
- the valuejava.lang.IllegalArgumentException
- if key is nullpublic static int getInt(java.lang.String key) throws TableKeyNotDefinedException
getNumber
insteadkey
- the keyTableKeyNotDefinedException
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not an intjava.lang.IllegalArgumentException
- if the key is nullpublic static int getInt(java.lang.String key, int defaultValue) throws TableKeyNotDefinedException
getNumber
insteadkey
- the keydefaultValue
- the value returned if the key is undefinedTableKeyNotDefinedException
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not an intjava.lang.IllegalArgumentException
- if the key is nullpublic static void putDouble(java.lang.String key, double value)
putNumber
insteadkey
- the keyvalue
- the valuejava.lang.IllegalArgumentException
- if key is nullpublic static double getDouble(java.lang.String key) throws TableKeyNotDefinedException
getNumber
insteadkey
- the keyTableKeyNotDefinedException
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a doublejava.lang.IllegalArgumentException
- if the key is nullpublic static double getDouble(java.lang.String key, double defaultValue)
getNumber
instead.key
- the keydefaultValue
- the value returned if the key is undefinedTableKeyNotDefinedException
- if there is no value mapped to by the keyjava.lang.IllegalArgumentException
- if the value mapped to by the key is not a doublejava.lang.IllegalArgumentException
- if the key is null