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

@@ -189,16 +189,15 @@ std::string PowerDistributionPanel::GetSmartDashboardType() const {
void PowerDistributionPanel::InitTable(
std::shared_ptr<nt::NetworkTable> subTable) {
m_table = subTable;
if (m_table != nullptr) {
if (subTable != nullptr) {
for (size_t i = 0; i < sizeof(m_chanEntry) / sizeof(m_chanEntry[0]); ++i) {
llvm::SmallString<32> buf;
llvm::raw_svector_ostream oss(buf);
oss << "Chan" << i;
m_chanEntry[i] = m_table->GetEntry(oss.str());
m_chanEntry[i] = subTable->GetEntry(oss.str());
}
m_voltageEntry = m_table->GetEntry("Voltage");
m_totalCurrentEntry = m_table->GetEntry("TotalCurrent");
m_voltageEntry = subTable->GetEntry("Voltage");
m_totalCurrentEntry = subTable->GetEntry("TotalCurrent");
UpdateTable();
} else {
for (size_t i = 0; i < sizeof(m_chanEntry) / sizeof(m_chanEntry[0]); ++i) {
@@ -208,7 +207,3 @@ void PowerDistributionPanel::InitTable(
m_totalCurrentEntry = nt::NetworkTableEntry();
}
}
std::shared_ptr<nt::NetworkTable> PowerDistributionPanel::GetTable() const {
return m_table;
}