當前位置: 首頁>>代碼示例>>Java>>正文


Java ITable.putString方法代碼示例

本文整理匯總了Java中edu.wpi.first.wpilibj.tables.ITable.putString方法的典型用法代碼示例。如果您正苦於以下問題:Java ITable.putString方法的具體用法?Java ITable.putString怎麽用?Java ITable.putString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在edu.wpi.first.wpilibj.tables.ITable的用法示例。


在下文中一共展示了ITable.putString方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initializeLiveWindowComponents

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
/**
 * Initialize all the LiveWindow elements the first time we enter LiveWindow mode. By holding off
 * creating the NetworkTable entries, it allows them to be redefined before the first time in
 * LiveWindow mode. This allows default sensor and actuator values to be created that are replaced
 * with the custom names from users calling addActuator and addSensor.
 */
private static void initializeLiveWindowComponents() {
  System.out.println("Initializing the components first time");
  livewindowTable = NetworkTable.getTable("LiveWindow");
  statusTable = livewindowTable.getSubTable("~STATUS~");
  for (Enumeration e = components.keys(); e.hasMoreElements(); ) {
    LiveWindowSendable component = (LiveWindowSendable) e.nextElement();
    LiveWindowComponent liveWindowComponent = (LiveWindowComponent) components.get(component);
    String subsystem = liveWindowComponent.getSubsystem();
    String name = liveWindowComponent.getName();
    System.out.println("Initializing table for '" + subsystem + "' '" + name + "'");
    livewindowTable.getSubTable(subsystem).putString("~TYPE~", "LW Subsystem");
    ITable table = livewindowTable.getSubTable(subsystem).getSubTable(name);
    table.putString("~TYPE~", component.getSmartDashboardType());
    table.putString("Name", name);
    table.putString("Subsystem", subsystem);
    component.initTable(table);
    if (liveWindowComponent.isSensor()) {
      sensors.addElement(component);
    }
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:28,代碼來源:LiveWindow.java

示例2: updateTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@Override
default void updateTable() {
  ITable table = getTable();
  if (table != null) {
    table.putString("~TYPE~", SMART_DASHBOARD_TYPE);
    table.putString("Type", getClass().getSimpleName());
    table.putNumber("Mode", getControlMode().getValue());
    if (getControlMode().isPID()) {
      table.putNumber("p", getP());
      table.putNumber("i", getI());
      table.putNumber("d", getD());
      table.putNumber("f", getF());
    }
    table.putBoolean("Enabled", isEnabled());
    table.putNumber("Value", get());
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:18,代碼來源:CANSpeedController.java

示例3: initTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@Override
public void initTable(ITable table) {
  m_table = table;
  if (table != null) {
    if (m_defaultCommand != null) {
      table.putBoolean("hasDefault", true);
      table.putString("default", m_defaultCommand.getName());
    } else {
      table.putBoolean("hasDefault", false);
    }
    if (m_currentCommand != null) {
      table.putBoolean("hasCommand", true);
      table.putString("command", m_currentCommand.getName());
    } else {
      table.putBoolean("hasCommand", false);
    }
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:19,代碼來源:Subsystem.java

示例4: updateTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@Override
public default void updateTable() {
    ITable table = getTable();
    if(table != null) {
        table.putString("~TYPE~", SMART_DASHBOARD_TYPE);
        table.putString("Type", getClass().getSimpleName()); // "CANTalon", "CANJaguar"
        table.putNumber("Mode", getControlMode().getValue());
        if (getControlMode().isPID()) {
            // CANJaguar throws an exception if you try to get its PID constants
            // when it's not in a PID-compatible mode
            table.putNumber("p", getP());
            table.putNumber("i", getI());
            table.putNumber("d", getD());
            table.putNumber("f", getF());
        }
        table.putBoolean("Enabled", isEnabled());
        table.putNumber("Value", get());
    }
}
 
開發者ID:trc492,項目名稱:Frc2016FirstStronghold,代碼行數:20,代碼來源:CANSpeedController.java

示例5: initTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@Override
public void initTable(ITable table) {
  m_table = table;
  if (table != null) {
    table.putStringArray(OPTIONS, m_map.keySet().toArray(new String[0]));
    if (m_defaultChoice != null) {
      table.putString(DEFAULT, m_defaultChoice);
    }
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:11,代碼來源:SendableChooser.java

示例6: initTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@Override
public void initTable(ITable table) {
  if (m_table != null) {
    m_table.removeTableListener(m_listener);
  }
  m_table = table;
  if (table != null) {
    table.putString("name", getName());
    table.putBoolean("running", isRunning());
    table.putBoolean("isParented", m_parent != null);
    table.addTableListener("running", m_listener, false);
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:14,代碼來源:Command.java

示例7: putSourcePropertyValue

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@SuppressWarnings("JavadocMethod")
private static void putSourcePropertyValue(ITable table, VideoEvent event, boolean isNew) {
  String name;
  String infoName;
  if (event.name.startsWith("raw_")) {
    name = "RawProperty/" + event.name.substring(4);
    infoName = "RawPropertyInfo/" + event.name.substring(4);
  } else {
    name = "Property/" + event.name;
    infoName = "PropertyInfo/" + event.name;
  }

  switch (event.propertyKind) {
    case kBoolean:
      if (isNew) {
        table.setDefaultBoolean(name, event.value != 0);
      } else {
        table.putBoolean(name, event.value != 0);
      }
      break;
    case kInteger:
    case kEnum:
      if (isNew) {
        table.setDefaultNumber(name, event.value);
        table.putNumber(infoName + "/min",
            CameraServerJNI.getPropertyMin(event.propertyHandle));
        table.putNumber(infoName + "/max",
            CameraServerJNI.getPropertyMax(event.propertyHandle));
        table.putNumber(infoName + "/step",
            CameraServerJNI.getPropertyStep(event.propertyHandle));
        table.putNumber(infoName + "/default",
            CameraServerJNI.getPropertyDefault(event.propertyHandle));
      } else {
        table.putNumber(name, event.value);
      }
      break;
    case kString:
      if (isNew) {
        table.setDefaultString(name, event.valueStr);
      } else {
        table.putString(name, event.valueStr);
      }
      break;
    default:
      break;
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:48,代碼來源:CameraServer.java

示例8: putData

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
/**
 * Maps the specified key to the specified value in this table. The key can not be null. The value
 * can be retrieved by calling the get method with a key that is equal to the original key.
 *
 * @param key  the key
 * @param data the value
 * @throws IllegalArgumentException If key is null
 */
public static void putData(String key, Sendable data) {
  ITable dataTable = table.getSubTable(key);
  dataTable.putString("~TYPE~", data.getSmartDashboardType());
  data.initTable(dataTable);
  tablesToData.put(data, key);
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:15,代碼來源:SmartDashboard.java


注:本文中的edu.wpi.first.wpilibj.tables.ITable.putString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。