mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add a .controllable key as a standard part of Sendable (#1225)
This indicates whether or not the Sendable listeners are installed. It is set to true when SendableBuilder.startListeners() starts the listeners, and set to false when SendableBuilder.stopListeners() stops the listeners. This allows dashboards to choose to change their widget display based on whether or not the value is actually controllable.
This commit is contained in:
@@ -14,6 +14,7 @@ using namespace frc;
|
||||
|
||||
void SendableBuilderImpl::SetTable(std::shared_ptr<nt::NetworkTable> table) {
|
||||
m_table = table;
|
||||
m_controllableEntry = table->GetEntry(".controllable");
|
||||
}
|
||||
|
||||
std::shared_ptr<nt::NetworkTable> SendableBuilderImpl::GetTable() {
|
||||
@@ -30,10 +31,12 @@ void SendableBuilderImpl::UpdateTable() {
|
||||
|
||||
void SendableBuilderImpl::StartListeners() {
|
||||
for (auto& property : m_properties) property.StartListener();
|
||||
m_controllableEntry.SetBoolean(true);
|
||||
}
|
||||
|
||||
void SendableBuilderImpl::StopListeners() {
|
||||
for (auto& property : m_properties) property.StopListener();
|
||||
m_controllableEntry.SetBoolean(false);
|
||||
}
|
||||
|
||||
void SendableBuilderImpl::StartLiveWindowMode() {
|
||||
|
||||
Reference in New Issue
Block a user