mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Add methods to change the selected tab in the Shuffleboard app (#1448)
This commit is contained in:
committed by
Peter Johnson
parent
a60f312d19
commit
6f0c185a05
@@ -82,6 +82,22 @@ class Shuffleboard final {
|
||||
*/
|
||||
static ShuffleboardTab& GetTab(wpi::StringRef title);
|
||||
|
||||
/**
|
||||
* Selects the tab in the dashboard with the given index in the range
|
||||
* [0..n-1], where <i>n</i> is the number of tabs in the dashboard at the time
|
||||
* this method is called.
|
||||
*
|
||||
* @param index the index of the tab to select
|
||||
*/
|
||||
static void SelectTab(int index);
|
||||
|
||||
/**
|
||||
* Selects the tab in the dashboard with the given title.
|
||||
*
|
||||
* @param title the title of the tab to select
|
||||
*/
|
||||
static void SelectTab(wpi::StringRef title);
|
||||
|
||||
/**
|
||||
* Enables user control of widgets containing actuators: speed controllers,
|
||||
* relays, etc. This should only be used when the robot is in test mode.
|
||||
|
||||
@@ -28,6 +28,10 @@ class ShuffleboardInstance final : public ShuffleboardRoot {
|
||||
|
||||
void DisableActuatorWidgets() override;
|
||||
|
||||
void SelectTab(int index) override;
|
||||
|
||||
void SelectTab(wpi::StringRef) override;
|
||||
|
||||
private:
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> m_impl;
|
||||
|
||||
@@ -45,6 +45,22 @@ class ShuffleboardRoot {
|
||||
* actuators.
|
||||
*/
|
||||
virtual void DisableActuatorWidgets() = 0;
|
||||
|
||||
/**
|
||||
* Selects the tab in the dashboard with the given index in the range
|
||||
* [0..n-1], where <i>n</i> is the number of tabs in the dashboard at the time
|
||||
* this method is called.
|
||||
*
|
||||
* @param index the index of the tab to select
|
||||
*/
|
||||
virtual void SelectTab(int index) = 0;
|
||||
|
||||
/**
|
||||
* Selects the tab in the dashboard with the given title.
|
||||
*
|
||||
* @param title the title of the tab to select
|
||||
*/
|
||||
virtual void SelectTab(wpi::StringRef title) = 0;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user