edu.wpi.first.wpilibj.smartdashboard
Class SmartDashboard

java.lang.Object
  extended by edu.wpi.first.wpilibj.smartdashboard.SmartDashboard

public class SmartDashboard
extends java.lang.Object

The 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

Author:
Joe Grinstead

Constructor Summary
SmartDashboard()
           
 
Method Summary
static java.lang.String diagnoseErrorCode(int code)
          Deprecated.  
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 SmartDashboardData getData(java.lang.String key)
          Returns the value at the specified key.
static double getDouble(java.lang.String key)
          Returns the value at the specified key.
static double getDouble(java.lang.String key, double defaultValue)
          Returns the value at the specified key.
static int getInt(java.lang.String key)
          Returns the value at the specified key.
static int getInt(java.lang.String key, int 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 init()
          Deprecated. no longer necessary
static int log(boolean value, java.lang.String name)
          Deprecated. use putInt(java.lang.String, int) instead
static int log(byte value, java.lang.String name)
          Deprecated. use putInt(java.lang.String, int)
static int log(char value, java.lang.String name)
          Deprecated. use putInt(java.lang.String, int)
static int log(double value, java.lang.String name)
          Deprecated. use putDouble(java.lang.String, double)
static int log(float value, java.lang.String name)
          Deprecated. use putDouble(java.lang.String, double)
static int log(int value, java.lang.String name)
          Deprecated. use putInt(java.lang.String, int)
static int log(long value, java.lang.String name)
          Deprecated. use putInt(java.lang.String, int)
static int log(short value, java.lang.String name)
          Deprecated. use putInt(java.lang.String, int)
static int log(java.lang.String value, java.lang.String name)
          Deprecated. use putString(java.lang.String, java.lang.String)
static void putBoolean(java.lang.String key, boolean value)
          Maps the specified key to the specified value in this table.
static void putData(SmartDashboardNamedData value)
          Maps the specified key (where the key is the name of the SmartDashboardNamedData to the specified value in this table.
static void putData(java.lang.String key, SmartDashboardData value)
          Maps the specified key to the specified value in this table.
static void putDouble(java.lang.String key, double value)
          Maps the specified key to the specified value in this table.
static void putInt(java.lang.String key, int 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.
static void useBlockingIO(boolean value)
          Deprecated.  
static int useProfile(java.lang.String name)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartDashboard

public SmartDashboard()
Method Detail

putData

public static void putData(java.lang.String key,
                           SmartDashboardData value)
Maps the specified key to the specified value in this table. The key can not be null. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
key - the key
value - the value
Throws:
java.lang.IllegalArgumentException - if key is null

putData

public static void putData(SmartDashboardNamedData value)
Maps the specified key (where the key is the name of the 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.

Parameters:
value - the value
Throws:
java.lang.IllegalArgumentException - if key is null

getData

public static SmartDashboardData getData(java.lang.String key)
                                  throws NetworkTableKeyNotDefined
Returns the value at the specified key.

Parameters:
key - the key
Returns:
the value
Throws:
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a SmartDashboardData
java.lang.IllegalArgumentException - if the key is null

putBoolean

public static void putBoolean(java.lang.String key,
                              boolean value)
Maps the specified key to the specified value in this table. The key can not be null. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
key - the key
value - the value
Throws:
java.lang.IllegalArgumentException - if key is null

getBoolean

public static boolean getBoolean(java.lang.String key)
                          throws NetworkTableKeyNotDefined
Returns the value at the specified key.

Parameters:
key - the key
Returns:
the value
Throws:
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a boolean
java.lang.IllegalArgumentException - if the key is null

getBoolean

public static boolean getBoolean(java.lang.String key,
                                 boolean defaultValue)
Returns the value at the specified key.

Parameters:
key - the key
defaultValue - returned if the key doesn't exist
Returns:
the value
Throws:
java.lang.IllegalArgumentException - if the value mapped to by the key is not a boolean
java.lang.IllegalArgumentException - if the key is null

putInt

public static void putInt(java.lang.String key,
                          int value)
Maps the specified key to the specified value in this table. The key can not be null. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
key - the key
value - the value
Throws:
java.lang.IllegalArgumentException - if key is null

getInt

public static int getInt(java.lang.String key)
                  throws NetworkTableKeyNotDefined
Returns the value at the specified key.

Parameters:
key - the key
Returns:
the value
Throws:
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not an int
java.lang.IllegalArgumentException - if the key is null

getInt

public static int getInt(java.lang.String key,
                         int defaultValue)
Returns the value at the specified key.

Parameters:
key - the key
defaultValue - the value returned if the key is undefined
Returns:
the value
Throws:
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not an int
java.lang.IllegalArgumentException - if the key is null

putDouble

public static void putDouble(java.lang.String key,
                             double value)
Maps the specified key to the specified value in this table. The key can not be null. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
key - the key
value - the value
Throws:
java.lang.IllegalArgumentException - if key is null

getDouble

public static double getDouble(java.lang.String key)
                        throws NetworkTableKeyNotDefined
Returns the value at the specified key.

Parameters:
key - the key
Returns:
the value
Throws:
NoSuchEleNetworkTableKeyNotDefinedmentException - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a double
java.lang.IllegalArgumentException - if the key is null
NetworkTableKeyNotDefined

getDouble

public static double getDouble(java.lang.String key,
                               double defaultValue)
Returns the value at the specified key.

Parameters:
key - the key
defaultValue - the value returned if the key is undefined
Returns:
the value
Throws:
NoSuchEleNetworkTableKeyNotDefinedmentException - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a double
java.lang.IllegalArgumentException - if the key is null

putString

public static void putString(java.lang.String key,
                             java.lang.String value)
Maps the specified key to the specified value in this table. Neither the key nor the value can be null. The value can be retrieved by calling the get method with a key that is equal to the original key.

Parameters:
key - the key
value - the value
Throws:
java.lang.IllegalArgumentException - if key or value is null

getString

public static java.lang.String getString(java.lang.String key)
                                  throws NetworkTableKeyNotDefined
Returns the value at the specified key.

Parameters:
key - the key
Returns:
the value
Throws:
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a string
java.lang.IllegalArgumentException - if the key is null

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.String defaultValue)
Returns the value at the specified key.

Parameters:
key - the key
defaultValue - The value returned if the key is undefined
Returns:
the value
Throws:
NetworkTableKeyNotDefined - if there is no value mapped to by the key
java.lang.IllegalArgumentException - if the value mapped to by the key is not a string
java.lang.IllegalArgumentException - if the key is null

init

public static void init()
Deprecated. no longer necessary

Initializes the SmartDashboard by injecting it into the DriverStation class such that it is polled for data instead of the default Dashboard instance. This must be called before using any static method of SmartDashboard for the data to be sent across the network.


log

public static int log(byte value,
                      java.lang.String name)
Deprecated. use putInt(java.lang.String, int)

Send the given byte value to the client as the field with the given name.

Parameters:
value - The value to be displayed on the client.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(char value,
                      java.lang.String name)
Deprecated. use putInt(java.lang.String, int)

Send the given UTF-16 char value to the client as the field with the given name.

Parameters:
value - The value to be displayed on the client.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(int value,
                      java.lang.String name)
Deprecated. use putInt(java.lang.String, int)

Sends the given int value to the client as the field with the given name.

Parameters:
value - The value to send.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(long value,
                      java.lang.String name)
Deprecated. use putInt(java.lang.String, int)

Sends the given long value to the client as the field with the given name.

Parameters:
value - The value to send.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(short value,
                      java.lang.String name)
Deprecated. use putInt(java.lang.String, int)

Sends the given short value to the client as the field with the given name.

Parameters:
value - The value to send.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(float value,
                      java.lang.String name)
Deprecated. use putDouble(java.lang.String, double)

Sends the given float value to the client as the field with the given name.

Parameters:
value - The value to send.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(double value,
                      java.lang.String name)
Deprecated. use putDouble(java.lang.String, double)

Sends the given double value to the client as the field with the given name.

Parameters:
value - The value to send.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(java.lang.String value,
                      java.lang.String name)
Deprecated. use putString(java.lang.String, java.lang.String)

Sends the given String value to the client as the field with the given name.

Parameters:
value - The value to send. This may be at most 63 characters in length.
name - The name of the field.
Returns:
An integer status code.

log

public static int log(boolean value,
                      java.lang.String name)
Deprecated. use putInt(java.lang.String, int) instead

Sends the given boolean value to the client as the field with the given name.

Parameters:
value - The value to send.
name - The name of the field.
Returns:
An integer status code.

useProfile

public static int useProfile(java.lang.String name)
Deprecated. 

Does Nothing. This has no equivalent in the new SmartDashboard.


diagnoseErrorCode

public static java.lang.String diagnoseErrorCode(int code)
Deprecated. 

Does nothing. There is no equivalent in the new SmartDashboard


useBlockingIO

public static void useBlockingIO(boolean value)
Deprecated. 

Does nothing. There is no equivalent in the new SmartDashboard