本文整理汇总了Java中edu.wpi.first.wpilibj.Preferences.getDouble方法的典型用法代码示例。如果您正苦于以下问题:Java Preferences.getDouble方法的具体用法?Java Preferences.getDouble怎么用?Java Preferences.getDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.wpi.first.wpilibj.Preferences
的用法示例。
在下文中一共展示了Preferences.getDouble方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: latchReadyPosition
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double latchReadyPosition() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("latchReadyPostion")) {
prefs.putDouble("latchReadyPostion", 0.32);
}
return prefs.getDouble("latchReadyPostion", 0.32);
}
示例2: latchShootPosition
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double latchShootPosition() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("latchShootPosition")) {
prefs.putDouble("latchShootPosition", 1.0);
}
return prefs.getDouble("latchShootPosition", 1.0);
}
示例3: latchLockPosition
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double latchLockPosition() { //position to lower server after latch to ensure it doesn't launch prematurely
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("latchLockPosition")) {
prefs.putDouble("latchLockPosition", 0.01);
}
return prefs.getDouble("latchLockPosition", 0.01);
}
示例4: winchPower
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double winchPower() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("winchPower")) {
prefs.putDouble("winchPower", 1.0);
}
return prefs.getDouble("winchPower", 1.0);
}
示例5: winchWoundDistance
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double winchWoundDistance() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("winchWoundDistance")) {
prefs.putDouble("winchWoundDistance", 1);
}
return prefs.getDouble("winchWoundDistance", 1);
}
示例6: winchUnwoundDistance
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double winchUnwoundDistance() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("winchUnwoundDistance")) {
prefs.putDouble("winchUnwoundDistance", 4.6);
}
return prefs.getDouble("winchUnwoundDistance", 4.6);
}
示例7: pickupWheelsPower
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double pickupWheelsPower() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("pickupWheelsPower")) {
prefs.putDouble("pickupWheelsPower", -12);
}
return prefs.getDouble("pickupWheelsPower", -12);
}
示例8: pixelsPerEncoderChange
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double pixelsPerEncoderChange() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("pixelsPerEncoderChange")) {
prefs.putDouble("pixelsPerEncoderChange", 0.735);
}
return prefs.getDouble("pixelsPerEncoderChange", 0.735);
}
示例9: pixToTurnMax
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double pixToTurnMax() {
Preferences prefs = Preferences.getInstance();
if (!prefs.containsKey("pixToTurnMax")) {
prefs.putDouble("pixToTurnMax", 1.0);
}
return prefs.getDouble("pixToTurnMax", 1.0);
}
示例10: getPreferencesDouble
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
/**
* Retrieve numbers from the preferences table. If the specified key is in
* the preferences table, then the preference value is returned. Otherwise,
* return the backup value, and also start a new entry in the preferences
* table.
*/
public static double getPreferencesDouble(String key, double backup) {
Preferences preferences = Preferences.getInstance();
if (!preferences.containsKey(key)) {
preferences.putDouble(key, backup);
}
return preferences.getDouble(key, backup);
}
示例11: DashboardPID
import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public DashboardPID( String PIDName, PIDController pidController ) {
m_pidController = pidController;
pName = PIDName+"P";
iName = PIDName+"I";
dName = PIDName+"D";
Preferences prefs = Preferences.getInstance();
double p = prefs.getDouble(pName, pidController.getP());
double i = prefs.getDouble(iName, pidController.getI());
double d = prefs.getDouble(dName, pidController.getD());
SmartDashboard.putNumber(pName, p);
SmartDashboard.putNumber(iName, i);
SmartDashboard.putNumber(dName, d);
pidController.setPID(p, i, d);
}