WPILibC++
2019.1.1-beta-1-11-g761933a
|
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 ShuffleboardTab & | GetTab (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. | |
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
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.
|
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 |
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 |
Gets the Shuffleboard tab with the given title, creating it if it does not already exist.
title | the title of the tab |
|
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.