WPILibC++ 2024.3.2
frc::ShuffleboardComponent< Derived > Class Template Reference

A generic component in Shuffleboard. More...

#include <frc/shuffleboard/ShuffleboardComponent.h>

Inheritance diagram for frc::ShuffleboardComponent< Derived >:
frc::ShuffleboardComponentBase frc::ShuffleboardValue frc::ShuffleboardWidget< Derived >

Public Member Functions

 ShuffleboardComponent (ShuffleboardContainer &parent, std::string_view title, std::string_view type="")
 Constructs a ShuffleboardComponent. More...
 
Derived & WithProperties (const wpi::StringMap< nt::Value > &properties)
 Sets custom properties for this component. More...
 
Derived & WithPosition (int columnIndex, int rowIndex)
 Sets the position of this component in the tab. More...
 
Derived & WithSize (int width, int height)
 Sets the size of this component in the tab. More...
 
- Public Member Functions inherited from frc::ShuffleboardComponentBase
 ShuffleboardComponentBase (ShuffleboardContainer &parent, std::string_view title, std::string_view type="")
 
void SetType (std::string_view type)
 
void BuildMetadata (std::shared_ptr< nt::NetworkTable > metaTable)
 
ShuffleboardContainerGetParent ()
 
const std::string & GetType () const
 
- Public Member Functions inherited from frc::ShuffleboardValue
 ShuffleboardValue (std::string_view title)
 
virtual ~ShuffleboardValue ()=default
 
 ShuffleboardValue (const ShuffleboardValue &)=delete
 
ShuffleboardValueoperator= (const ShuffleboardValue &)=delete
 
const std::string & GetTitle () const
 Gets the title of this Shuffleboard value. More...
 
virtual void BuildInto (std::shared_ptr< nt::NetworkTable > parentTable, std::shared_ptr< nt::NetworkTable > metaTable)=0
 Builds the entries for this value. More...
 
virtual void EnableIfActuator ()
 Enables user control of this widget in the Shuffleboard application. More...
 
virtual void DisableIfActuator ()
 Disables user control of this widget in the Shuffleboard application. More...
 

Additional Inherited Members

- Protected Attributes inherited from frc::ShuffleboardComponentBase
wpi::StringMap< nt::Valuem_properties
 
bool m_metadataDirty = true
 
int m_column = -1
 
int m_row = -1
 
int m_width = -1
 
int m_height = -1
 

Detailed Description

template<typename Derived>
class frc::ShuffleboardComponent< Derived >

A generic component in Shuffleboard.

Template Parameters
Derivedthe self type

Constructor & Destructor Documentation

◆ ShuffleboardComponent()

template<typename Derived >
frc::ShuffleboardComponent< Derived >::ShuffleboardComponent ( ShuffleboardContainer parent,
std::string_view  title,
std::string_view  type = "" 
)

Constructs a ShuffleboardComponent.

Parameters
parentThe parent container.
titleThe component title.
typeThe component type.

Member Function Documentation

◆ WithPosition()

template<typename Derived >
Derived & frc::ShuffleboardComponent< Derived >::WithPosition ( int  columnIndex,
int  rowIndex 
)

Sets the position of this component in the tab.

This has no effect if this component is inside a layout.

If the position of a single component is set, it is recommended to set the positions of all components inside a tab to prevent Shuffleboard from automatically placing another component there before the one with the specific position is sent.

Parameters
columnIndexthe column in the tab to place this component
rowIndexthe row in the tab to place this component
Returns
this component

◆ WithProperties()

template<typename Derived >
Derived & frc::ShuffleboardComponent< Derived >::WithProperties ( const wpi::StringMap< nt::Value > &  properties)

Sets custom properties for this component.

Property names are case-sensitive and whitespace-insensitive (capitalization and spaces do not matter).

Parameters
propertiesthe properties for this component
Returns
this component

◆ WithSize()

template<typename Derived >
Derived & frc::ShuffleboardComponent< Derived >::WithSize ( int  width,
int  height 
)

Sets the size of this component in the tab.

This has no effect if this component is inside a layout.

Parameters
widthhow many columns wide the component should be
heighthow many rows high the component should be
Returns
this component

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