Log in

View Full Version : SFX Dashboard Tabs


phurley67
23-11-2016, 11:25
Is it possible to change the name of a tab? Even better does anyone know a way to change the displayed tab, from the robot? For example switch from a an auton display to a different display for teleop.


Thanks

euhlmann
23-11-2016, 13:18
I believe you can edit the file directly. It's a tar with YAML for the layout inside. Just change the "name" field for the tab

phurley67
23-11-2016, 16:57
Thanks, I peeked at the file and did not realize it was a tar file (I could see the yaml, but was not going to change it with all the binary noise at the top).

It worked, now if I could only figure out a way to switch tabs programatically.

euhlmann
23-11-2016, 17:29
Don't think it's possible. You should make your own dashboard; it's quite easy.

First, get the NetworkTables library. You can build the official C++ and Java libraries using the project source code (https://github.com/wpilibsuite/ntcore) (follow readme.md instructions, then add to your project in C++ or Java). There is also Python (https://github.com/robotpy/pynetworktables), C# (https://github.com/robotdotnet/NetworkTablesCore), and node.js (https://github.com/erikuhlmann/ntcore_node) (disclaimer: my own project, used for my webkit smartdashboard)

Then, you can connect to the robot as follows (Java)

// sets the address to roborio-862-frc.local
// You can also use setIPAddress(String address)
NetworkTable.setTeam(862);
NetworkTable.setClientMode();
NetworkTable.init();

// the table for the WPILib SmartDashboard class
// Preferences and LiveWindow are Preferences and LiveWindow
NetworkTable smartDashboard = NetworkTable.getTable("SmartDashboard");
// the default value parameter is returned from get*() if the client is not connected
double defaultValue = 0;
System.out.println(smartDashboard.getNumber("myNumberVariable", defaultValue));