WPILibC++  2019.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::ShuffleboardContainer Class Reference

Common interface for objects that can contain shuffleboard components. More...

#include <ShuffleboardContainer.h>

Inheritance diagram for frc::ShuffleboardContainer:
frc::ShuffleboardValue frc::ErrorBase frc::ShuffleboardLayout frc::ShuffleboardTab

Public Member Functions

 ShuffleboardContainer (const wpi::Twine &title)
 
 ShuffleboardContainer (ShuffleboardContainer &&rhs)=default
 
const std::vector
< std::unique_ptr
< ShuffleboardComponentBase > > & 
GetComponents () const
 Gets the components that are direct children of this container.
 
ShuffleboardLayoutGetLayout (const wpi::Twine &title, BuiltInLayouts type)
 Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called. More...
 
ShuffleboardLayoutGetLayout (const wpi::Twine &title, const LayoutType &type)
 Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called. More...
 
ShuffleboardLayoutGetLayout (const wpi::Twine &title, const wpi::Twine &type)
 Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called. More...
 
ShuffleboardLayoutGetLayout (const wpi::Twine &title)
 Gets the already-defined layout in this container with the given title. More...
 
ComplexWidgetAdd (const wpi::Twine &title, Sendable &sendable)
 Adds a widget to this container to display the given sendable. More...
 
ComplexWidgetAdd (const wpi::Twine &title, const cs::VideoSource &video)
 Adds a widget to this container to display the given video stream. More...
 
ComplexWidgetAdd (Sendable &sendable)
 Adds a widget to this container to display the given sendable. More...
 
ComplexWidgetAdd (const cs::VideoSource &video)
 Adds a widget to this container to display the given video stream. More...
 
SimpleWidgetAdd (const wpi::Twine &title, std::shared_ptr< nt::Value > defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, bool defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, double defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, int defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, const wpi::Twine &defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, const char *defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, wpi::ArrayRef< bool > defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, wpi::ArrayRef< double > defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAdd (const wpi::Twine &title, wpi::ArrayRef< std::string > defaultValue)
 Adds a widget to this container to display the given data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, std::shared_ptr< nt::Value > defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, bool defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, double defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, int defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, const wpi::Twine &defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, wpi::ArrayRef< bool > defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, wpi::ArrayRef< double > defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
SimpleWidgetAddPersistent (const wpi::Twine &title, wpi::ArrayRef< std::string > defaultValue)
 Adds a widget to this container to display a simple piece of data. More...
 
void EnableIfActuator () override
 Enables user control of this widget in the Shuffleboard application. More...
 
void DisableIfActuator () override
 Disables user control of this widget in the Shuffleboard application. More...
 
- Public Member Functions inherited from frc::ShuffleboardValue
 ShuffleboardValue (const wpi::Twine &title)
 
wpi::StringRef GetTitle () const
 Gets the title of this Shuffleboard value.
 
virtual void BuildInto (std::shared_ptr< nt::NetworkTable > parentTable, std::shared_ptr< nt::NetworkTable > metaTable)=0
 Builds the entries for this value. More...
 
- Public Member Functions inherited from frc::ErrorBase
 ErrorBase (ErrorBase &&)=default
 
ErrorBaseoperator= (ErrorBase &&)=default
 
virtual ErrorGetError ()
 Retrieve the current error. More...
 
virtual const ErrorGetError () const
 Retrieve the current error. More...
 
virtual void ClearError () const
 Clear the current error information associated with this sensor.
 
virtual void SetErrnoError (const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::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, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated from the nivision Imaq API. More...
 
virtual void SetError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::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, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void SetWPIError (const wpi::Twine &errorMessage, Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber) const
 Set the current error information associated with this sensor. More...
 
virtual void CloneError (const ErrorBase &rhs) const
 
virtual bool StatusIsFatal () const
 Check if the current error code represents a fatal error. More...
 

Protected Attributes

bool m_isLayout = false
 
- Protected Attributes inherited from frc::ErrorBase
Error m_error
 

Friends

class SimpleWidget
 

Additional Inherited Members

- Static Public Member Functions inherited from frc::ErrorBase
static void SetGlobalError (Error::Code code, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber)
 
static void SetGlobalWPIError (const wpi::Twine &errorMessage, const wpi::Twine &contextMessage, wpi::StringRef filename, wpi::StringRef function, int lineNumber)
 
static const ErrorGetGlobalError ()
 Retrieve the current global error.
 

Detailed Description

Common interface for objects that can contain shuffleboard components.

Member Function Documentation

ComplexWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
Sendable sendable 
)

Adds a widget to this container to display the given sendable.

Parameters
titlethe title of the widget
sendablethe sendable to display
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
ComplexWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
const cs::VideoSource video 
)

