Update wpilibc to use new NetworkTables package and interfaces.

This commit is contained in:
Peter Johnson
2017-09-02 00:17:43 -07:00
parent 4e80570c4c
commit 040a8c6bcc
74 changed files with 937 additions and 721 deletions

View File

@@ -19,7 +19,7 @@
#include "SmartDashboard/SmartDashboard.h"
#include "Utility.h"
#include "WPILibVersion.h"
#include "networktables/NetworkTable.h"
#include "networktables/NetworkTableInstance.h"
using namespace frc;
@@ -42,8 +42,9 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
RobotState::SetImplementation(DriverStation::GetInstance());
HLUsageReporting::SetImplementation(new HardwareHLReporting());
NetworkTable::SetNetworkIdentity("Robot");
NetworkTable::SetPersistentFilename("/home/lvuser/networktables.ini");
auto inst = nt::NetworkTableInstance::GetDefault();
inst.SetNetworkIdentity("Robot");
inst.StartServer("/home/lvuser/networktables.ini");
SmartDashboard::init();
@@ -57,9 +58,10 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
}
// First and one-time initialization
NetworkTable::GetTable("LiveWindow")
inst.GetTable("LiveWindow")
->GetSubTable("~STATUS~")
->PutBoolean("LW Enabled", false);
->GetEntry("LW Enabled")
.SetBoolean(false);
LiveWindow::GetInstance()->SetEnabled(false);
}