本文整理汇总了Java中edu.wpi.first.wpilibj.networktables.NetworkTable.setPersistentFilename方法的典型用法代码示例。如果您正苦于以下问题:Java NetworkTable.setPersistentFilename方法的具体用法?Java NetworkTable.setPersistentFilename怎么用?Java NetworkTable.setPersistentFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.networktables.NetworkTable
的用法示例。
在下文中一共展示了NetworkTable.setPersistentFilename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadConfig
import edu.wpi.first.wpilibj.networktables.NetworkTable; //导入方法依赖的package包/类
private void loadConfig(String aFile)
{
try
{
if (!Files.exists(Paths.get(aFile)))
{
System.err.println("Could not read properties file, will use defaults and will overwrite the file if it exists");
Files.copy(Paths.get("_default_properties.properties"), Paths.get(aFile));
}
Properties p = new Properties();
p.load(new FileInputStream(new File(aFile)));
mClassName = p.getProperty("robot_class");
mSimulatorClassName = p.getProperty("simulator_class");
NetworkTable.setPersistentFilename(sUSER_CONFIG_DIR + mClassName + ".preferences.ini");
}
catch (Exception e)
{
e.printStackTrace();
System.err.println("Could not read properties file");
}
}
示例2: RobotBase
import edu.wpi.first.wpilibj.networktables.NetworkTable; //导入方法依赖的package包/类
/**
* Constructor for a generic robot program. User code should be placed in the
* constructor that runs before the Autonomous or Operator Control period
* starts. The constructor will run to completion before Autonomous is
* entered.
*
* This must be used to ensure that the communications code starts. In the
* future it would be nice to put this code into it's own task that loads on
* boot so ensure that it runs.
*/
protected RobotBase() {
// TODO: StartCAPI();
// TODO: See if the next line is necessary
// Resource.RestartProgram();
NetworkTable.setNetworkIdentity("Robot");
NetworkTable.setPersistentFilename("/home/lvuser/networktables.ini");
NetworkTable.setServerMode();// must be before b
m_ds = DriverStation.getInstance();
NetworkTable.getTable(""); // forces network tables to initialize
NetworkTable.getTable("LiveWindow").getSubTable("~STATUS~").putBoolean("LW Enabled", false);
}