public class SmartDashboard extends 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(String key)
Returns the value at the specified key.
|
static boolean |
getBoolean(String key,
boolean defaultValue)
Returns the value at the specified key.
|
static Sendable |
getData(String key)
Returns the value at the specified key.
|
static double |
getDouble(String key)
Deprecated.
Use
getNumber instead |
static double |
getDouble(String key,
double defaultValue)
Deprecated.
Use
getNumber instead. |
static int |
getInt(String key)
Deprecated.
Use
getNumber instead |
static int |
getInt(String key,
int defaultValue)
Deprecated.
Use
getNumber instead |
static double |
getNumber(String key)
Returns the value at the specified key.
|
static double |
getNumber(String key,
double defaultValue)
Returns the value at the specified key.
|
static String |
getString(String key)
Returns the value at the specified key.
|
static String |
getString(String key,
String defaultValue)
Returns the value at the specified key.
|
static void |
putBoolean(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(String key,
Sendable data)
Maps the specified key to the specified value in this table.
|
static void |
putDouble(String key,
double value)
Deprecated.
Use
putNumber instead |
static void |
putInt(String key,
int value)
Deprecated.
Use
putNumber method instead |
static void |
putNumber(String key,
double value)
Maps the specified key to the specified value in this table.
|
static void |
putString(String key,
String value)
Maps the specified key to the specified value in this table.
|
public static void putData(String key, Sendable data)
key
- the keydata
- the valueIllegalArgumentException
- 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 valueIllegalArgumentException
- if key is nullpublic static Sendable getData(String key)
key
- the keyedu.wpi.first.wpilibj.networktables.NetworkTableKeyNotDefined
- if there is no value mapped to by the keyIllegalArgumentException
- if the key is nullpublic static void putBoolean(String key, boolean value)
key
- the keyvalue
- the valueIllegalArgumentException
- if key is nullpublic static boolean getBoolean(String key) throws edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
key
- the keyedu.wpi.first.wpilibj.networktables.NetworkTableKeyNotDefined
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a booleanIllegalArgumentException
- if the key is nulledu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
public static boolean getBoolean(String key, boolean defaultValue)
key
- the keydefaultValue
- returned if the key doesn't existIllegalArgumentException
- if the value mapped to by the key is not a booleanIllegalArgumentException
- if the key is nullpublic static void putNumber(String key, double value)
key
- the keyvalue
- the valueIllegalArgumentException
- if key is nullpublic static double getNumber(String key) throws edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
key
- the keyedu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a doubleIllegalArgumentException
- if the key is nullpublic static double getNumber(String key, double defaultValue)
key
- the keydefaultValue
- the value returned if the key is undefinededu.wpi.first.wpilibj.networktables.NetworkTableKeyNotDefined
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a doubleIllegalArgumentException
- if the key is nullpublic static void putString(String key, String value)
key
- the keyvalue
- the valueIllegalArgumentException
- if key or value is nullpublic static String getString(String key) throws edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
key
- the keyedu.wpi.first.wpilibj.networktables.NetworkTableKeyNotDefined
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a stringIllegalArgumentException
- if the key is nulledu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
public static String getString(String key, String defaultValue)
key
- the keydefaultValue
- The value returned if the key is undefinededu.wpi.first.wpilibj.networktables.NetworkTableKeyNotDefined
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a stringIllegalArgumentException
- if the key is nullpublic static void putInt(String key, int value)
putNumber method
insteadkey
- the keyvalue
- the valueIllegalArgumentException
- if key is nullpublic static int getInt(String key) throws edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
getNumber
insteadkey
- the keyedu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not an intIllegalArgumentException
- if the key is nullpublic static int getInt(String key, int defaultValue) throws edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
getNumber
insteadkey
- the keydefaultValue
- the value returned if the key is undefinededu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not an intIllegalArgumentException
- if the key is nullpublic static void putDouble(String key, double value)
putNumber
insteadkey
- the keyvalue
- the valueIllegalArgumentException
- if key is nullpublic static double getDouble(String key) throws edu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
getNumber
insteadkey
- the keyedu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a doubleIllegalArgumentException
- if the key is nullpublic static double getDouble(String key, double defaultValue)
getNumber
instead.key
- the keydefaultValue
- the value returned if the key is undefinededu.wpi.first.wpilibj.tables.TableKeyNotDefinedException
- if there is no value mapped to by the keyIllegalArgumentException
- if the value mapped to by the key is not a doubleIllegalArgumentException
- if the key is nullCopyright © 2015. All rights reserved.