diff --git a/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp b/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp index 1d05be3073..fb30724fa4 100644 --- a/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp +++ b/wpilibc/src/main/native/cpp/smartdashboard/SendableBuilderImpl.cpp @@ -14,6 +14,7 @@ using namespace frc; void SendableBuilderImpl::SetTable(std::shared_ptr table) { m_table = table; + m_controllableEntry = table->GetEntry(".controllable"); } std::shared_ptr 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() { diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h b/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h index ab80d4c6ce..a10098a244 100644 --- a/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h +++ b/wpilibc/src/main/native/include/frc/smartdashboard/SendableBuilderImpl.h @@ -187,6 +187,7 @@ class SendableBuilderImpl : public SendableBuilder { std::function m_safeState; std::function m_updateTable; std::shared_ptr m_table; + nt::NetworkTableEntry m_controllableEntry; }; } // namespace frc diff --git a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java index 7f78eeb716..44445de099 100644 --- a/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java +++ b/wpilibj/src/main/java/edu/wpi/first/wpilibj/smartdashboard/SendableBuilderImpl.java @@ -57,6 +57,7 @@ public class SendableBuilderImpl implements SendableBuilder { private Runnable m_safeState; private Runnable m_updateTable; private NetworkTable m_table; + private NetworkTableEntry m_controllableEntry; /** * Set the network table. Must be called prior to any Add* functions being @@ -65,6 +66,7 @@ public class SendableBuilderImpl implements SendableBuilder { */ public void setTable(NetworkTable table) { m_table = table; + m_controllableEntry = table.getEntry(".controllable"); } /** @@ -96,6 +98,7 @@ public class SendableBuilderImpl implements SendableBuilder { for (Property property : m_properties) { property.startListener(); } + m_controllableEntry.setBoolean(true); } /** @@ -105,6 +108,7 @@ public class SendableBuilderImpl implements SendableBuilder { for (Property property : m_properties) { property.stopListener(); } + m_controllableEntry.setBoolean(false); } /**