mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Update wpilibc to use new NetworkTables package and interfaces.
This commit is contained in:
@@ -30,9 +30,7 @@ double GyroBase::PIDGet() {
|
||||
}
|
||||
|
||||
void GyroBase::UpdateTable() {
|
||||
if (m_table != nullptr) {
|
||||
m_table->PutNumber("Value", GetAngle());
|
||||
}
|
||||
if (m_valueEntry) m_valueEntry.SetDouble(GetAngle());
|
||||
}
|
||||
|
||||
void GyroBase::StartLiveWindowMode() {}
|
||||
@@ -41,9 +39,14 @@ void GyroBase::StopLiveWindowMode() {}
|
||||
|
||||
std::string GyroBase::GetSmartDashboardType() const { return "Gyro"; }
|
||||
|
||||
void GyroBase::InitTable(std::shared_ptr<ITable> subTable) {
|
||||
void GyroBase::InitTable(std::shared_ptr<nt::NetworkTable> subTable) {
|
||||
m_table = subTable;
|
||||
UpdateTable();
|
||||
if (m_table) {
|
||||
m_valueEntry = m_table->GetEntry("Value");
|
||||
UpdateTable();
|
||||
} else {
|
||||
m_valueEntry = nt::NetworkTableEntry();
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<ITable> GyroBase::GetTable() const { return m_table; }
|
||||
std::shared_ptr<nt::NetworkTable> GyroBase::GetTable() const { return m_table; }
|
||||
|
||||
Reference in New Issue
Block a user