mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[ntcore] Notify locally on SetDefault (#4617)
This is necessary for the simulation GUI to pick up default publishes.
This commit is contained in:
@@ -1234,7 +1234,7 @@ bool LSImpl::SetDefaultEntryValue(NT_Handle pubsubentryHandle,
|
||||
}
|
||||
if (auto topic = GetTopic(pubsubentryHandle)) {
|
||||
if (topic->type == NT_UNASSIGNED || topic->type == value.type()) {
|
||||
// set without notifying
|
||||
// force value timestamps to 0
|
||||
topic->type = value.type();
|
||||
topic->lastValue = value;
|
||||
topic->lastValue.SetTime(0);
|
||||
@@ -1249,9 +1249,7 @@ bool LSImpl::SetDefaultEntryValue(NT_Handle pubsubentryHandle,
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (publisher->active && m_network) {
|
||||
m_network->SetValue(publisher->handle, value);
|
||||
}
|
||||
PublishLocalValue(publisher, topic->lastValue);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user