当前位置: 首页>>代码示例>>Java>>正文


Java NetworkTable.setPersistentFilename方法代码示例

本文整理汇总了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");
    }
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:25,代码来源:Simulator.java

示例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);
}
 
开发者ID:trc492,项目名称:Frc2016FirstStronghold,代码行数:23,代码来源:RobotBase.java


注:本文中的edu.wpi.first.wpilibj.networktables.NetworkTable.setPersistentFilename方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。