當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。