mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
[wpilib] Fix Shuffleboard SuppliedValueWidget (#4559)
It was creating duplicate publishers.
This commit is contained in:
@@ -36,12 +36,16 @@ class SuppliedValueWidget : public ShuffleboardWidget<SuppliedValueWidget<T>> {
|
||||
void BuildInto(std::shared_ptr<nt::NetworkTable> parentTable,
|
||||
std::shared_ptr<nt::NetworkTable> metaTable) override {
|
||||
this->BuildMetadata(metaTable);
|
||||
m_controllablePub =
|
||||
nt::BooleanTopic{metaTable->GetTopic("Controllable")}.Publish();
|
||||
m_controllablePub.Set(false);
|
||||
if (!m_controllablePub) {
|
||||
m_controllablePub =
|
||||
nt::BooleanTopic{metaTable->GetTopic("Controllable")}.Publish();
|
||||
m_controllablePub.Set(false);
|
||||
}
|
||||
|
||||
m_entry =
|
||||
parentTable->GetTopic(this->GetTitle()).GenericPublish(m_typeString);
|
||||
if (!m_entry) {
|
||||
m_entry =
|
||||
parentTable->GetTopic(this->GetTitle()).GenericPublish(m_typeString);
|
||||
}
|
||||
m_setter(m_entry, m_supplier());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user