mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[wpilib] Sendable: Don't call setter for getter changes
This commit is contained in:
@@ -130,7 +130,8 @@ void SendableBuilderImpl::AddPropertyImpl(Topic topic, Getter getter,
|
||||
};
|
||||
}
|
||||
if (setter) {
|
||||
prop->sub = topic.Subscribe({});
|
||||
prop->sub = topic.Subscribe(
|
||||
{}, {{nt::PubSubOption::ExcludePublisher(prop->pub.GetHandle())}});
|
||||
prop->updateLocal = [=](auto& sub) {
|
||||
for (auto&& val : sub.ReadQueue()) {
|
||||
setter(val.value);
|
||||
@@ -223,7 +224,9 @@ void SendableBuilderImpl::AddRawProperty(
|
||||
};
|
||||
}
|
||||
if (setter) {
|
||||
prop->sub = topic.Subscribe(typeString, {});
|
||||
prop->sub = topic.Subscribe(
|
||||
typeString, {},
|
||||
{{nt::PubSubOption::ExcludePublisher(prop->pub.GetHandle())}});
|
||||
prop->updateLocal = [=](auto& sub) {
|
||||
for (auto&& val : sub.ReadQueue()) {
|
||||
setter(val.value);
|
||||
@@ -246,7 +249,8 @@ void SendableBuilderImpl::AddSmallPropertyImpl(Topic topic, Getter getter,
|
||||
};
|
||||
}
|
||||
if (setter) {
|
||||
prop->sub = topic.Subscribe({});
|
||||
prop->sub = topic.Subscribe(
|
||||
{}, {{nt::PubSubOption::ExcludePublisher(prop->pub.GetHandle())}});
|
||||
prop->updateLocal = [=](auto& sub) {
|
||||
for (auto&& val : sub.ReadQueue()) {
|
||||
setter(val.value);
|
||||
@@ -324,7 +328,9 @@ void SendableBuilderImpl::AddSmallRawProperty(
|
||||
};
|
||||
}
|
||||
if (setter) {
|
||||
prop->sub = topic.Subscribe(typeString, {});
|
||||
prop->sub = topic.Subscribe(
|
||||
typeString, {},
|
||||
{{nt::PubSubOption::ExcludePublisher(prop->pub.GetHandle())}});
|
||||
prop->updateLocal = [=](auto& sub) {
|
||||
for (auto&& val : sub.ReadQueue()) {
|
||||
setter(val.value);
|
||||
|
||||
Reference in New Issue
Block a user