3#include <frc/shuffleboard/Shuffleboard.h>
4#include <frc/smartdashboard/SendableChooser.h>
5#include <frc/smartdashboard/SmartDashboard.h>
14#include "subzero/frc/smartdashboard/ModifiableChooser.cpp"
39 std::pair<TaggedChooserValue, std::set<std::string>>;
46 std::pair<std::string, std::set<std::string>>;
56 const std::vector<TaggedChooserSelectorGroup> &groups,
57 std::string chooserName);
94 struct TaggedChooserSendableGroup {
96 std::unique_ptr<frc::SendableChooser<std::string>> chooser;
98 std::function<void(TKey)> m_onChangeCb;
99 std::vector<TaggedChooserEntry> m_entries;
100 std::vector<TaggedChooserSendableGroup> m_groups;
101 ModifiableChooser<TKey> m_chooser;
102 std::string m_chooserName;
T GetSelected()
Get the selected option.
Each key of type T has a vector<string> of tags; accepts a list of groups that each have a name and l...
void PopulateChooser(void)
Repopulate the chooser based on the selected group filters.
TaggedChooser(const std::vector< TaggedChooserEntry > &entries, const std::vector< TaggedChooserSelectorGroup > &groups, std::string chooserName)
Construct a new TaggedChooser.
std::pair< TaggedChooserValue, std::set< std::string > > TaggedChooserEntry
A pair composed of TaggedChooserValue and a set of associated tags.
std::pair< TKey, std::string > TaggedChooserValue
A pair composed of the key and its name.
std::pair< std::string, std::set< std::string > > TaggedChooserSelectorGroup
Describes a single group which has a name and a set of available tags from which to choose.
TKey GetSelectedValue()
Get the currently-selected option.
void Initialize(void)
Call this one on startup to populate and push to SmartDashboard.
void SetOnChangeCallback(std::function< void(TKey)> cb)
Register a callback that gets executed each time the selected option changes.
std::vector< TaggedChooserValue > GetAvailableEntries(void)
Get the list of all available entries in the selector.