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


Java Sendable类代码示例

本文整理汇总了Java中edu.wpi.first.wpilibj.Sendable的典型用法代码示例。如果您正苦于以下问题:Java Sendable类的具体用法?Java Sendable怎么用?Java Sendable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Sendable类属于edu.wpi.first.wpilibj包,在下文中一共展示了Sendable类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getData

import edu.wpi.first.wpilibj.Sendable; //导入依赖的package包/类
/**
 * Returns the value at the specified key.
 *
 * @param key the key
 * @return the value
 * @throws NetworkTableKeyNotDefined if there is no value mapped to by the key
 * @throws IllegalArgumentException  if the key is null
 */
public static Sendable getData(String key) {
  ITable subtable = table.getSubTable(key);
  Object data = tablesToData.get(subtable);
  if (data == null) {
    throw new IllegalArgumentException("SmartDashboard data does not exist: " + key);
  } else {
    return (Sendable) data;
  }
}
 
开发者ID:ArcticWarriors,项目名称:snobot-2017,代码行数:18,代码来源:SmartDashboard.java

示例2: putData

import edu.wpi.first.wpilibj.Sendable; //导入依赖的package包/类
public static void putData(String name, Sendable value) {
	SmartDashboard.putData(name, value);
}
 
开发者ID:Team997Coders,项目名称:2017SteamBot2,代码行数:4,代码来源:CustomDashboard.java

示例3: getData

import edu.wpi.first.wpilibj.Sendable; //导入依赖的package包/类
public static Sendable getData(String name) {
	return SmartDashboard.getData(name);
}
 
开发者ID:Team997Coders,项目名称:2017SteamBot2,代码行数:4,代码来源:CustomDashboard.java

示例4: putData

import edu.wpi.first.wpilibj.Sendable; //导入依赖的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

示例5: putData

import edu.wpi.first.wpilibj.Sendable; //导入依赖的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:frc-team-342,项目名称:wpilibj,代码行数:15,代码来源:SmartDashboard.java


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