SubZero Common
Common library components for an FRC CommandRobot
|
Each key of type T has a vector<string> of tags; accepts a list of groups that each have a name and list of possible tags that are mutually exclusive. The ANY option is automatically included in all group selectors to indicate the lack of a selection. When a selection is made, the intersection of all selections is created based on T's list of tags. More...
#include <TaggedChooser.h>
Public Types | |
using | TaggedChooserValue = std::pair<TKey, std::string> |
A pair composed of the key and its name. | |
using | TaggedChooserEntry |
A pair composed of TaggedChooserValue and a set of associated tags. | |
using | TaggedChooserSelectorGroup |
Describes a single group which has a name and a set of available tags from which to choose. | |
Public Member Functions | |
TaggedChooser (const std::vector< TaggedChooserEntry > &entries, const std::vector< TaggedChooserSelectorGroup > &groups, std::string chooserName) | |
Construct a new TaggedChooser. | |
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. | |
void | PopulateChooser (void) |
Repopulate the chooser based on the selected group filters. | |
TKey | GetSelectedValue () |
Get the currently-selected option. | |
Each key of type T has a vector<string> of tags; accepts a list of groups that each have a name and list of possible tags that are mutually exclusive. The ANY option is automatically included in all group selectors to indicate the lack of a selection. When a selection is made, the intersection of all selections is created based on T's list of tags.
TKey |
Definition at line 27 of file TaggedChooser.h.
using subzero::TaggedChooser< TKey >::TaggedChooserEntry |
A pair composed of TaggedChooserValue and a set of associated tags.
Definition at line 38 of file TaggedChooser.h.
using subzero::TaggedChooser< TKey >::TaggedChooserSelectorGroup |
Describes a single group which has a name and a set of available tags from which to choose.
Definition at line 45 of file TaggedChooser.h.
using subzero::TaggedChooser< TKey >::TaggedChooserValue = std::pair<TKey, std::string> |
A pair composed of the key and its name.
Definition at line 33 of file TaggedChooser.h.
subzero::TaggedChooser< TKey >::TaggedChooser | ( | const std::vector< TaggedChooserEntry > & | entries, |
const std::vector< TaggedChooserSelectorGroup > & | groups, | ||
std::string | chooserName ) |
Construct a new TaggedChooser.
entries | List of filterable entries |
groups | List of group selectors |
chooserName | Name of the TaggedChooser in SmartDashboard |
std::vector< TaggedChooserValue > subzero::TaggedChooser< TKey >::GetAvailableEntries | ( | void | ) |
Get the list of all available entries in the selector.
|
inline |
void subzero::TaggedChooser< TKey >::Initialize | ( | void | ) |
Call this one on startup to populate and push to SmartDashboard.
void subzero::TaggedChooser< TKey >::PopulateChooser | ( | void | ) |
Repopulate the chooser based on the selected group filters.
void subzero::TaggedChooser< TKey >::SetOnChangeCallback | ( | std::function< void(TKey)> | cb | ) |
Register a callback that gets executed each time the selected option changes.
cb |