WPILibC++ 2024.3.2
BuiltInWidgets.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
8
9namespace frc {
10
11/**
12 * The types of the widgets bundled with Shuffleboard.
13 *
14 * <p>For example, setting a number to be displayed with a slider:
15 * <pre>{@code
16 * NetworkTableEntry example = Shuffleboard.getTab("My Tab")
17 * .add("My Number", 0)
18 * .withWidget(BuiltInWidgets.kNumberSlider)
19 * .getEntry();
20 * }</pre>
21 *
22 * <p>Each value in this enum goes into detail on what data types that widget
23 * can support, as well as the custom properties that widget uses.
24 */
25enum class BuiltInWidgets {
26 /**
27 * Displays a value with a simple text field.
28 * <br>Supported types:
29 * <ul>
30 * <li>String</li>
31 * <li>Number</li>
32 * <li>Boolean</li>
33 * </ul>
34 * <br>This widget has no custom properties.
35 */
37 /**
38 * Displays a number with a controllable slider.
39 * <br>Supported types:
40 * <ul>
41 * <li>Number</li>
42 * </ul>
43 * <br>Custom properties:
44 * <table>
45 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
46 * <tr><td>Min</td><td>Number</td><td>-1.0</td><td>The minimum value of the
47 * slider</td></tr> <tr><td>Max</td><td>Number</td><td>1.0</td><td>The maximum
48 * value of the slider</td></tr> <tr><td>Block
49 * increment</td><td>Number</td><td>0.0625</td> <td>How much to move the
50 * slider by with the arrow keys</td></tr>
51 * </table>
52 */
54 /**
55 * Displays a number with a view-only bar.
56 * <br>Supported types:
57 * <ul>
58 * <li>Number</li>
59 * </ul>
60 * <br>Custom properties:
61 * <table>
62 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
63 * <tr><td>Min</td><td>Number</td><td>-1.0</td><td>The minimum value of the
64 * bar</td></tr> <tr><td>Max</td><td>Number</td><td>1.0</td><td>The maximum
65 * value of the bar</td></tr>
66 * <tr><td>Center</td><td>Number</td><td>0</td><td>The center ("zero") value
67 * of the bar</td></tr>
68 * </table>
69 */
71 /**
72 * Displays a number with a view-only dial. Displayed values are rounded to
73 * the nearest integer. <br>Supported types: <ul> <li>Number</li>
74 * </ul>
75 * <br>Custom properties:
76 * <table>
77 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
78 * <tr><td>Min</td><td>Number</td><td>0</td><td>The minimum value of the
79 * dial</td></tr> <tr><td>Max</td><td>Number</td><td>100</td><td>The maximum
80 * value of the dial</td></tr> <tr><td>Show
81 * value</td><td>Boolean</td><td>true</td> <td>Whether or not to show the
82 * value as text</td></tr>
83 * </table>
84 */
85 kDial,
86 /**
87 * Displays a number with a graph. <strong>NOTE:</strong> graphs can be taxing
88 * on the computer running the dashboard. Keep the number of visible data
89 * points to a minimum. Making the widget smaller also helps with performance,
90 * but may cause the graph to become difficult to read. <br>Supported types:
91 * <ul>
92 * <li>Number</li>
93 * <li>Number array</li>
94 * </ul>
95 * <br>Custom properties:
96 * <table>
97 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
98 * <tr><td>Visible time</td><td>Number</td><td>30</td>
99 * <td>How long, in seconds, should past data be visible for</td></tr>
100 * </table>
101 */
102 kGraph,
103 /**
104 * Displays a boolean value as a large colored box.
105 * <br>Supported types:
106 * <ul>
107 * <li>Boolean</li>
108 * </ul>
109 * <br>Custom properties:
110 * <table>
111 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
112 * <tr><td>Color when true</td><td>Color</td><td>"green"</td>
113 * <td>Can be specified as a string ({@code "#00FF00"}) or a rgba integer
114 * ({@code 0x00FF0000})
115 * </td></tr>
116 * <tr><td>Color when false</td><td>Color</td><td>"red"</td>
117 * <td>Can be specified as a string or a number</td></tr>
118 * </table>
119 */
121 /**
122 * Displays a boolean with a large interactive toggle button.
123 * <br>Supported types:
124 * <ul>
125 * <li>Boolean</li>
126 * </ul>
127 * <br>This widget has no custom properties.
128 */
130 /**
131 * Displays a boolean with a fixed-size toggle switch.
132 * <br>Supported types:
133 * <ul>
134 * <li>Boolean</li>
135 * </ul>
136 * <br>This widget has no custom properties.
137 */
139 /**
140 * Displays an analog input or a raw number with a number bar.
141 * <br>Supported types:
142 * <ul>
143 * <li>Number</li>
144 * <li>AnalogInput</li>
145 * </ul>
146 * <br>Custom properties:
147 * <table>
148 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
149 * <tr><td>Min</td><td>Number</td><td>0</td><td>The minimum value of the
150 * bar</td></tr> <tr><td>Max</td><td>Number</td><td>5</td><td>The maximum
151 * value of the bar</td></tr>
152 * <tr><td>Center</td><td>Number</td><td>0</td><td>The center ("zero") value
153 * of the bar</td></tr>
154 * <tr><td>Orientation</td><td>String</td><td>"HORIZONTAL"</td>
155 * <td>The orientation of the bar. One of {@code ["HORIZONTAL",
156 * "VERTICAL"]}</td></tr> <tr><td>Number of tick
157 * marks</td><td>Number</td><td>5</td> <td>The number of discrete ticks on the
158 * bar</td></tr>
159 * </table>
160 */
162 /**
163 * Displays a PowerDistribution. <br>Supported types: <ul> <li>
164 * PowerDistribution</li>
165 * </ul>
166 * <br>Custom properties:
167 * <table>
168 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
169 * <tr><td>Show voltage and current values</td><td>Boolean</td><td>true</td>
170 * <td>Whether or not to display the voltage and current draw</td></tr>
171 * </table>
172 */
174 /**
175 * Displays a SendableChooser with a dropdown combo box with a list of
176 * options.
177 * <br>Supported types:
178 * <ul>
179 * <li>SendableChooser</li>
180 * </ul>
181 * <br>This widget has no custom properties.
182 */
184 /**
185 * Displays a SendableChooserwith a toggle button for each available option.
186 * <br>Supported types:
187 * <ul>
188 * <li>SendableChooser</li>
189 * </ul>
190 * <br>This widget has no custom properties.
191 */
193 /**
194 * Displays an Encoder displaying its speed,
195 * total traveled distance, and its distance per tick. <br>Supported types:
196 * <ul>
197 * <li>Encoder</li>
198 * </ul>
199 * <br>This widget has no custom properties.
200 */
201 kEncoder,
202 /**
203 * Displays a MotorController.
204 * The motor controller will be controllable from the dashboard when test mode
205 * is enabled, but will otherwise be view-only. <br>Supported types: <ul>
206 * <li>PWMMotorController</li>
207 * <li>DMC60</li>
208 * <li>Jaguar</li>
209 * <li>PWMTalonSRX</li>
210 * <li>PWMVictorSPX</li>
211 * <li>SD540</li>
212 * <li>Spark</li>
213 * <li>Talon</li>
214 * <li>Victor</li>
215 * <li>VictorSP</li>
216 * <li>MotorControllerGroup</li>
217 * <li>Any custom subclass of {@code SpeedContorller}</li>
218 * </ul>
219 * <br>Custom properties:
220 * <table>
221 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
222 * <tr><td>Orientation</td><td>String</td><td>"HORIZONTAL"</td>
223 * <td>One of {@code ["HORIZONTAL", "VERTICAL"]}</td></tr>
224 * </table>
225 */
227 /**
228 * Displays a command with a toggle button. Pressing the button will start the
229 * command, and the button will automatically release when the command
230 * completes. <br>Supported types: <ul> <li>Command</li> <li>CommandGroup</li>
231 * <li>Any custom subclass of {@code Command} or {@code CommandGroup}</li>
232 * </ul>
233 * <br>This widget has no custom properties.
234 */
235 kCommand,
236 /**
237 * Displays a PID command with a checkbox and an editor for the PIDF
238 * constants. Selecting the checkbox will start the command, and the checkbox
239 * will automatically deselect when the command completes. <br>Supported
240 * types: <ul> <li>PIDCommand</li>
241 * <li>Any custom subclass of {@code PIDCommand}</li>
242 * </ul>
243 * <br>This widget has no custom properties.
244 */
246 /**
247 * Displays a PID controller with an editor for the PIDF constants and a
248 * toggle switch for enabling and disabling the controller. <br>Supported
249 * types: <ul> <li>PIDController</li>
250 * </ul>
251 * <br>This widget has no custom properties.
252 */
254 /**
255 * Displays an accelerometer with a number bar displaying the magnitude of the
256 * acceleration and text displaying the exact value. <br>Supported types: <ul>
257 * <li>AnalogAccelerometer</li>
258 * </ul>
259 * <br>Custom properties:
260 * <table>
261 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
262 * <tr><td>Min</td><td>Number</td><td>-1</td>
263 * <td>The minimum acceleration value to display</td></tr>
264 * <tr><td>Max</td><td>Number</td><td>1</td>
265 * <td>The maximum acceleration value to display</td></tr>
266 * <tr><td>Show text</td><td>Boolean</td><td>true</td>
267 * <td>Show or hide the acceleration values</td></tr>
268 * <tr><td>Precision</td><td>Number</td><td>2</td>
269 * <td>How many numbers to display after the decimal point</td></tr>
270 * <tr><td>Show tick marks</td><td>Boolean</td><td>false</td>
271 * <td>Show or hide the tick marks on the number bars</td></tr>
272 * </table>
273 */
275 /**
276 * Displays a 3-axis accelerometer with a number bar for each axis'
277 * acceleration. <br>Supported types: <ul> <li>ADXL345_I2C</li> <li>
278 * ADXL345_SPI</li> <li>ADXL362</li>
279 * </ul>
280 * <br>Custom properties:
281 * <table>
282 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
283 * <tr><td>Range</td><td>Range</td><td>k16G</td><td>The accelerometer
284 * range</td></tr> <tr><td>Show value</td><td>Boolean</td><td>true</td>
285 * <td>Show or hide the acceleration values</td></tr>
286 * <tr><td>Precision</td><td>Number</td><td>2</td>
287 * <td>How many numbers to display after the decimal point</td></tr>
288 * <tr><td>Show tick marks</td><td>Boolean</td><td>false</td>
289 * <td>Show or hide the tick marks on the number bars</td></tr>
290 * </table>
291 */
293 /**
294 * Displays a gyro with a dial from 0 to 360 degrees.
295 * <br>Supported types:
296 * <ul>
297 * <li>ADXRS450_Gyro</li>
298 * <li>AnalogGyro</li>
299 * <li>Any custom subclass of {@code GyroBase} (such as a MXP gyro)</li>
300 * </ul>
301 * <br>Custom properties:
302 * <table>
303 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
304 * <tr><td>Major tick
305 * spacing</td><td>Number</td><td>45</td><td>Degrees</td></tr>
306 * <tr><td>Starting angle</td><td>Number</td><td>180</td>
307 * <td>How far to rotate the entire dial, in degrees</td></tr>
308 * <tr><td>Show tick mark ring</td><td>Boolean</td><td>true</td></tr>
309 * </table>
310 */
311 kGyro,
312 /**
313 * Displays a relay with toggle buttons for each supported mode (off, on,
314 * forward, reverse). <br>Supported types: <ul> <li>Relay</li>
315 * </ul>
316 * <br>This widget has no custom properties.
317 */
318 kRelay,
319 /**
320 * Displays a differential drive with a widget that displays the speed of each
321 * side of the drivebase and a vector for the direction and rotation of the
322 * drivebase. The widget will be controllable if the robot is in test mode.
323 * <br>Supported types:
324 * <ul>
325 * <li>DifferentialDrive</li>
326 * </ul>
327 * <br>Custom properties:
328 * <table>
329 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
330 * <tr><td>Number of wheels</td><td>Number</td><td>4</td><td>Must be a
331 * positive even integer
332 * </td></tr>
333 * <tr><td>Wheel diameter</td><td>Number</td><td>80</td><td>Pixels</td></tr>
334 * <tr><td>Show velocity vectors</td><td>Boolean</td><td>true</td></tr>
335 * </table>
336 */
338 /**
339 * Displays a mecanum drive with a widget that displays the speed of each
340 * wheel, and vectors for the direction and rotation of the drivebase. The
341 * widget will be controllable if the robot is in test mode. <br>Supported
342 * types: <ul> <li>MecanumDrive</li>
343 * </ul>
344 * <br>Custom properties:
345 * <table>
346 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
347 * <tr><td>Show velocity vectors</td><td>Boolean</td><td>true</td></tr>
348 * </table>
349 */
351 /**
352 * Displays a camera stream.
353 * <br>Supported types:
354 * <ul>
355 * <li>VideoSource (as long as it is streaming on an MJPEG server)</li>
356 * </ul>
357 * <br>Custom properties:
358 * <table>
359 * <tr><th>Name</th><th>Type</th><th>Default Value</th><th>Notes</th></tr>
360 * <tr><td>Show crosshair</td><td>Boolean</td><td>true</td>
361 * <td>Show or hide a crosshair on the image</td></tr>
362 * <tr><td>Crosshair color</td><td>Color</td><td>"white"</td>
363 * <td>Can be a string or a rgba integer</td></tr>
364 * <tr><td>Show controls</td><td>Boolean</td><td>true</td><td>Show or hide the
365 * stream controls
366 * </td></tr>
367 * <tr><td>Rotation</td><td>String</td><td>"NONE"</td>
368 * <td>Rotates the displayed image. One of {@code ["NONE", "QUARTER_CW",
369 * "QUARTER_CCW", "HALF"]}
370 * </td></tr>
371 * </table>
372 */
374 /**
375 * Displays a field2d object.<br>
376 * Supported types:
377 *
378 * <ul>
379 * <li>Field2d
380 * </ul>
381 */
382 kField,
383};
384
385} // namespace frc
Definition: AprilTagPoseEstimator.h:15
BuiltInWidgets
The types of the widgets bundled with Shuffleboard.
Definition: BuiltInWidgets.h:25
@ kGraph
Displays a number with a graph.
@ kTextView
Displays a value with a simple text field.
@ kToggleButton
Displays a boolean with a large interactive toggle button.
@ kPIDCommand
Displays a PID command with a checkbox and an editor for the PIDF constants.
@ kRelay
Displays a relay with toggle buttons for each supported mode (off, on, forward, reverse).
@ kAccelerometer
Displays an accelerometer with a number bar displaying the magnitude of the acceleration and text dis...
@ kPIDController
Displays a PID controller with an editor for the PIDF constants and a toggle switch for enabling and ...
@ kDifferentialDrive
Displays a differential drive with a widget that displays the speed of each side of the drivebase and...
@ kMotorController
Displays a MotorController.
@ kField
Displays a field2d object.
@ kEncoder
Displays an Encoder displaying its speed, total traveled distance, and its distance per tick.
@ kGyro
Displays a gyro with a dial from 0 to 360 degrees.
@ k3AxisAccelerometer
Displays a 3-axis accelerometer with a number bar for each axis' acceleration.
@ kCommand
Displays a command with a toggle button.
@ kBooleanBox
Displays a boolean value as a large colored box.
@ kToggleSwitch
Displays a boolean with a fixed-size toggle switch.
@ kPowerDistribution
Displays a PowerDistribution.
@ kVoltageView
Displays an analog input or a raw number with a number bar.
@ kNumberSlider
Displays a number with a controllable slider.
@ kNumberBar
Displays a number with a view-only bar.
@ kMecanumDrive
Displays a mecanum drive with a widget that displays the speed of each wheel, and vectors for the dir...
@ kSplitButtonChooser
Displays a SendableChooserwith a toggle button for each available option.
@ kCameraStream
Displays a camera stream.
@ kDial
Displays a number with a view-only dial.
@ kComboBoxChooser
Displays a SendableChooser with a dropdown combo box with a list of options.