mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Remove GetTable from wpilibc Sendable interface.
This allows nearly all m_table member variables to be removed.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user