本文整理匯總了Java中com.wildstangs.subjects.base.BooleanSubject.getPreviousValue方法的典型用法代碼示例。如果您正苦於以下問題:Java BooleanSubject.getPreviousValue方法的具體用法?Java BooleanSubject.getPreviousValue怎麽用?Java BooleanSubject.getPreviousValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.wildstangs.subjects.base.BooleanSubject
的用法示例。
在下文中一共展示了BooleanSubject.getPreviousValue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_2) {
BooleanSubject button = (BooleanSubject) subjectThatCaused;
if (true == button.getValue() && false == button.getPreviousValue()) {
climbState = !climbState;
}
}
}
示例2: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON2) {
BooleanSubject button = (BooleanSubject) subjectThatCaused;
if (true == button.getValue() && false == button.getPreviousValue()) {
climbState = !climbState;
}
}
}
示例3: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
BooleanSubject button = (BooleanSubject) subjectThatCaused;
if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_6) {
kickerButtonPressed = button.getValue();
if (button.getValue()) {
WsShooter shooter = (WsShooter) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_SHOOTER);
WsIntake intake = (WsIntake) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_INTAKE);
if (!goingForward && !goingBack && ((this.isUpLimitSwitchTriggered()
&& shooter.isFlywheelAtSafeSpeed()) || intake.getFingerDownOverrideButtonState())) {
prepareFiringSolution = true;
}
}
} else if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_8) {
if (button.getValue() == true && (button.getPreviousValue() == false)) {
if (liftValue == DoubleSolenoid.Value.kReverse) {
WsIntake intakeSubsystem = (WsIntake) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_INTAKE);
boolean funnelatorLimitSwitch = intakeSubsystem.getFunnelatorLimitSwitch();
//Only allow the hopper to go up if the funnelator switch is NOT tripped (prevent jam-ups in autonomous)
if (false == funnelatorLimitSwitch) {
liftValue = DoubleSolenoid.Value.kForward;
//Also lift the tomahawk
tomahawkUp = true;
}
} else {
liftValue = DoubleSolenoid.Value.kReverse;
}
}
} else if (subjectThatCaused.equals(WsInputManager.getInstance().
getSensorInput(WsInputManager.HOPPER_DOWN_LIMIT_SWITCH).
getSubject((ISubjectEnum) null))) {
downLimitSwitchValue = ((BooleanSubject) WsInputManager.getInstance()
.getSensorInput(WsInputManager.HOPPER_DOWN_LIMIT_SWITCH)
.getSubject(((ISubjectEnum) null))).getValue();
} else if (subjectThatCaused.equals(WsInputManager.getInstance().
getSensorInput(WsInputManager.HOPPER_UP_LIMIT_SWITCH).
getSubject((ISubjectEnum) null))) {
upLimitSwitchValue = ((BooleanSubject) WsInputManager.getInstance()
.getSensorInput(WsInputManager.HOPPER_UP_LIMIT_SWITCH)
.getSubject(((ISubjectEnum) null))).getValue();
} else if (subjectThatCaused == WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).
getSubject(WsJoystickButtonEnum.MANIPULATOR_BUTTON_1)) {
if (button.getValue() == true && (button.getPreviousValue() == false)) {
if (liftValue == DoubleSolenoid.Value.kForward) {
tomahawkUp = true;
} else {
tomahawkUp = !tomahawkUp;
}
}
} else if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_5) {
if (true == button.getValue()) {
if (liftValue == DoubleSolenoid.Value.kReverse) {
tomahawkUp = true;
}
}
}
}
示例4: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
BooleanSubject button = (BooleanSubject) subjectThatCaused;
if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON6) {
kickerButtonPressed = button.getValue();
if (button.getValue()) {
WsShooter shooter = (WsShooter) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_SHOOTER);
WsIntake intake = (WsIntake) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_INTAKE);
if (!goingForward && !goingBack && ((this.isUpLimitSwitchTriggered()
&& shooter.isFlywheelAtSafeSpeed()) || intake.getFingerDownOverrideButtonState())) {
prepareFiringSolution = true;
}
}
} else if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON8) {
if (button.getValue() == true && (button.getPreviousValue() == false)) {
if (liftValue == DoubleSolenoid.Value.kReverse) {
WsIntake intakeSubsystem = (WsIntake) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_INTAKE);
boolean funnelatorLimitSwitch = intakeSubsystem.getFunnelatorLimitSwitch();
//Only allow the hopper to go up if the funnelator switch is NOT tripped (prevent jam-ups in autonomous)
if (false == funnelatorLimitSwitch) {
liftValue = DoubleSolenoid.Value.kForward;
//Also lift the tomahawk
tomahawkUp = true;
}
} else {
liftValue = DoubleSolenoid.Value.kReverse;
}
}
} else if (subjectThatCaused.equals(WsInputManager.getInstance().
getSensorInput(WsInputManager.HOPPER_DOWN_LIMIT_SWITCH).
getSubject((ISubjectEnum) null))) {
downLimitSwitchValue = ((BooleanSubject) WsInputManager.getInstance()
.getSensorInput(WsInputManager.HOPPER_DOWN_LIMIT_SWITCH)
.getSubject(((ISubjectEnum) null))).getValue();
} else if (subjectThatCaused.equals(WsInputManager.getInstance().
getSensorInput(WsInputManager.HOPPER_UP_LIMIT_SWITCH).
getSubject((ISubjectEnum) null))) {
upLimitSwitchValue = ((BooleanSubject) WsInputManager.getInstance()
.getSensorInput(WsInputManager.HOPPER_UP_LIMIT_SWITCH)
.getSubject(((ISubjectEnum) null))).getValue();
} else if (subjectThatCaused == WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).
getSubject(WsManipulatorJoystickButtonEnum.BUTTON1)) {
if (button.getValue() == true && (button.getPreviousValue() == false)) {
if (liftValue == DoubleSolenoid.Value.kForward) {
tomahawkUp = true;
} else {
tomahawkUp = !tomahawkUp;
}
}
} else if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON5) {
if (true == button.getValue()) {
if (liftValue == DoubleSolenoid.Value.kReverse) {
tomahawkUp = true;
}
}
}
}