Add confirmation to SendableChooser (#1217)

This echos back the "selected" value to the "active" key to enable dashboards
to display positive feedback to the user that the value is actually set on
the robot side.

Also fixes SendableChooser so it can be safely added to multiple tables.
Changes to "selected" in any table will result in all "active" values being
updated.

Now that adding SendableChooser to multiple tables is supported, an ".instance"
key enables dashboards to treat the same SendableChooser as a common instance
if desired.
This commit is contained in:
Peter Johnson
2018-07-28 10:43:47 -07:00
committed by GitHub
parent 397a296e25
commit 5fafaf6272
4 changed files with 99 additions and 12 deletions

View File

@@ -9,4 +9,7 @@
using namespace frc;
SendableChooserBase::SendableChooserBase() : SendableBase(false) {}
std::atomic_int SendableChooserBase::s_instances{0};
SendableChooserBase::SendableChooserBase()
: SendableBase(false), m_instance{s_instances++} {}