WPILibC++ 2024.3.2
ShuffleboardContainer.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
7#include <functional>
8#include <memory>
9#include <span>
10#include <string>
11#include <string_view>
12#include <vector>
13
16#include <wpi/SmallSet.h>
17#include <wpi/StringMap.h>
18
24
25namespace cs {
26class VideoSource;
27} // namespace cs
28
29namespace wpi {
30class Sendable;
31} // namespace wpi
32
33namespace frc {
34
35class ComplexWidget;
36class ShuffleboardLayout;
37class SimpleWidget;
38
39/**
40 * Common interface for objects that can contain shuffleboard components.
41 */
43 public:
45
47
48 ~ShuffleboardContainer() override = default;
49
50 /**
51 * Gets the components that are direct children of this container.
52 */
53 const std::vector<std::unique_ptr<ShuffleboardComponentBase>>& GetComponents()
54 const;
55
56 /**
57 * Gets the layout with the given type and title, creating it if it does not
58 * already exist at the time this method is called.
59 *
60 * @param title the title of the layout
61 * @param type the type of the layout, eg "List" or "Grid"
62 * @return the layout
63 */
65
66 /**
67 * Gets the layout with the given type and title, creating it if it does not
68 * already exist at the time this method is called.
69 *
70 * @param title the title of the layout
71 * @param type the type of the layout, eg "List" or "Grid"
72 * @return the layout
73 */
75
76 /**
77 * Gets the layout with the given type and title, creating it if it does not
78 * already exist at the time this method is called. Note: this method should
79 * only be used to use a layout type that is not already built into
80 * Shuffleboard. To use a layout built into Shuffleboard, use
81 * GetLayout(std::string_view, const LayoutType&) and the layouts in
82 * BuiltInLayouts.
83 *
84 * @param title the title of the layout
85 * @param type the type of the layout, eg "List Layout" or "Grid Layout"
86 * @return the layout
87 * @see GetLayout(std::string_view, const LayoutType&)
88 */
90
91 /**
92 * Gets the already-defined layout in this container with the given title.
93 *
94 * <pre>{@code
95 * Shuffleboard::GetTab("Example Tab")->getLayout("My Layout",
96 * &BuiltInLayouts.kList);
97 *
98 * // Later...
99 * Shuffleboard::GetTab("Example Tab")->GetLayout("My Layout");
100 * }</pre>
101 *
102 * @param title the title of the layout to get
103 * @return the layout with the given title
104 * @throws if no layout has yet been defined with the given title
105 */
107
108 /**
109 * Adds a widget to this container to display the given sendable.
110 *
111 * @param title the title of the widget
112 * @param sendable the sendable to display
113 * @return a widget to display the sendable data
114 * @throws IllegalArgumentException if a widget already exists in this
115 * container with the given title
116 */
118
119 /**
120 * Adds a widget to this container to display the given video stream.
121 *
122 * @param title the title of the widget
123 * @param video the video stream to display
124 * @return a widget to display the sendable data
125 * @throws IllegalArgumentException if a widget already exists in this
126 * container with the given title
127 */
129
130 /**
131 * Adds a widget to this container to display a video stream.
132 *
133 * @param title the title of the widget
134 * @param cameraName the name of the streamed camera
135 * @param cameraUrls the URLs with which the dashboard can access the camera
136 * stream
137 * @return a widget to display the camera stream
138 */
140 std::span<const std::string> cameraUrls);
141
142 /**
143 * Adds a widget to this container to display the given sendable.
144 *
145 * @param sendable the sendable to display
146 * @return a widget to display the sendable data
147 * @throws IllegalArgumentException if a widget already exists in this
148 * container with the given title, or if the sendable's name has not been
149 * specified
150 */
152
153 /**
154 * Adds a widget to this container to display the given video stream.
155 *
156 * @param video the video to display
157 * @return a widget to display the sendable data
158 * @throws IllegalArgumentException if a widget already exists in this
159 * container with the same title as the video source
160 */
161 ComplexWidget& Add(const cs::VideoSource& video);
162
163 /**
164 * Adds a widget to this container to display the given data.
165 *
166 * @param title the title of the widget
167 * @param defaultValue the default value of the widget
168 * @return a widget to display the sendable data
169 * @throws IllegalArgumentException if a widget already exists in this
170 * container with the given title
171 * @see AddPersistent(std::string_view, std::shared_ptr<nt::Value>)
172 * Add(std::string_view title, std::shared_ptr<nt::Value> defaultValue)
173 */
174 SimpleWidget& Add(std::string_view title, const nt::Value& defaultValue);
175
176 /**
177 * Adds a widget to this container to display the given data.
178 *
179 * @param title the title of the widget
180 * @param defaultValue the default value of the widget
181 * @return a widget to display the sendable data
182 * @throws IllegalArgumentException if a widget already exists in this
183 * container with the given title
184 * @see AddPersistent(std::string_view, bool)
185 * Add(std::string_view title, bool defaultValue)
186 */
187 SimpleWidget& Add(std::string_view title, bool defaultValue);
188
189 /**
190 * Adds a widget to this container to display the given data.
191 *
192 * @param title the title of the widget
193 * @param defaultValue the default value of the widget
194 * @return a widget to display the sendable data
195 * @throws IllegalArgumentException if a widget already exists in this
196 * container with the given title
197 * @see AddPersistent(std::string_view, double)
198 * Add(std::string_view title, double defaultValue)
199 */
200 SimpleWidget& Add(std::string_view title, double defaultValue);
201
202 /**
203 * Adds a widget to this container to display the given data.
204 *
205 * @param title the title of the widget
206 * @param defaultValue the default value of the widget
207 * @return a widget to display the sendable data
208 * @throws IllegalArgumentException if a widget already exists in this
209 * container with the given title
210 * @see AddPersistent(std::string_view, double)
211 * Add(std::string_view title, double defaultValue)
212 */
213 SimpleWidget& Add(std::string_view title, float defaultValue);
214
215 /**
216 * Adds a widget to this container to display the given data.
217 *
218 * @param title the title of the widget
219 * @param defaultValue the default value of the widget
220 * @return a widget to display the sendable data
221 * @throws IllegalArgumentException if a widget already exists in this
222 * container with the given title
223 * @see AddPersistent(std::string_view, int)
224 * Add(std::string_view title, int defaultValue)
225 */
226 SimpleWidget& Add(std::string_view title, int defaultValue);
227
228 /**
229 * Adds a widget to this container to display the given data.
230 *
231 * @param title the title of the widget
232 * @param defaultValue the default value of the widget
233 * @return a widget to display the sendable data
234 * @throws IllegalArgumentException if a widget already exists in this
235 * container with the given title
236 * @see AddPersistent(std::string_view, std::string_view)
237 * Add(std::string_view title, std::string_view defaultValue)
238 */
240
241 /**
242 * Adds a widget to this container to display the given data.
243 *
244 * @param title the title of the widget
245 * @param defaultValue the default value of the widget
246 * @return a widget to display the sendable data
247 * @throws IllegalArgumentException if a widget already exists in this
248 * container with the given title
249 * @see AddPersistent(std::string_view, const char*)
250 * Add(std::string_view title, const char* defaultValue)
251 */
252 SimpleWidget& Add(std::string_view title, const char* defaultValue);
253
254 /**
255 * Adds a widget to this container to display the given data.
256 *
257 * @param title the title of the widget
258 * @param defaultValue the default value of the widget
259 * @return a widget to display the sendable data
260 * @throws IllegalArgumentException if a widget already exists in this
261 * container with the given title
262 * @see AddPersistent(std::string_view, std::span<const bool>)
263 * Add(std::string_view title, std::span<const bool> defaultValue)
264 */
265 SimpleWidget& Add(std::string_view title, std::span<const bool> defaultValue);
266
267 /**
268 * Adds a widget to this container to display the given data.
269 *
270 * @param title the title of the widget
271 * @param defaultValue the default value of the widget
272 * @return a widget to display the sendable data
273 * @throws IllegalArgumentException if a widget already exists in this
274 * container with the given title
275 * @see AddPersistent(std::string_view, std::span<const double>)
276 * Add(std::string_view title, std::span<const double> defaultValue)
277 */
279 std::span<const double> defaultValue);
280
281 /**
282 * Adds a widget to this container to display the given data.
283 *
284 * @param title the title of the widget
285 * @param defaultValue the default value of the widget
286 * @return a widget to display the sendable data
287 * @throws IllegalArgumentException if a widget already exists in this
288 * container with the given title
289 * @see AddPersistent(std::string_view, std::span<const double>)
290 * Add(std::string_view title, std::span<const double> defaultValue)
291 */
293 std::span<const float> defaultValue);
294
295 /**
296 * Adds a widget to this container to display the given data.
297 *
298 * @param title the title of the widget
299 * @param defaultValue the default value of the widget
300 * @return a widget to display the sendable data
301 * @throws IllegalArgumentException if a widget already exists in this
302 * container with the given title
303 * @see AddPersistent(std::string_view, std::span<const double>)
304 * Add(std::string_view title, std::span<const double> defaultValue)
305 */
307 std::span<const int64_t> defaultValue);
308
309 /**
310 * Adds a widget to this container to display the given data.
311 *
312 * @param title the title of the widget
313 * @param defaultValue the default value of the widget
314 * @return a widget to display the sendable data
315 * @throws IllegalArgumentException if a widget already exists in this
316 * container with the given title
317 * @see AddPersistent(std::string_view, std::span<const std::string>)
318 * Add(std::string_view title, std::span<const std::string> defaultValue)
319 */
321 std::span<const std::string> defaultValue);
322
323 /**
324 * Adds a widget to this container. The widget will display the data provided
325 * by the value supplier. Changes made on the dashboard will not propagate to
326 * the widget object, and will be overridden by values from the value
327 * supplier.
328 *
329 * @param title the title of the widget
330 * @param supplier the supplier for values
331 * @return a widget to display data
332 */
334 std::string_view title, std::function<std::string()> supplier);
335
336 /**
337 * Adds a widget to this container. The widget will display the data provided
338 * by the value supplier. Changes made on the dashboard will not propagate to
339 * the widget object, and will be overridden by values from the value
340 * supplier.
341 *
342 * @param title the title of the widget
343 * @param supplier the supplier for values
344 * @return a widget to display data
345 */
347 std::function<double()> supplier);
348
349 /**
350 * Adds a widget to this container. The widget will display the data provided
351 * by the value supplier. Changes made on the dashboard will not propagate to
352 * the widget object, and will be overridden by values from the value
353 * supplier.
354 *
355 * @param title the title of the widget
356 * @param supplier the supplier for values
357 * @return a widget to display data
358 */
360 std::function<double()> supplier);
361
362 /**
363 * Adds a widget to this container. The widget will display the data provided
364 * by the value supplier. Changes made on the dashboard will not propagate to
365 * the widget object, and will be overridden by values from the value
366 * supplier.
367 *
368 * @param title the title of the widget
369 * @param supplier the supplier for values
370 * @return a widget to display data
371 */
373 std::function<float()> supplier);
374
375 /**
376 * Adds a widget to this container. The widget will display the data provided
377 * by the value supplier. Changes made on the dashboard will not propagate to
378 * the widget object, and will be overridden by values from the value
379 * supplier.
380 *
381 * @param title the title of the widget
382 * @param supplier the supplier for values
383 * @return a widget to display data
384 */
386 std::function<int64_t()> supplier);
387
388 /**
389 * Adds a widget to this container. The widget will display the data provided
390 * by the value supplier. Changes made on the dashboard will not propagate to
391 * the widget object, and will be overridden by values from the value
392 * supplier.
393 *
394 * @param title the title of the widget
395 * @param supplier the supplier for values
396 * @return a widget to display data
397 */
399 std::function<bool()> supplier);
400
401 /**
402 * Adds a widget to this container. The widget will display the data provided
403 * by the value supplier. Changes made on the dashboard will not propagate to
404 * the widget object, and will be overridden by values from the value
405 * supplier.
406 *
407 * @param title the title of the widget
408 * @param supplier the supplier for values
409 * @return a widget to display data
410 */
412 std::string_view title,
413 std::function<std::vector<std::string>()> supplier);
414
415 /**
416 * Adds a widget to this container. The widget will display the data provided
417 * by the value supplier. Changes made on the dashboard will not propagate to
418 * the widget object, and will be overridden by values from the value
419 * supplier.
420 *
421 * @param title the title of the widget
422 * @param supplier the supplier for values
423 * @return a widget to display data
424 */
426 std::string_view title, std::function<std::vector<double>()> supplier);
427
428 /**
429 * Adds a widget to this container. The widget will display the data provided
430 * by the value supplier. Changes made on the dashboard will not propagate to
431 * the widget object, and will be overridden by values from the value
432 * supplier.
433 *
434 * @param title the title of the widget
435 * @param supplier the supplier for values
436 * @return a widget to display data
437 */
439 std::string_view title, std::function<std::vector<double>()> supplier);
440
441 /**
442 * Adds a widget to this container. The widget will display the data provided
443 * by the value supplier. Changes made on the dashboard will not propagate to
444 * the widget object, and will be overridden by values from the value
445 * supplier.
446 *
447 * @param title the title of the widget
448 * @param supplier the supplier for values
449 * @return a widget to display data
450 */
452 std::string_view title, std::function<std::vector<float>()> supplier);
453
454 /**
455 * Adds a widget to this container. The widget will display the data provided
456 * by the value supplier. Changes made on the dashboard will not propagate to
457 * the widget object, and will be overridden by values from the value
458 * supplier.
459 *
460 * @param title the title of the widget
461 * @param supplier the supplier for values
462 * @return a widget to display data
463 */
465 std::string_view title, std::function<std::vector<int64_t>()> supplier);
466
467 /**
468 * Adds a widget to this container. The widget will display the data provided
469 * by the value supplier. Changes made on the dashboard will not propagate to
470 * the widget object, and will be overridden by values from the value
471 * supplier.
472 *
473 * @param title the title of the widget
474 * @param supplier the supplier for values
475 * @return a widget to display data
476 */
478 std::string_view title, std::function<std::vector<int>()> supplier);
479
480 /**
481 * Adds a widget to this container. The widget will display the data provided
482 * by the value supplier. Changes made on the dashboard will not propagate to
483 * the widget object, and will be overridden by values from the value
484 * supplier.
485 *
486 * @param title the title of the widget
487 * @param supplier the supplier for values
488 * @return a widget to display data
489 */
491 std::string_view title, std::function<std::vector<uint8_t>()> supplier);
492
493 /**
494 * Adds a widget to this container. The widget will display the data provided
495 * by the value supplier. Changes made on the dashboard will not propagate to
496 * the widget object, and will be overridden by values from the value
497 * supplier.
498 *
499 * @param title the title of the widget
500 * @param typeString the NT type string
501 * @param supplier the supplier for values
502 * @return a widget to display data
503 */
505 std::string_view title, std::string_view typeString,
506 std::function<std::vector<uint8_t>()> supplier);
507
508 /**
509 * Adds a widget to this container to display a simple piece of data.
510 *
511 * Unlike Add(std::string_view, std::shared_ptr<nt::Value>), the value in the
512 * widget will be saved on the robot and will be used when the robot program
513 * next starts rather than {@code defaultValue}.
514 *
515 * @param title the title of the widget
516 * @param defaultValue the default value of the widget
517 * @return a widget to display the sendable data
518 * @see Add(stdd::string_view, std::shared_ptr<nt::Value>)
519 * Add(std::string_view title, std::shared_ptr<nt::Value> defaultValue)
520 */
522 const nt::Value& defaultValue);
523
524 /**
525 * Adds a widget to this container to display a simple piece of data.
526 *
527 * Unlike Add(std::string_view, bool), the value in the widget will be saved
528 * on the robot and will be used when the robot program next starts rather
529 * than {@code defaultValue}.
530 *
531 * @param title the title of the widget
532 * @param defaultValue the default value of the widget
533 * @return a widget to display the sendable data
534 * @see Add(std::string_view, bool)
535 * Add(std::string_view title, bool defaultValue)
536 */
537 SimpleWidget& AddPersistent(std::string_view title, bool defaultValue);
538
539 /**
540 * Adds a widget to this container to display a simple piece of data.
541 *
542 * Unlike Add(std::string_view, double), the value in the widget will be saved
543 * on the robot and will be used when the robot program next starts rather
544 * than {@code defaultValue}.
545 *
546 * @param title the title of the widget
547 * @param defaultValue the default value of the widget
548 * @return a widget to display the sendable data
549 * @see Add(std::string_view, double)
550 * Add(std::string_view title, double defaultValue)
551 */
552 SimpleWidget& AddPersistent(std::string_view title, double defaultValue);
553
554 /**
555 * Adds a widget to this container to display a simple piece of data.
556 *
557 * Unlike Add(std::string_view, float), the value in the widget will be saved
558 * on the robot and will be used when the robot program next starts rather
559 * than {@code defaultValue}.
560 *
561 * @param title the title of the widget
562 * @param defaultValue the default value of the widget
563 * @return a widget to display the sendable data
564 * @see Add(std::string_view, float)
565 * Add(std::string_view title, float defaultValue)
566 */
567 SimpleWidget& AddPersistent(std::string_view title, float defaultValue);
568
569 /**
570 * Adds a widget to this container to display a simple piece of data.
571 *
572 * Unlike Add(std::string_view, int64_t), the value in the widget will be
573 * saved on the robot and will be used when the robot program next starts
574 * rather than {@code defaultValue}.
575 *
576 * @param title the title of the widget
577 * @param defaultValue the default value of the widget
578 * @return a widget to display the sendable data
579 * @see Add(std:string_view, int64_t)
580 * Add(std::string_view title, int64_t defaultValue)
581 */
582 SimpleWidget& AddPersistent(std::string_view title, int defaultValue);
583
584 /**
585 * Adds a widget to this container to display a simple piece of data.
586 *
587 * Unlike Add(std::string_view, std::string_view), the value in the widget
588 * will be saved on the robot and will be used when the robot program next
589 * starts rather than {@code defaultValue}.
590 *
591 * @param title the title of the widget
592 * @param defaultValue the default value of the widget
593 * @return a widget to display the sendable data
594 * @see Add(std::string_view, std::string_view)
595 * Add(std::string_view title, std::string_view defaultValue)
596 */
598 std::string_view defaultValue);
599
600 /**
601 * Adds a widget to this container to display a simple piece of data.
602 *
603 * Unlike Add(std::string_view, std::span<const bool>), the value in the
604 * widget will be saved on the robot and will be used when the robot program
605 * next starts rather than {@code defaultValue}.
606 *
607 * @param title the title of the widget
608 * @param defaultValue the default value of the widget
609 * @return a widget to display the sendable data
610 * @see Add(std::string_view, std::span<const bool>)
611 * Add(std::string_view title, std::span<const bool> defaultValue)
612 */
614 std::span<const bool> defaultValue);
615
616 /**
617 * Adds a widget to this container to display a simple piece of data.
618 *
619 * Unlike Add(std::string_view, std::span<const double>), the value in the
620 * widget will be saved on the robot and will be used when the robot program
621 * next starts rather than {@code defaultValue}.
622 *
623 * @param title the title of the widget
624 * @param defaultValue the default value of the widget
625 * @return a widget to display the sendable data
626 * @see Add(std::string_view, std::span<const double>)
627 * Add(std::string_view title, std::span<const double> defaultValue)
628 */
630 std::span<const double> defaultValue);
631
632 /**
633 * Adds a widget to this container to display a simple piece of data.
634 *
635 * Unlike Add(std::string_view, std::span<const float>), the value in the
636 * widget will be saved on the robot and will be used when the robot program
637 * next starts rather than {@code defaultValue}.
638 *
639 * @param title the title of the widget
640 * @param defaultValue the default value of the widget
641 * @return a widget to display the sendable data
642 * @see Add(std::string_view, std::span<const float>)
643 * Add(std::string_view title, std::span<const float> defaultValue)
644 */
646 std::span<const float> defaultValue);
647
648 /**
649 * Adds a widget to this container to display a simple piece of data.
650 *
651 * Unlike Add(std::string_view, std::span<const int64_t>), the value in the
652 * widget will be saved on the robot and will be used when the robot program
653 * next starts rather than {@code defaultValue}.
654 *
655 * @param title the title of the widget
656 * @param defaultValue the default value of the widget
657 * @return a widget to display the sendable data
658 * @see Add(std::string_view, std::span<const int64_t>)
659 * Add(std::string_view title, std::span<const int64_t> defaultValue)
660 */
662 std::span<const int64_t> defaultValue);
663
664 /**
665 * Adds a widget to this container to display a simple piece of data.
666 *
667 * Unlike Add(std::string_view, std::span<const std::string>), the value in
668 * the widget will be saved on the robot and will be used when the robot
669 * program next starts rather than {@code defaultValue}.
670 *
671 * @param title the title of the widget
672 * @param defaultValue the default value of the widget
673 * @return a widget to display the sendable data
674 * @see Add(std::string_view, std::span<const std::string>)
675 * Add(std::string_view title, std::span<const std::string> defaultValue)
676 */
678 std::span<const std::string> defaultValue);
679
680 void EnableIfActuator() override;
681
682 void DisableIfActuator() override;
683
684 protected:
685 bool m_isLayout = false;
686
687 private:
689 std::vector<std::unique_ptr<ShuffleboardComponentBase>> m_components;
691
692 /**
693 * Adds title to internal set if it hasn't already.
694 *
695 * @return True if title isn't in use; false otherwise.
696 */
697 void CheckTitle(std::string_view title);
698
699 friend class SimpleWidget;
700};
701
702} // namespace frc
703
704// Make use of references returned by member functions usable
708
709#ifndef DYNAMIC_CAMERA_SERVER
711
713 const cs::VideoSource& video) {
715}
716
718 std::string_view title, const cs::VideoSource& video) {
719 return Add(title, frc::SendableCameraWrapper::Wrap(video));
720}
721
723 std::string_view title, std::string_view cameraName,
724 std::span<const std::string> cameraUrls) {
725 return Add(title, frc::SendableCameraWrapper::Wrap(cameraName, cameraUrls));
726}
727#endif
This file defines the SmallSet class.
This file defines the StringMap class.
A source for video that provides a sequence of frames.
Definition: cscore_oo.h:208
A Shuffleboard widget that handles a Sendable object such as a motor controller or sensor.
Definition: ComplexWidget.h:27
Represents the type of a layout in Shuffleboard.
Definition: LayoutType.h:18
static SendableCameraWrapper & Wrap(const cs::VideoSource &source)
Gets a sendable wrapper object for the given video source, creating the wrapper if one does not alrea...
Definition: SendableCameraWrapper.h:110
Common interface for objects that can contain shuffleboard components.
Definition: ShuffleboardContainer.h:42
SimpleWidget & Add(std::string_view title, int defaultValue)
Adds a widget to this container to display the given data.
SimpleWidget & AddPersistent(std::string_view title, int defaultValue)
Adds a widget to this container to display a simple piece of data.
SuppliedValueWidget< bool > & AddBoolean(std::string_view title, std::function< bool()> supplier)
Adds a widget to this container.
SuppliedValueWidget< int64_t > & AddInteger(std::string_view title, std::function< int64_t()> supplier)
Adds a widget to this container.
SuppliedValueWidget< std::vector< uint8_t > > & AddRaw(std::string_view title, std::string_view typeString, std::function< std::vector< uint8_t >()> supplier)
Adds a widget to this container.
SuppliedValueWidget< double > & AddNumber(std::string_view title, std::function< double()> supplier)
Adds a widget to this container.
SuppliedValueWidget< std::vector< uint8_t > > & AddRaw(std::string_view title, std::function< std::vector< uint8_t >()> supplier)
Adds a widget to this container.
SuppliedValueWidget< std::vector< int > > & AddBooleanArray(std::string_view title, std::function< std::vector< int >()> supplier)
Adds a widget to this container.
SimpleWidget & Add(std::string_view title, const char *defaultValue)
Adds a widget to this container to display the given data.
ComplexWidget & Add(std::string_view title, wpi::Sendable &sendable)
Adds a widget to this container to display the given sendable.
SuppliedValueWidget< std::string > & AddString(std::string_view title, std::function< std::string()> supplier)
Adds a widget to this container.
const std::vector< std::unique_ptr< ShuffleboardComponentBase > > & GetComponents() const
Gets the components that are direct children of this container.
SuppliedValueWidget< std::vector< int64_t > > & AddIntegerArray(std::string_view title, std::function< std::vector< int64_t >()> supplier)
Adds a widget to this container.
ShuffleboardContainer(ShuffleboardContainer &&rhs)=default
SimpleWidget & AddPersistent(std::string_view title, std::span< const double > defaultValue)
Adds a widget to this container to display a simple piece of data.
SimpleWidget & Add(std::string_view title, std::span< const double > defaultValue)
Adds a widget to this container to display the given data.
SimpleWidget & AddPersistent(std::string_view title, std::span< const int64_t > defaultValue)
Adds a widget to this container to display a simple piece of data.
ShuffleboardLayout & GetLayout(std::string_view title, const LayoutType &type)
Gets the layout with the given type and title, creating it if it does not already exist at the time t...
void EnableIfActuator() override
Enables user control of this widget in the Shuffleboard application.
SimpleWidget & Add(std::string_view title, std::span< const float > defaultValue)
Adds a widget to this container to display the given data.
SimpleWidget & AddPersistent(std::string_view title, const nt::Value &defaultValue)
Adds a widget to this container to display a simple piece of data.
SimpleWidget & Add(std::string_view title, double defaultValue)
Adds a widget to this container to display the given data.
SuppliedValueWidget< std::vector< double > > & AddDoubleArray(std::string_view title, std::function< std::vector< double >()> supplier)
Adds a widget to this container.
SimpleWidget & AddPersistent(std::string_view title, float defaultValue)
Adds a widget to this container to display a simple piece of data.
SimpleWidget & AddPersistent(std::string_view title, std::string_view defaultValue)
Adds a widget to this container to display a simple piece of data.
ComplexWidget & AddCamera(std::string_view title, std::string_view cameraName, std::span< const std::string > cameraUrls)
Adds a widget to this container to display a video stream.
Definition: ShuffleboardContainer.h:722
ShuffleboardLayout & GetLayout(std::string_view title, std::string_view type)
Gets the layout with the given type and title, creating it if it does not already exist at the time t...
ShuffleboardLayout & GetLayout(std::string_view title, BuiltInLayouts type)
Gets the layout with the given type and title, creating it if it does not already exist at the time t...
SimpleWidget & Add(std::string_view title, std::string_view defaultValue)
Adds a widget to this container to display the given data.
SimpleWidget & AddPersistent(std::string_view title, bool defaultValue)
Adds a widget to this container to display a simple piece of data.
SimpleWidget & Add(std::string_view title, const nt::Value &defaultValue)
Adds a widget to this container to display the given data.
SuppliedValueWidget< float > & AddFloat(std::string_view title, std::function< float()> supplier)
Adds a widget to this container.
SimpleWidget & Add(std::string_view title, bool defaultValue)
Adds a widget to this container to display the given data.
bool m_isLayout
Definition: ShuffleboardContainer.h:685
SuppliedValueWidget< std::vector< double > > & AddNumberArray(std::string_view title, std::function< std::vector< double >()> supplier)
Adds a widget to this container.
SimpleWidget & AddPersistent(std::string_view title, std::span< const bool > defaultValue)
Adds a widget to this container to display a simple piece of data.
void DisableIfActuator() override
Disables user control of this widget in the Shuffleboard application.
~ShuffleboardContainer() override=default
SimpleWidget & AddPersistent(std::string_view title, std::span< const std::string > defaultValue)
Adds a widget to this container to display a simple piece of data.
SimpleWidget & Add(std::string_view title, std::span< const int64_t > defaultValue)
Adds a widget to this container to display the given data.
ComplexWidget & Add(wpi::Sendable &sendable)
Adds a widget to this container to display the given sendable.
SuppliedValueWidget< std::vector< std::string > > & AddStringArray(std::string_view title, std::function< std::vector< std::string >()> supplier)
Adds a widget to this container.
SuppliedValueWidget< std::vector< float > > & AddFloatArray(std::string_view title, std::function< std::vector< float >()> supplier)
Adds a widget to this container.
SimpleWidget & Add(std::string_view title, std::span< const std::string > defaultValue)
Adds a widget to this container to display the given data.
SimpleWidget & Add(std::string_view title, std::span< const bool > defaultValue)
Adds a widget to this container to display the given data.
ShuffleboardLayout & GetLayout(std::string_view title)
Gets the already-defined layout in this container with the given title.
ShuffleboardContainer(std::string_view title)
SimpleWidget & AddPersistent(std::string_view title, std::span< const float > defaultValue)
Adds a widget to this container to display a simple piece of data.
SimpleWidget & Add(std::string_view title, float defaultValue)
Adds a widget to this container to display the given data.
SimpleWidget & AddPersistent(std::string_view title, double defaultValue)
Adds a widget to this container to display a simple piece of data.
SuppliedValueWidget< double > & AddDouble(std::string_view title, std::function< double()> supplier)
Adds a widget to this container.
A layout in a Shuffleboard tab.
Definition: ShuffleboardLayout.h:27
Definition: ShuffleboardValue.h:15
A Shuffleboard widget that handles a single data point such as a number or string.
Definition: SimpleWidget.h:24
Definition: SuppliedValueWidget.h:25
A network table entry value.
Definition: NetworkTableValue.h:32
Interface for Sendable objects.
Definition: Sendable.h:16
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:116
basic_string_view< char > string_view
Definition: core.h:501
CameraServer (cscore) namespace.
Definition: cscore_oo.inc:16
type
Definition: core.h:556
Definition: AprilTagPoseEstimator.h:15
BuiltInLayouts
The types of layouts bundled with Shuffleboard.
Definition: BuiltInLayouts.h:19
Definition: ntcore_cpp.h:26