mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21: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
@@ -61,7 +61,7 @@ public abstract class RobotBase {
|
||||
inst.setNetworkIdentity("Robot");
|
||||
inst.startServer("/home/lvuser/networktables.ini");
|
||||
m_ds = DriverStation.getInstance();
|
||||
inst.getTable("LiveWindow").getSubTable("~STATUS~").getEntry("LW Enabled").setBoolean(false);
|
||||
inst.getTable("LiveWindow").getSubTable(".status").getEntry("LW Enabled").setBoolean(false);
|
||||
|
||||
LiveWindow.setEnabled(false);
|
||||
}
|
||||
|
||||
@@ -575,8 +575,8 @@ public abstract class Command implements NamedSendable {
|
||||
}
|
||||
if (table != null) {
|
||||
m_runningEntry = table.getEntry("running");
|
||||
m_isParentedEntry = table.getEntry("isParented");
|
||||
table.getEntry("name").setString(getName());
|
||||
m_isParentedEntry = table.getEntry(".isParented");
|
||||
table.getEntry(".name").setString(getName());
|
||||
m_runningEntry.setBoolean(isRunning());
|
||||
m_isParentedEntry.setBoolean(m_parent != null);
|
||||
m_runningListener = m_runningEntry.addListener((event) -> {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class LiveWindow {
|
||||
private static void initializeLiveWindowComponents() {
|
||||
System.out.println("Initializing the components first time");
|
||||
livewindowTable = NetworkTableInstance.getDefault().getTable("LiveWindow");
|
||||
statusTable = livewindowTable.getSubTable("~STATUS~");
|
||||
statusTable = livewindowTable.getSubTable(".status");
|
||||
enabledEntry = statusTable.getEntry("LW Enabled");
|
||||
for (Enumeration e = components.keys(); e.hasMoreElements(); ) {
|
||||
LiveWindowSendable component = (LiveWindowSendable) e.nextElement();
|
||||
@@ -49,11 +49,11 @@ public class LiveWindow {
|
||||
String subsystem = liveWindowComponent.getSubsystem();
|
||||
String name = liveWindowComponent.getName();
|
||||
System.out.println("Initializing table for '" + subsystem + "' '" + name + "'");
|
||||
livewindowTable.getSubTable(subsystem).getEntry("~TYPE~").setString("LW Subsystem");
|
||||
livewindowTable.getSubTable(subsystem).getEntry(".type").setString("LW Subsystem");
|
||||
NetworkTable table = livewindowTable.getSubTable(subsystem).getSubTable(name);
|
||||
table.getEntry("~TYPE~").setString(component.getSmartDashboardType());
|
||||
table.getEntry("Name").setString(name);
|
||||
table.getEntry("Subsystem").setString(subsystem);
|
||||
table.getEntry(".type").setString(component.getSmartDashboardType());
|
||||
table.getEntry(".name").setString(name);
|
||||
table.getEntry(".subsystem").setString(subsystem);
|
||||
component.initTable(table);
|
||||
if (liveWindowComponent.isSensor()) {
|
||||
sensors.addElement(component);
|
||||
|
||||
@@ -51,7 +51,7 @@ public class SmartDashboard {
|
||||
*/
|
||||
public static void putData(String key, Sendable data) {
|
||||
NetworkTable dataTable = table.getSubTable(key);
|
||||
dataTable.getEntry("~TYPE~").setString(data.getSmartDashboardType());
|
||||
dataTable.getEntry(".type").setString(data.getSmartDashboardType());
|
||||
data.initTable(dataTable);
|
||||
tablesToData.put(dataTable, data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user