BuiltInWidgets
- class wpilib.shuffleboard.BuiltInWidgets(value: int)
Bases:
pybind11_object
The types of the widgets bundled with Shuffleboard.
For example, setting a number to be displayed with a slider: <pre>{@code NetworkTableEntry example = Shuffleboard.getTab(“My Tab”) .add(“My Number”, 0) .withWidget(BuiltInWidgets.kNumberSlider) .getEntry(); }</pre>
Each value in this enum goes into detail on what data types that widget can support, as well as the custom properties that widget uses.
Members:
kTextView : Displays a value with a simple text field.
Supported types:
String
Number
Boolean
This widget has no custom properties.
kNumberSlider : Displays a number with a controllable slider.
Supported types:
Number
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Min</td><td>Number</td><td>-1.0</td><td>The minimum value of the slider</td></tr> <tr><td>Max</td><td>Number</td><td>1.0</td><td>The maximum value of the slider</td></tr> <tr><td>Block increment</td><td>Number</td><td>0.0625</td> <td>How much to move the slider by with the arrow keys</td></tr> </table>
kNumberBar : Displays a number with a view-only bar.
Supported types:
Number
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Min</td><td>Number</td><td>-1.0</td><td>The minimum value of the bar</td></tr> <tr><td>Max</td><td>Number</td><td>1.0</td><td>The maximum value of the bar</td></tr> <tr><td>Center</td><td>Number</td><td>0</td><td>The center (“zero”) value of the bar</td></tr> </table>
kDial : Displays a number with a view-only dial. Displayed values are rounded to
the nearest integer. Supported types: - Number
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Min</td><td>Number</td><td>0</td><td>The minimum value of the dial</td></tr> <tr><td>Max</td><td>Number</td><td>100</td><td>The maximum value of the dial</td></tr> <tr><td>Show value</td><td>Boolean</td><td>true</td> <td>Whether or not to show the value as text</td></tr> </table>
kGraph : Displays a number with a graph. NOTE: graphs can be taxing
on the computer running the dashboard. Keep the number of visible data points to a minimum. Making the widget smaller also helps with performance, but may cause the graph to become difficult to read. Supported types:
Number
Number array
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Visible time</td><td>Number</td><td>30</td> <td>How long, in seconds, should past data be visible for</td></tr> </table>
kBooleanBox : Displays a boolean value as a large colored box.
Supported types:
Boolean
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Color when true</td><td>Color</td><td>”green”</td> <td>Can be specified as a string (
"#00FF00"
) or a rgba integer (0x00FF0000
) </td></tr> <tr><td>Color when false</td><td>Color</td><td>”red”</td> <td>Can be specified as a string or a number</td></tr> </table>kToggleButton : Displays a boolean with a large interactive toggle button.
Supported types:
Boolean
This widget has no custom properties.
kToggleSwitch : Displays a boolean with a fixed-size toggle switch.
Supported types:
Boolean
This widget has no custom properties.
kVoltageView : Displays an analog input or a raw number with a number bar.
Supported types:
Number
AnalogInput
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Min</td><td>Number</td><td>0</td><td>The minimum value of the bar</td></tr> <tr><td>Max</td><td>Number</td><td>5</td><td>The maximum value of the bar</td></tr> <tr><td>Center</td><td>Number</td><td>0</td><td>The center (“zero”) value of the bar</td></tr> <tr><td>Orientation</td><td>String</td><td>”HORIZONTAL”</td> <td>The orientation of the bar. One of {@code [“HORIZONTAL”, “VERTICAL”]}</td></tr> <tr><td>Number of tick marks</td><td>Number</td><td>5</td> <td>The number of discrete ticks on the bar</td></tr> </table>
kPowerDistribution : Displays a PowerDistribution.
Supported types: - PowerDistribution
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Show voltage and current values</td><td>Boolean</td><td>true</td> <td>Whether or not to display the voltage and current draw</td></tr> </table>
kComboBoxChooser : Displays a SendableChooser with a dropdown combo box with a list of
options. Supported types:
SendableChooser
This widget has no custom properties.
kSplitButtonChooser : Displays a SendableChooserwith a toggle button for each available option.
Supported types:
SendableChooser
This widget has no custom properties.
kEncoder : Displays an Encoder displaying its speed,
total traveled distance, and its distance per tick. Supported types:
Encoder
This widget has no custom properties.
kMotorController : Displays a MotorController.
The motor controller will be controllable from the dashboard when test mode is enabled, but will otherwise be view-only. Supported types: - PWMMotorController - DMC60 - Jaguar - PWMTalonSRX - PWMVictorSPX - SD540 - Spark - Talon - Victor - VictorSP - MotorControllerGroup - Any custom subclass of
SpeedContorller
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Orientation</td><td>String</td><td>”HORIZONTAL”</td> <td>One of ``[“HORIZONTAL”, “VERTICAL”]``</td></tr> </table>
kCommand : Displays a command with a toggle button. Pressing the button will start the
command, and the button will automatically release when the command completes. Supported types: - Command - CommandGroup - Any custom subclass of
Command
orCommandGroup
This widget has no custom properties.
kPIDCommand : Displays a PID command with a checkbox and an editor for the PIDF
constants. Selecting the checkbox will start the command, and the checkbox will automatically deselect when the command completes. Supported types: - PIDCommand - Any custom subclass of
PIDCommand
This widget has no custom properties.
kPIDController : Displays a PID controller with an editor for the PIDF constants and a
toggle switch for enabling and disabling the controller. Supported types: - PIDController
This widget has no custom properties.
kAccelerometer : Displays an accelerometer with a number bar displaying the magnitude of the
acceleration and text displaying the exact value. Supported types: - AnalogAccelerometer
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Min</td><td>Number</td><td>-1</td> <td>The minimum acceleration value to display</td></tr> <tr><td>Max</td><td>Number</td><td>1</td> <td>The maximum acceleration value to display</td></tr> <tr><td>Show text</td><td>Boolean</td><td>true</td> <td>Show or hide the acceleration values</td></tr> <tr><td>Precision</td><td>Number</td><td>2</td> <td>How many numbers to display after the decimal point</td></tr> <tr><td>Show tick marks</td><td>Boolean</td><td>false</td> <td>Show or hide the tick marks on the number bars</td></tr> </table>
k3AxisAccelerometer : Displays a 3-axis accelerometer with a number bar for each axis’
acceleration. Supported types: - ADXL345_I2C - ADXL345_SPI - ADXL362
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Range</td><td>Range</td><td>k16G</td><td>The accelerometer range</td></tr> <tr><td>Show value</td><td>Boolean</td><td>true</td> <td>Show or hide the acceleration values</td></tr> <tr><td>Precision</td><td>Number</td><td>2</td> <td>How many numbers to display after the decimal point</td></tr> <tr><td>Show tick marks</td><td>Boolean</td><td>false</td> <td>Show or hide the tick marks on the number bars</td></tr> </table>
kGyro : Displays a gyro with a dial from 0 to 360 degrees.
Supported types:
ADXRS450_Gyro
AnalogGyro
Any custom subclass of
GyroBase
(such as a MXP gyro)
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Major tick spacing</td><td>Number</td><td>45</td><td>Degrees</td></tr> <tr><td>Starting angle</td><td>Number</td><td>180</td> <td>How far to rotate the entire dial, in degrees</td></tr> <tr><td>Show tick mark ring</td><td>Boolean</td><td>true</td></tr> </table>
kRelay : Displays a relay with toggle buttons for each supported mode (off, on,
forward, reverse). Supported types: - Relay
This widget has no custom properties.
kDifferentialDrive : Displays a differential drive with a widget that displays the speed of each
side of the drivebase and a vector for the direction and rotation of the drivebase. The widget will be controllable if the robot is in test mode. Supported types:
DifferentialDrive
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Number of wheels</td><td>Number</td><td>4</td><td>Must be a positive even integer </td></tr> <tr><td>Wheel diameter</td><td>Number</td><td>80</td><td>Pixels</td></tr> <tr><td>Show velocity vectors</td><td>Boolean</td><td>true</td></tr> </table>
kMecanumDrive : Displays a mecanum drive with a widget that displays the speed of each
wheel, and vectors for the direction and rotation of the drivebase. The widget will be controllable if the robot is in test mode. Supported types: - MecanumDrive
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Show velocity vectors</td><td>Boolean</td><td>true</td></tr> </table>
kCameraStream : Displays a camera stream.
Supported types:
VideoSource (as long as it is streaming on an MJPEG server)
Custom properties: <table> <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr> <tr><td>Show crosshair</td><td>Boolean</td><td>true</td> <td>Show or hide a crosshair on the image</td></tr> <tr><td>Crosshair color</td><td>Color</td><td>”white”</td> <td>Can be a string or a rgba integer</td></tr> <tr><td>Show controls</td><td>Boolean</td><td>true</td><td>Show or hide the stream controls </td></tr> <tr><td>Rotation</td><td>String</td><td>”NONE”</td> <td>Rotates the displayed image. One of {@code [“NONE”, “QUARTER_CW”, “QUARTER_CCW”, “HALF”]} </td></tr> </table>
kField : Displays a field2d object.
Supported types:
Field2d
- k3AxisAccelerometer = <BuiltInWidgets.k3AxisAccelerometer: 18>
- kAccelerometer = <BuiltInWidgets.kAccelerometer: 17>
- kBooleanBox = <BuiltInWidgets.kBooleanBox: 5>
- kCameraStream = <BuiltInWidgets.kCameraStream: 23>
- kComboBoxChooser = <BuiltInWidgets.kComboBoxChooser: 10>
- kCommand = <BuiltInWidgets.kCommand: 14>
- kDial = <BuiltInWidgets.kDial: 3>
- kDifferentialDrive = <BuiltInWidgets.kDifferentialDrive: 21>
- kEncoder = <BuiltInWidgets.kEncoder: 12>
- kField = <BuiltInWidgets.kField: 24>
- kGraph = <BuiltInWidgets.kGraph: 4>
- kGyro = <BuiltInWidgets.kGyro: 19>
- kMecanumDrive = <BuiltInWidgets.kMecanumDrive: 22>
- kMotorController = <BuiltInWidgets.kMotorController: 13>
- kNumberBar = <BuiltInWidgets.kNumberBar: 2>
- kNumberSlider = <BuiltInWidgets.kNumberSlider: 1>
- kPIDCommand = <BuiltInWidgets.kPIDCommand: 15>
- kPIDController = <BuiltInWidgets.kPIDController: 16>
- kPowerDistribution = <BuiltInWidgets.kPowerDistribution: 9>
- kRelay = <BuiltInWidgets.kRelay: 20>
- kSplitButtonChooser = <BuiltInWidgets.kSplitButtonChooser: 11>
- kTextView = <BuiltInWidgets.kTextView: 0>
- kToggleButton = <BuiltInWidgets.kToggleButton: 6>
- kToggleSwitch = <BuiltInWidgets.kToggleSwitch: 7>
- kVoltageView = <BuiltInWidgets.kVoltageView: 8>
- property name
- property value