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


Java ITable.putNumber方法代碼示例

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


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

示例1: updateTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public void updateTable() {
  ITable table = getTable();
  if (table != null) {
    table.putNumber("Value", getAngle());
    table.putNumber("Pitch", getPitch());
    table.putNumber("Roll", getRoll());
    table.putNumber("Yaw", getYaw());
    table.putNumber("AccelX", getAccelX());
    table.putNumber("AccelY", getAccelY());
    table.putNumber("AccelZ", getAccelZ());
    table.putNumber("AngleX", getAngleX());
    table.putNumber("AngleY", getAngleY());
    table.putNumber("AngleZ", getAngleZ());
  }
}
 
開發者ID:2141-Spartonics,項目名稱:Spartonics-Code,代碼行數:20,代碼來源:ADIS16448_IMU.java

示例2: initPhoneVars

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
private void initPhoneVars(VisionContainer container, double defaultTargetWidth,
    double defaultTargetHeight) {
  ITable range = container.table.getSubTable("colorRange");
  if (!range.containsKey("lower")) {
    range.putNumberArray("lower", new double[] {0, 0, 0});
  }
  if (!range.containsKey("upper")) {
    range.putNumberArray("upper", new double[] {0, 0, 0});
  }
  range.setPersistent("lower");
  range.setPersistent("upper");

  ITable target = container.table.getSubTable("target");
  if (!target.containsKey("width")) {
    target.putNumber("width", defaultTargetWidth);
  }
  if (!target.containsKey("height")) {
    target.putNumber("height", defaultTargetHeight);
  }
  target.setPersistent("width");
  target.setPersistent("height");
}
 
開發者ID:ligerbots,項目名稱:Steamworks2017Robot,代碼行數:23,代碼來源:Vision.java

示例3: initTable

import edu.wpi.first.wpilibj.tables.ITable; //導入方法依賴的package包/類
@Override
public void initTable(ITable table) {
  if (this.m_table != null) {
    m_table.removeTableListener(m_listener);
  }
  m_table = table;
  if (table != null) {
    table.putNumber("p", getP());
    table.putNumber("i", getI());
    table.putNumber("d", getD());
    table.putNumber("f", getF());
    table.putNumber("setpoint", getSetpoint());
    table.putBoolean("enabled", isEnable());
    table.addTableListener(m_listener, false);
  }
}
 
開發者ID:ArcticWarriors,項目名稱:snobot-2017,代碼行數:17,代碼來源:PIDController.java

示例4: 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

示例5: 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

示例6: 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


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