mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Allow video sources to be added to Shuffleboard (#1453)
Add a Sendable wrapper for VideoSource objects. Add convenience methods for adding video sources directly to containers so users won't have to manually wrap video sources.
This commit is contained in:
committed by
Peter Johnson
parent
a2368a6199
commit
80f87ff8ad
@@ -24,6 +24,10 @@
|
||||
#include "frc/shuffleboard/ShuffleboardComponentBase.h"
|
||||
#include "frc/shuffleboard/ShuffleboardValue.h"
|
||||
|
||||
namespace cs {
|
||||
class VideoSource;
|
||||
} // namespace cs
|
||||
|
||||
namespace frc {
|
||||
|
||||
class ComplexWidget;
|
||||
@@ -104,6 +108,17 @@ class ShuffleboardContainer : public virtual ShuffleboardValue,
|
||||
*/
|
||||
ComplexWidget& Add(const wpi::Twine& title, Sendable& sendable);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display the given video stream.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param video the video stream to display
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
*/
|
||||
ComplexWidget& Add(const wpi::Twine& title, const cs::VideoSource& video);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display the given sendable.
|
||||
*
|
||||
@@ -115,6 +130,16 @@ class ShuffleboardContainer : public virtual ShuffleboardValue,
|
||||
*/
|
||||
ComplexWidget& Add(Sendable& sendable);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display the given video stream.
|
||||
*
|
||||
* @param video the video to display
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the same title as the video source
|
||||
*/
|
||||
ComplexWidget& Add(const cs::VideoSource& video);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display the given data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user