mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Change metadata format to dotfile, make certain entries metadata (#666)
Sendable's "Name" is now ".name" Sendable's "Subsystem" is now ".subsystem" Command's "name" is now ".name" Command's "isParented" is now ".isParented"
This commit is contained in:
committed by
Peter Johnson
parent
ba3a85d0cc
commit
f0cc623241
@@ -17,9 +17,9 @@
|
||||
|
||||
using namespace frc;
|
||||
|
||||
static const std::string kName = "name";
|
||||
static const std::string kName = ".name";
|
||||
static const std::string kRunning = "running";
|
||||
static const std::string kIsParented = "isParented";
|
||||
static const std::string kIsParented = ".isParented";
|
||||
|
||||
int Command::m_commandCounter = 0;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ LiveWindow* LiveWindow::GetInstance() {
|
||||
LiveWindow::LiveWindow() : m_scheduler(Scheduler::GetInstance()) {
|
||||
m_liveWindowTable =
|
||||
nt::NetworkTableInstance::GetDefault().GetTable("LiveWindow");
|
||||
m_statusTable = m_liveWindowTable->GetSubTable("~STATUS~");
|
||||
m_statusTable = m_liveWindowTable->GetSubTable(".status");
|
||||
m_enabledEntry = m_statusTable->GetEntry("LW Enabled");
|
||||
}
|
||||
|
||||
@@ -231,12 +231,12 @@ void LiveWindow::InitializeLiveWindowComponents() {
|
||||
LiveWindowComponent c = elem.second;
|
||||
std::string subsystem = c.subsystem;
|
||||
std::string name = c.name;
|
||||
m_liveWindowTable->GetSubTable(subsystem)->GetEntry("~TYPE~").SetString(
|
||||
m_liveWindowTable->GetSubTable(subsystem)->GetEntry(".type").SetString(
|
||||
"LW Subsystem");
|
||||
std::shared_ptr<NetworkTable> table(
|
||||
m_liveWindowTable->GetSubTable(subsystem)->GetSubTable(name));
|
||||
table->GetEntry("~TYPE~").SetString(component->GetSmartDashboardType());
|
||||
table->GetEntry("Name").SetString(name);
|
||||
table->GetEntry(".type").SetString(component->GetSmartDashboardType());
|
||||
table->GetEntry(".name").SetString(name);
|
||||
table->GetEntry("Subsystem").SetString(subsystem);
|
||||
component->InitTable(table);
|
||||
if (c.isSensor) {
|
||||
|
||||
@@ -59,7 +59,7 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
|
||||
|
||||
// First and one-time initialization
|
||||
inst.GetTable("LiveWindow")
|
||||
->GetSubTable("~STATUS~")
|
||||
->GetSubTable(".status")
|
||||
->GetEntry("LW Enabled")
|
||||
.SetBoolean(false);
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void SmartDashboard::PutData(llvm::StringRef key, Sendable* data) {
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<nt::NetworkTable> dataTable(s_table->GetSubTable(key));
|
||||
dataTable->GetEntry("~TYPE~").SetString(data->GetSmartDashboardType());
|
||||
dataTable->GetEntry(".type").SetString(data->GetSmartDashboardType());
|
||||
data->InitTable(dataTable);
|
||||
s_tablesToData[dataTable] = data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user