Adds a widget to this container to display the given video stream.

Parameters
titlethe title of the widget
videothe video stream to display
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
ComplexWidget& frc::ShuffleboardContainer::Add ( Sendable sendable)

Adds a widget to this container to display the given sendable.

Parameters
sendablethe sendable to display
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title, or if the sendable's name has not been specified
ComplexWidget& frc::ShuffleboardContainer::Add ( const cs::VideoSource video)

Adds a widget to this container to display the given video stream.

Parameters
videothe video to display
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the same title as the video source
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
std::shared_ptr< nt::Value defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
bool  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
double  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
int  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
const wpi::Twine defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
const char *  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
wpi::ArrayRef< bool >  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
wpi::ArrayRef< double >  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::Add ( const wpi::Twine title,
wpi::ArrayRef< std::string >  defaultValue 
)

Adds a widget to this container to display the given data.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
Exceptions
IllegalArgumentExceptionif a widget already exists in this container with the given title
See also
#addPersistent(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
std::shared_ptr< nt::Value defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
bool  defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
double  defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
int  defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
const wpi::Twine defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
wpi::ArrayRef< bool >  defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
wpi::ArrayRef< double >  defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
SimpleWidget& frc::ShuffleboardContainer::AddPersistent ( const wpi::Twine title,
wpi::ArrayRef< std::string >  defaultValue 
)

Adds a widget to this container to display a simple piece of data.

Unlike add(String, Object), the value in the widget will be saved on the robot and will be used when the robot program next starts rather than

defaultValue

.

Parameters
titlethe title of the widget
defaultValuethe default value of the widget
Returns
a widget to display the sendable data
See also
#add(String, Object) add(String title, Object defaultValue)
void frc::ShuffleboardContainer::DisableIfActuator ( )
overridevirtual

Disables user control of this widget in the Shuffleboard application.

This method is package-private to prevent users from enabling control themselves. Has no effect if the sendable is not marked as an actuator with SendableBuilder#setActuator.

Reimplemented from frc::ShuffleboardValue.

void frc::ShuffleboardContainer::EnableIfActuator ( )
overridevirtual

Enables user control of this widget in the Shuffleboard application.

This method is package-private to prevent users from enabling control themselves. Has no effect if the sendable is not marked as an actuator with SendableBuilder#setActuator.

Reimplemented from frc::ShuffleboardValue.

ShuffleboardLayout& frc::ShuffleboardContainer::GetLayout ( const wpi::Twine title,
BuiltInLayouts  type 
)

Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.

Parameters
titlethe title of the layout
layoutTypethe type of the layout, eg "List" or "Grid"
Returns
the layout
ShuffleboardLayout& frc::ShuffleboardContainer::GetLayout ( const wpi::Twine title,
const LayoutType type 
)

Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.

Parameters
titlethe title of the layout
layoutTypethe type of the layout, eg "List" or "Grid"
Returns
the layout
ShuffleboardLayout& frc::ShuffleboardContainer::GetLayout ( const wpi::Twine title,
const wpi::Twine type 
)

Gets the layout with the given type and title, creating it if it does not already exist at the time this method is called.

Note: this method should only be used to use a layout type that is not already built into Shuffleboard. To use a layout built into Shuffleboard, use GetLayout(String, LayoutType) and the layouts in BuiltInLayouts.

Parameters
titlethe title of the layout
typethe type of the layout, eg "List Layout" or "Grid Layout"
Returns
the layout
See also
#GetLayout(String, LayoutType)
ShuffleboardLayout& frc::ShuffleboardContainer::GetLayout ( const wpi::Twine title)

Gets the already-defined layout in this container with the given title.

Shuffleboard::GetTab("Example Tab")->getLayout("My Layout",
// Later...
Shuffleboard::GetTab("Example Tab")->GetLayout("My Layout");
Parameters
titlethe title of the layout to get
Returns
the layout with the given title
Exceptions
ifno layout has yet been defined with the given title

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