WPILibC++  2019.1.1-beta-1-11-g761933a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
frc::Shuffleboard Class Referencefinal

The Shuffleboard class provides a mechanism with which data can be added and laid out in the Shuffleboard dashboard application from a robot program. More...

#include <Shuffleboard.h>

Static Public Member Functions

static void Update ()
 Updates all the values in Shuffleboard. More...
 
static ShuffleboardTabGetTab (wpi::StringRef title)
 Gets the Shuffleboard tab with the given title, creating it if it does not already exist. More...
 
static void EnableActuatorWidgets ()
 Enables user control of widgets containing actuators: speed controllers, relays, etc. More...
 
static void DisableActuatorWidgets ()
 Disables user control of widgets containing actuators. More...
 

Static Public Attributes

static constexpr const char * kBaseTableName = "/Shuffleboard"
 The name of the base NetworkTable into which all Shuffleboard data will be added.
 

Detailed Description

The Shuffleboard class provides a mechanism with which data can be added and laid out in the Shuffleboard dashboard application from a robot program.

Tabs and layouts can be specified, as well as choosing which widgets to display with and setting properties of these widgets; for example, programmers can specify a specific

boolean

value to be displayed with a toggle button instead of the default colored box, or set custom colors for that box.

For example, displaying a boolean entry with a toggle button:

NetworkTableEntry myBoolean = Shuffleboard.getTab("Example Tab")
.add("My Boolean", false)
.withWidget("Toggle Button")
.getEntry();

Changing the colors of the boolean box:

NetworkTableEntry myBoolean = Shuffleboard.getTab("Example Tab")
.add("My Boolean", false)
.withWidget("Boolean Box")
.withProperties(Map.of("colorWhenTrue", "green", "colorWhenFalse",
"maroon")) .getEntry();

Specifying a parent layout. Note that the layout type must always be specified, even if the layout has already been generated by a previously defined entry.

NetworkTableEntry myBoolean = Shuffleboard.getTab("Example Tab")
.getLayout("List", "Example List")
.add("My Boolean", false)
.withWidget("Toggle Button")
.getEntry();

Teams are encouraged to set up shuffleboard layouts at the start of the robot program.

Member Function Documentation

static void frc::Shuffleboard::DisableActuatorWidgets ( )
static

Disables user control of widgets containing actuators.

For safety reasons, actuators should only be controlled while in test mode. IterativeRobotBase and SampleRobot are both configured to call this method when exiting in test mode; most users should not need to use this method directly.

static void frc::Shuffleboard::EnableActuatorWidgets ( )
static

Enables user control of widgets containing actuators: speed controllers, relays, etc.

This should only be used when the robot is in test mode. IterativeRobotBase and SampleRobot are both configured to call this method when entering test mode; most users should not need to use this method directly.

static ShuffleboardTab& frc::Shuffleboard::GetTab ( wpi::StringRef  title)
static

Gets the Shuffleboard tab with the given title, creating it if it does not already exist.

Parameters
titlethe title of the tab
Returns
the tab with the given title
static void frc::Shuffleboard::Update ( )
static

Updates all the values in Shuffleboard.

Iterative and timed robots are pre-configured to call this method in the main robot loop; teams using custom robot base classes, or subclass SampleRobot, should make sure to call this repeatedly to keep data on the dashboard up to date.


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