SmartDashboard override .name entry in putData(String, Sendable) (#866)

Fixes #865
This commit is contained in:
Sam Carlberg
2018-01-02 14:39:16 -08:00
committed by Peter Johnson
parent 0ef9803363
commit ee33296e1f
2 changed files with 6 additions and 2 deletions

View File

@@ -162,10 +162,12 @@ void SmartDashboard::PutData(llvm::StringRef key, Sendable* data) {
auto& sddata = inst.tablesToData[key];
if (!sddata.sendable || sddata.sendable != data) {
sddata = SmartDashboardData(data);
sddata.builder.SetTable(inst.table->GetSubTable(key));
auto dataTable = inst.table->GetSubTable(key);
sddata.builder.SetTable(dataTable);
data->InitSendable(sddata.builder);
sddata.builder.UpdateTable();
sddata.builder.StartListeners();
dataTable->GetEntry(".name").SetString(key);
}
}