本文整理匯總了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);
}