本文整理汇总了Java中com.wildstangs.inputmanager.inputs.WsDigitalInput类的典型用法代码示例。如果您正苦于以下问题:Java WsDigitalInput类的具体用法?Java WsDigitalInput怎么用?Java WsDigitalInput使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WsDigitalInput类属于com.wildstangs.inputmanager.inputs包,在下文中一共展示了WsDigitalInput类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WsInputManager
import com.wildstangs.inputmanager.inputs.WsDigitalInput; //导入依赖的package包/类
/**
* Constructor for the WsInputManager.
*
* Each new data element to be added to the facade must be added here and
* have keys added above.
*/
protected WsInputManager() {
//Add the facade data elements
BooleanConfigFileParameter outputsFor2012 = new BooleanConfigFileParameter(WsOutputManager.getInstance().getClass().getName(), "2012_Robot", false);
if (outputsFor2012.getValue()) {
sensorInputs.add(new DataElement(RIGHT_ACCUMULATOR_LIMIT_SWITCH, new WsDigitalInput(11)));
sensorInputs.add(new DataElement(FUNNELATOR_LIMIT_SWITCH, new WsDigitalInput(7)));
} else {
sensorInputs.add(new DataElement(RIGHT_ACCUMULATOR_LIMIT_SWITCH, new WsDigitalInput(7)));
sensorInputs.add(new DataElement(FUNNELATOR_LIMIT_SWITCH, new WsDigitalInput(9)));
}
oiInputs.add(new DataElement(DRIVER_JOYSTICK, new WsDriverJoystick()));
oiInputs.add(new DataElement(MANIPULATOR_JOYSTICK, new WsManipulatorJoystick()));
// oiInputs.add(new DataElement(ENTER_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(5)));
// oiInputs.add(new DataElement(EXIT_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(7)));
oiInputs.add(new DataElement(ENTER_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(3)));
oiInputs.add(new DataElement(EXIT_WHEEL_SHOOTER_SPEED_INPUT, new WsDSAnalogInput(4)));
oiInputs.add(new DataElement(SHOOTER_WHEEL_SPEED_OVERRIDE, new WsDSDigitalInput(2)));
oiInputs.add(new DataElement(AUTO_PROGRAM_SELECTOR, new WsDSAnalogInput(1)));
oiInputs.add(new DataElement(LOCK_IN_SWITCH, new WsDSDigitalInput(1)));
oiInputs.add(new DataElement(START_POSITION_SELECTOR, new WsDSAnalogInput(2)));
sensorInputs.add(new DataElement(LEFT_ACCUMULATOR_LIMIT_SWITCH, new WsDigitalInput(6)));
sensorInputs.add(new DataElement(HOPPER_DOWN_LIMIT_SWITCH, new WsDigitalInput(13)));
sensorInputs.add(new DataElement(HOPPER_UP_LIMIT_SWITCH, new WsDigitalInput(12)));
sensorInputs.add(new DataElement(ACCUMULATOR_UP_LIMIT_SWITCH, new WsDigitalInput(8)));
}
示例2: InputManager
import com.wildstangs.inputmanager.inputs.WsDigitalInput; //导入依赖的package包/类
/**
* Constructor for the InputManager.
*
* Each new data element to be added to the facade must be added here and
* have keys added above.
*/
protected InputManager() {
//Add the facade data elements
sensorInputs.addToIndex(UNKNOWN_INDEX, new NoInput());
sensorInputs.addToIndex(PRESSURE_TRANSDUCER_INDEX, new WsAnalogInput(4));
sensorInputs.addToIndex(FRONT_ARM_POT_INDEX, new WsAnalogInput(2));
sensorInputs.addToIndex(BACK_ARM_POT_INDEX, new WsAnalogInput(3));
// sensorInputs.addToIndex(LEFT_ENCODER_A_INDEX, new WsDigitalInput(2));
// sensorInputs.addToIndex(LEFT_ENCODER_B_INDEX, new WsDigitalInput(3));
// sensorInputs.addToIndex(RIGHT_ENCODER_A_INDEX, new WsDigitalInput(4));
// sensorInputs.addToIndex(RIGHT_ENCODER_B_INDEX, new WsDigitalInput(5));
sensorInputs.addToIndex(TENSION_LIMIT_SWITCH_INDEX, new WsDigitalInput(6));
sensorInputs.addToIndex(LATCH_POSITION_SWITCH_INDEX, new WsDigitalInput(8));
sensorInputs.addToIndex(CATAPULT_DOWN_SWITCH_INDEX, new WsDigitalInput(9));
sensorInputs.addToIndex(FRONT_ARM_CALIBRATION_SWITCH_INDEX, new WsDigitalInput(10));
sensorInputs.addToIndex(BACK_ARM_CALIBRATION_SWITCH_INDEX, new WsDigitalInput(11));
//Digital 7, 12, 13, and 14 are used for the LEDs
oiInputs.addToIndex(UNKNOWN_INDEX, new NoInput());
oiInputs.addToIndex(DRIVER_JOYSTICK_INDEX, new DriverJoystick());
oiInputs.addToIndex(MANIPULATOR_JOYSTICK_INDEX, new ManipulatorJoystick());
oiInputs.addToIndex(AUTO_PROGRAM_SELECTOR_INDEX, new WsDSAnalogInput(1));
oiInputs.addToIndex(LOCK_IN_SWITCH_INDEX, new WsDSDigitalInput(1));
oiInputs.addToIndex(START_POSITION_SELECTOR_INDEX, new WsDSAnalogInput(2));
oiInputs.addToIndex(ARM_FORCE_OVERRIDE_TO_MANUAL_SWITCH_INDEX, new WsDSDigitalInput(2));
}
示例3: update
import com.wildstangs.inputmanager.inputs.WsDigitalInput; //导入依赖的package包/类
public void update() {
WsDigitalInput upSwitch = (WsDigitalInput) (WsInputManager.getInstance().getSensorInput(WsInputManager.ACCUMULATOR_UP_LIMIT_SWITCH));
boolean switchState = ((Boolean) (upSwitch.get((IInputEnum) null))).booleanValue();
SmartDashboard.putBoolean("Accumulator Up Limit Switch", switchState);
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_SOLENOID).set(null, Boolean.valueOf(solenoidState));
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_SECONDARY_SOLENOID).set(null, Boolean.valueOf(secondarySolenoidState));
if (motorForward == true && solenoidState == false && (false == ((WsHopper) WsSubsystemContainer.getInstance()
.getSubsystem(WsSubsystemContainer.WS_HOPPER)).isDownLimitSwitchTriggered())) {
motorForward = false;
}
if (motorForward) {
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_VICTOR)
.set(null, Double.valueOf(maxVictorSpeed));
SmartDashboard.putNumber("Accumulator motor", maxVictorSpeed);
} else if (motorBack) {
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_VICTOR)
.set(null, Double.valueOf(-maxVictorSpeed));
SmartDashboard.putNumber("Accumulator motor", -maxVictorSpeed);
} else {
WsOutputManager.getInstance().getOutput(WsOutputManager.ACCUMULATOR_VICTOR)
.set(null, Double.valueOf(0.0));
SmartDashboard.putNumber("Accumulator motor", 0.0);
}
}