WPILibC++  unspecified
frc::SmartDashboard Class Reference
Inheritance diagram for frc::SmartDashboard:
Collaboration diagram for frc::SmartDashboard:

Static Public Member Functions

static void init ()
 
static bool ContainsKey (llvm::StringRef key)
 Determines whether the given key is in this table. More...
 
static std::vector< std::string > GetKeys (int types=0)
 
static void SetPersistent (llvm::StringRef key)
 Makes a key's value persistent through program restarts. More...
 
static void ClearPersistent (llvm::StringRef key)
 Stop making a key's value persistent through program restarts. More...
 
static bool IsPersistent (llvm::StringRef key)
 Returns whether the value is persistent through program restarts. More...
 
static void SetFlags (llvm::StringRef key, unsigned int flags)
 Sets flags on the specified key in this table. More...
 
static void ClearFlags (llvm::StringRef key, unsigned int flags)
 Clears flags on the specified key in this table. More...
 
static unsigned int GetFlags (llvm::StringRef key)
 Returns the flags for the specified key. More...
 
static void Delete (llvm::StringRef key)
 Deletes the specified key in this table. More...
 
static void PutData (llvm::StringRef key, Sendable *data)
 Maps the specified key to the specified value in this table. More...
 
static void PutData (NamedSendable *value)
 Maps the specified key (where the key is the name of the SmartDashboardNamedData to the specified value in this table. More...
 
static SendableGetData (llvm::StringRef keyName)
 Returns the value at the specified key. More...
 
static bool PutBoolean (llvm::StringRef keyName, bool value)
 Maps the specified key to the specified value in this table. More...
 
static bool SetDefaultBoolean (llvm::StringRef key, bool defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static bool GetBoolean (llvm::StringRef keyName, bool defaultValue)
 Returns the value at the specified key. More...
 
static bool PutNumber (llvm::StringRef keyName, double value)
 Maps the specified key to the specified value in this table. More...
 
static bool SetDefaultNumber (llvm::StringRef key, double defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static double GetNumber (llvm::StringRef keyName, double defaultValue)
 Returns the value at the specified key. More...
 
static bool PutString (llvm::StringRef keyName, llvm::StringRef value)
 Maps the specified key to the specified value in this table. More...
 
static bool SetDefaultString (llvm::StringRef key, llvm::StringRef defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static std::string GetString (llvm::StringRef keyName, llvm::StringRef defaultValue)
 Returns the value at the specified key. More...
 
static bool PutBooleanArray (llvm::StringRef key, llvm::ArrayRef< int > value)
 Put a boolean array in the table. More...
 
static bool SetDefaultBooleanArray (llvm::StringRef key, llvm::ArrayRef< int > defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static std::vector< int > GetBooleanArray (llvm::StringRef key, llvm::ArrayRef< int > defaultValue)
 Returns the boolean array the key maps to. More...
 
static bool PutNumberArray (llvm::StringRef key, llvm::ArrayRef< double > value)
 Put a number array in the table. More...
 
static bool SetDefaultNumberArray (llvm::StringRef key, llvm::ArrayRef< double > defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static std::vector< double > GetNumberArray (llvm::StringRef key, llvm::ArrayRef< double > defaultValue)
 Returns the number array the key maps to. More...
 
static bool PutStringArray (llvm::StringRef key, llvm::ArrayRef< std::string > value)
 Put a string array in the table. More...
 
static bool SetDefaultStringArray (llvm::StringRef key, llvm::ArrayRef< std::string > defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static std::vector< std::string > GetStringArray (llvm::StringRef key, llvm::ArrayRef< std::string > defaultValue)
 Returns the string array the key maps to. More...
 
static bool PutRaw (llvm::StringRef key, llvm::StringRef value)
 Put a raw value (byte array) in the table. More...
 
static bool SetDefaultRaw (llvm::StringRef key, llvm::StringRef defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static std::string GetRaw (llvm::StringRef key, llvm::StringRef defaultValue)
 Returns the raw value (byte array) the key maps to. More...
 
static bool PutValue (llvm::StringRef keyName, std::shared_ptr< nt::Value > value)
 Maps the specified key to the specified complex value (such as an array) in this table. More...
 
static bool SetDefaultValue (llvm::StringRef key, std::shared_ptr< nt::Value > defaultValue)
 Gets the current value in the table, setting it if it does not exist. More...
 
static std::shared_ptr< nt::ValueGetValue (llvm::StringRef keyName)
 Retrieves the complex value (such as an array) in this table into the complex data object. More...
 
- Static Public Member Functions inherited from frc::SensorBase
static int GetDefaultSolenoidModule ()
 
static bool CheckSolenoidModule (int moduleNumber)
 Check that the solenoid module number is valid. More...
 
static bool CheckDigitalChannel (int channel)
 Check that the digital channel number is valid. More...
 
static bool CheckRelayChannel (int channel)
 Check that the relay channel number is valid. More...
 
static bool CheckPWMChannel (int channel)
 Check that the digital channel number is valid. More...
 
static bool CheckAnalogInputChannel (int channel)
 Check that the analog input number is value. More...
 
static bool CheckAnalogOutputChannel (int channel)
 Check that the analog output number is valid. More...
 
static bool CheckSolenoidChannel (int channel)
 Verify that the solenoid channel number is within limits. More...
 
static bool CheckPDPChannel (int channel)
 Verify that the power distribution channel number is within limits. More...
 
- Static Public Member Functions inherited from frc::ErrorBase
static void SetGlobalError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (llvm::StringRef errorMessage, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber)
 
static ErrorGetGlobalError ()
 Retrieve the current global error.
 

Additional Inherited Members

- Public Member Functions inherited from frc::SensorBase
 SensorBase (const SensorBase &)=delete
 
SensorBaseoperator= (const SensorBase &)=delete
 
- Public Member Functions inherited from frc::ErrorBase
 ErrorBase (const ErrorBase &)=delete
 
ErrorBaseoperator= (const ErrorBase &)=delete
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 
virtual void SetErrnoError (llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set error information associated with a C library call that set an error to the "errno" global variable. More...
 
virtual void SetImaqError (int success, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetErrorRange (Error::Code code, int32_t minRange, int32_t maxRange, int32_t requestedValue, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (llvm::StringRef errorMessage, Error::Code code, llvm::StringRef contextMessage, llvm::StringRef filename, llvm::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 
- Static Public Attributes inherited from frc::SensorBase
static const int kDigitalChannels = HAL_GetNumDigitalChannels()
 
static const int kAnalogInputs = HAL_GetNumAnalogInputs()
 
static const int kAnalogOutputs
 
static const int kSolenoidChannels = HAL_GetNumSolenoidChannels()
 
static const int kSolenoidModules = HAL_GetNumPCMModules()
 
static const int kPwmChannels = HAL_GetNumPWMChannels()
 
static const int kRelayChannels = HAL_GetNumRelayHeaders()
 
static const int kPDPChannels = HAL_GetNumPDPChannels()
 
- Protected Attributes inherited from frc::ErrorBase
Error m_error
 
- Static Protected Attributes inherited from frc::ErrorBase
static std::mutex _globalErrorMutex
 
static Error _globalError
 

Member Function Documentation

void SmartDashboard::ClearFlags ( llvm::StringRef  key,
unsigned int  flags 
)
static

Clears flags on the specified key in this table.

The key can not be null.

Parameters
keythe key name
flagsthe flags to clear (bitmask)
void SmartDashboard::ClearPersistent ( llvm::StringRef  key)
static

Stop making a key's value persistent through program restarts.

The key cannot be null.

Parameters
keythe key name
bool SmartDashboard::ContainsKey ( llvm::StringRef  key)
static

Determines whether the given key is in this table.

Parameters
keythe key to search for
Returns
true if the table as a value assigned to the given key
void SmartDashboard::Delete ( llvm::StringRef  key)
static

Deletes the specified key in this table.

Parameters
keythe key name
bool SmartDashboard::GetBoolean ( llvm::StringRef  keyName,
bool  defaultValue 
)
static

Returns the value at the specified key.

If the key is not found, returns the default value.

Parameters
keyNamethe key
Returns
the value
std::vector< int > SmartDashboard::GetBooleanArray ( llvm::StringRef  key,
llvm::ArrayRef< int >  defaultValue 
)
static

Returns the boolean array the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the array. If the overhead of this is a concern, use GetValue() instead.
The returned array is std::vector<int> instead of std::vector<bool> because std::vector<bool> is special-cased in C++. 0 is false, any non-zero value is true.
Sendable * SmartDashboard::GetData ( llvm::StringRef  key)
static

Returns the value at the specified key.

Parameters
keyNamethe key
Returns
the value
unsigned int SmartDashboard::GetFlags ( llvm::StringRef  key)
static

Returns the flags for the specified key.

Parameters
keythe key name
Returns
the flags, or 0 if the key is not defined
std::vector< std::string > SmartDashboard::GetKeys ( int  types = 0)
static
Parameters
typesbitmask of types; 0 is treated as a "don't care".
Returns
keys currently in the table
double SmartDashboard::GetNumber ( llvm::StringRef  keyName,
double  defaultValue 
)
static

Returns the value at the specified key.

If the key is not found, returns the default value.

Parameters
keyNamethe key
Returns
the value
std::vector< double > SmartDashboard::GetNumberArray ( llvm::StringRef  key,
llvm::ArrayRef< double >  defaultValue 
)
static

Returns the number array the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the array. If the overhead of this is a concern, use GetValue() instead.
std::string SmartDashboard::GetRaw ( llvm::StringRef  key,
llvm::StringRef  defaultValue 
)
static

Returns the raw value (byte array) the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the raw contents. If the overhead of this is a concern, use GetValue() instead.
std::string SmartDashboard::GetString ( llvm::StringRef  keyName,
llvm::StringRef  defaultValue 
)
static

Returns the value at the specified key.

If the key is not found, returns the default value.

Parameters
keyNamethe key
Returns
the value
std::vector< std::string > SmartDashboard::GetStringArray ( llvm::StringRef  key,
llvm::ArrayRef< std::string >  defaultValue 
)
static

Returns the string array the key maps to.

If the key does not exist or is of different type, it will return the default value.

Parameters
keythe key to look up
defaultValuethe value to be returned if no value is found
Returns
the value associated with the given key or the given default value if there is no value associated with the key
Note
This makes a copy of the array. If the overhead of this is a concern, use GetValue() instead.
std::shared_ptr< nt::Value > SmartDashboard::GetValue ( llvm::StringRef  keyName)
static

Retrieves the complex value (such as an array) in this table into the complex data object.

Parameters
keyNamethe key
valuethe object to retrieve the value into
bool SmartDashboard::IsPersistent ( llvm::StringRef  key)
static

Returns whether the value is persistent through program restarts.

The key cannot be null.

Parameters
keythe key name
bool SmartDashboard::PutBoolean ( llvm::StringRef  keyName,
bool  value 
)
static

Maps the specified key 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
keyNamethe key
valuethe value
Returns
False if the table key already exists with a different type
bool SmartDashboard::PutBooleanArray ( llvm::StringRef  key,
llvm::ArrayRef< int >  value 
)
static

Put a boolean array in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type
Note
The array must be of int's rather than of bool's because std::vector<bool> is special-cased in C++. 0 is false, any non-zero value is true.
void SmartDashboard::PutData ( llvm::StringRef  key,
Sendable data 
)
static

Maps the specified key 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
keyNamethe key
valuethe value
void SmartDashboard::PutData ( NamedSendable value)
static

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
valuethe value
bool SmartDashboard::PutNumber ( llvm::StringRef  keyName,
double  value 
)
static

Maps the specified key 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
keyNamethe key
valuethe value
Returns
False if the table key already exists with a different type
bool SmartDashboard::PutNumberArray ( llvm::StringRef  key,
llvm::ArrayRef< double >  value 
)
static

Put a number array in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type
bool SmartDashboard::PutRaw ( llvm::StringRef  key,
llvm::StringRef  value 
)
static

Put a raw value (byte array) in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type
bool SmartDashboard::PutString ( llvm::StringRef  keyName,
llvm::StringRef  value 
)
static

Maps the specified key 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
keyNamethe key
valuethe value
Returns
False if the table key already exists with a different type
bool SmartDashboard::PutStringArray ( llvm::StringRef  key,
llvm::ArrayRef< std::string >  value 
)
static

Put a string array in the table.

Parameters
keythe key to be assigned to
valuethe value that will be assigned
Returns
False if the table key already exists with a different type
bool SmartDashboard::PutValue ( llvm::StringRef  keyName,
std::shared_ptr< nt::Value value 
)
static

Maps the specified key to the specified complex value (such as an array) in this table.

The value can be retrieved by calling the RetrieveValue method with a key that is equal to the original key.

Parameters
keyNamethe key
valuethe value
Returns
False if the table key already exists with a different type
bool SmartDashboard::SetDefaultBoolean ( llvm::StringRef  key,
bool  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultBooleanArray ( llvm::StringRef  key,
llvm::ArrayRef< int >  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultNumber ( llvm::StringRef  key,
double  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultNumberArray ( llvm::StringRef  key,
llvm::ArrayRef< double >  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultRaw ( llvm::StringRef  key,
llvm::StringRef  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultString ( llvm::StringRef  key,
llvm::StringRef  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultStringArray ( llvm::StringRef  key,
llvm::ArrayRef< std::string >  defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
bool SmartDashboard::SetDefaultValue ( llvm::StringRef  key,
std::shared_ptr< nt::Value defaultValue 
)
static

Gets the current value in the table, setting it if it does not exist.

Parameters
keythe key
defaultValuethe default value to set if key doesn't exist.
Returns
False if the table key exists with a different type
void SmartDashboard::SetFlags ( llvm::StringRef  key,
unsigned int  flags 
)
static

Sets flags on the specified key in this table.

The key can not be null.

Parameters
keythe key name
flagsthe flags to set (bitmask)
void SmartDashboard::SetPersistent ( llvm::StringRef  key)
static

Makes a key's value persistent through program restarts.

Parameters
keythe key to make persistent

The documentation for this class was generated from the following files: