當前位置: 首頁>>代碼示例>>Java>>正文


Java BooleanSubject.getPreviousValue方法代碼示例

本文整理匯總了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;
        }
    }
}
 
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:9,代碼來源:WsClimber.java

示例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;
        }
    }
}
 
開發者ID:wildstang111,項目名稱:2013_robot_software,代碼行數:9,代碼來源:WsClimber.java

示例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;
            }
        }
    }
}
 
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:62,代碼來源:WsHopper.java

示例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;
            }
        }
    }
}
 
開發者ID:wildstang111,項目名稱:2013_robot_software,代碼行數:62,代碼來源:WsHopper.java


注:本文中的com.wildstangs.subjects.base.BooleanSubject.getPreviousValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。