Move subsystem command metadata to metadata key format (#863)

This commit is contained in:
Sam Carlberg
2018-01-01 17:05:03 -05:00
committed by bradamiller
parent 55b6764d50
commit 8346caed9c
2 changed files with 8 additions and 8 deletions

View File

@@ -207,12 +207,12 @@ void Subsystem::InitSendable(SendableBuilder& builder) {
builder.SetSmartDashboardType("Subsystem");
builder.AddBooleanProperty(
"hasDefault", [=]() { return m_defaultCommand != nullptr; }, nullptr);
builder.AddStringProperty("default",
".hasDefault", [=]() { return m_defaultCommand != nullptr; }, nullptr);
builder.AddStringProperty(".default",
[=]() { return GetDefaultCommandName(); }, nullptr);
builder.AddBooleanProperty(
"hasCommand", [=]() { return m_currentCommand != nullptr; }, nullptr);
builder.AddStringProperty("command",
".hasCommand", [=]() { return m_currentCommand != nullptr; }, nullptr);
builder.AddStringProperty(".command",
[=]() { return GetCurrentCommandName(); }, nullptr);
}

View File

@@ -213,9 +213,9 @@ public abstract class Subsystem extends SendableBase implements Sendable {
public void initSendable(SendableBuilder builder) {
builder.setSmartDashboardType("Subsystem");
builder.addBooleanProperty("hasDefault", () -> m_defaultCommand != null, null);
builder.addStringProperty("default", this::getDefaultCommandName, null);
builder.addBooleanProperty("hasCommand", () -> m_currentCommand != null, null);
builder.addStringProperty("command", this::getCurrentCommandName, null);
builder.addBooleanProperty(".hasDefault", () -> m_defaultCommand != null, null);
builder.addStringProperty(".default", this::getDefaultCommandName, null);
builder.addBooleanProperty(".hasCommand", () -> m_currentCommand != null, null);
builder.addStringProperty(".command", this::getCurrentCommandName, null);
}
}