Add methods to change the selected tab in the Shuffleboard app (#1448)

This commit is contained in:
Sam Carlberg
2018-11-28 01:12:50 -05:00
committed by Peter Johnson
parent a60f312d19
commit 6f0c185a05
8 changed files with 97 additions and 0 deletions

View File

@@ -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.

View File

@@ -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;

View File

@@ -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