mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Add constants for built-in Shuffleboard widgets and layouts (#1468)
Prevents users from having to remember (and correctly type) the names of Shuffleboard widgets.
This commit is contained in:
committed by
Peter Johnson
parent
ceed1d74dc
commit
01d1322066
@@ -10,6 +10,7 @@
|
||||
#include <wpi/Twine.h>
|
||||
|
||||
#include "frc/shuffleboard/ShuffleboardComponent.h"
|
||||
#include "frc/shuffleboard/WidgetType.h"
|
||||
|
||||
namespace frc {
|
||||
|
||||
@@ -36,6 +37,22 @@ class ShuffleboardWidget
|
||||
*
|
||||
* @param widgetType the type of the widget used to display the data
|
||||
* @return this widget object
|
||||
* @see BuiltInWidgets
|
||||
*/
|
||||
Derived& withWidget(const WidgetType& widgetType) {
|
||||
return WithWidget(widgetType.GetWidgetName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the type of widget used to display the data. If not set, the default
|
||||
* widget type will be used. This method should only be used to use a widget
|
||||
* that does not come built into Shuffleboard (i.e. one that comes with a
|
||||
* custom or thrid-party plugin). To use a widget that is built into
|
||||
* Shuffleboard, use {@link #withWidget(WidgetType)} and {@link
|
||||
* BuiltInWidgets}.
|
||||
*
|
||||
* @param widgetType the type of the widget used to display the data
|
||||
* @return this widget object
|
||||
*/
|
||||
Derived& WithWidget(const wpi::Twine& widgetType) {
|
||||
this->SetType(widgetType);
|
||||
|
||||
Reference in New Issue
Block a user