本文整理汇总了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;
}
}
示例2: putData
import edu.wpi.first.wpilibj.Sendable; //导入依赖的package包/类
public static void putData(String name, Sendable value) {
SmartDashboard.putData(name, value);
}
示例3: getData
import edu.wpi.first.wpilibj.Sendable; //导入依赖的package包/类
public static Sendable getData(String name) {
return SmartDashboard.getData(name);
}
示例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);
}
示例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);
}