Remove GetTable from wpilibc Sendable interface.

This allows nearly all m_table member variables to be removed.
This commit is contained in:
Peter Johnson
2017-09-02 00:35:30 -07:00
parent 040a8c6bcc
commit 0d4fde17e0
57 changed files with 87 additions and 259 deletions

View File

@@ -60,11 +60,10 @@ std::string BuiltInAccelerometer::GetSmartDashboardType() const {
void BuiltInAccelerometer::InitTable(
std::shared_ptr<nt::NetworkTable> subtable) {
m_table = subtable;
if (m_table != nullptr) {
m_xEntry = m_table->GetEntry("X");
m_yEntry = m_table->GetEntry("Y");
m_zEntry = m_table->GetEntry("Z");
if (subtable != nullptr) {
m_xEntry = subtable->GetEntry("X");
m_yEntry = subtable->GetEntry("Y");
m_zEntry = subtable->GetEntry("Z");
UpdateTable();
} else {
m_xEntry = nt::NetworkTableEntry();
@@ -78,7 +77,3 @@ void BuiltInAccelerometer::UpdateTable() {
if (m_yEntry) m_yEntry.SetDouble(GetY());
if (m_zEntry) m_zEntry.SetDouble(GetZ());
}
std::shared_ptr<nt::NetworkTable> BuiltInAccelerometer::GetTable() const {
return m_table;
}