mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ntcore] NetworkTables 4 (#3217)
This commit is contained in:
@@ -20,16 +20,16 @@ void MechanismRoot2d::SetPosition(double x, double y) {
|
||||
}
|
||||
|
||||
void MechanismRoot2d::UpdateEntries(std::shared_ptr<nt::NetworkTable> table) {
|
||||
m_xEntry = table->GetEntry("x");
|
||||
m_yEntry = table->GetEntry("y");
|
||||
m_xPub = table->GetDoubleTopic("x").Publish();
|
||||
m_yPub = table->GetDoubleTopic("y").Publish();
|
||||
Flush();
|
||||
}
|
||||
|
||||
inline void MechanismRoot2d::Flush() {
|
||||
if (m_xEntry) {
|
||||
m_xEntry.SetDouble(m_x);
|
||||
if (m_xPub) {
|
||||
m_xPub.Set(m_x);
|
||||
}
|
||||
if (m_yEntry) {
|
||||
m_yEntry.SetDouble(m_y);
|
||||
if (m_yPub) {
|
||||
m_yPub.Set(m_y);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user