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


Java BooleanSubject.getValue方法代碼示例

本文整理匯總了Java中com.wildstangs.subjects.base.BooleanSubject.getValue方法的典型用法代碼示例。如果您正苦於以下問題:Java BooleanSubject.getValue方法的具體用法?Java BooleanSubject.getValue怎麽用?Java BooleanSubject.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.wildstangs.subjects.base.BooleanSubject的用法示例。


在下文中一共展示了BooleanSubject.getValue方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: update

import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void update() {
    if (!wait) {
        WsHopper subsystem = (WsHopper) (WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_HOPPER));
        Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsJoystickButtonEnum.MANIPULATOR_BUTTON_8);
        BooleanSubject button = (BooleanSubject) subject;
        if (button.getValue()) {
            button.setValue(false);
        }
        finished = true;
    } else {
        wait = false;
    }
}
 
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:14,代碼來源:WsAutonomousStepRaiseHopper.java

示例2: 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

示例3: acceptNotification

import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
    BooleanSubject button = (BooleanSubject) subjectThatCaused;

    if (button.getValue()) {
        angle = ANGLE_DOWN;
        System.out.println("Angle is at " + angle);
    } else {
        angle = ANGLE_UP;
        System.out.println("Angle is at " + angle);
    }
}
 
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:12,代碼來源:WsLoadingRamp.java

示例4: update

import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void update() {
    if (!wait) {
        WsHopper subsystem = (WsHopper) (WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_HOPPER));
        Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON8);
        BooleanSubject button = (BooleanSubject) subject;
        if (button.getValue()) {
            button.setValue(false);
        }
        finished = true;
    } else {
        wait = false;
    }
}
 
開發者ID:wildstang111,項目名稱:2013_robot_software,代碼行數:14,代碼來源:WsAutonomousStepRaiseHopper.java

示例5: 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

示例6: 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

示例7: acceptNotification

import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
    BooleanSubject button = (BooleanSubject) subjectThatCaused;
    if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_10) {
        fingerDownOverrideButtonState = button.getValue();
    } else if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_9) {
        fingerUpOverrideButtonState = button.getValue();
    } else if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_5) {
        if (button.getValue()) {
            motorForward = true;
            motorBack = false;
        } else {
            motorForward = false;
        }
    } else if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_7) {
        if (button.getValue()) {
            motorForward = false;
            motorBack = true;
        } else {
            motorBack = false;
        }
    } else if (subjectThatCaused.equals(WsInputManager.getInstance().
            getSensorInput(WsInputManager.LEFT_ACCUMULATOR_LIMIT_SWITCH).
            getSubject((ISubjectEnum) null))) {
        leftAccumulatorLimitSwitch = ((BooleanSubject) subjectThatCaused).getValue();
    } else if (subjectThatCaused.equals(WsInputManager.getInstance().
            getSensorInput(WsInputManager.RIGHT_ACCUMULATOR_LIMIT_SWITCH).
            getSubject((ISubjectEnum) null))) {
        rightAccumulatorLimitSwitch = ((BooleanSubject) subjectThatCaused).getValue();
    } else if (subjectThatCaused.equals(WsInputManager.getInstance().
            getSensorInput(WsInputManager.FUNNELATOR_LIMIT_SWITCH).getSubject((ISubjectEnum) null))) {
        funnelatorLimitSwitch = ((BooleanSubject) subjectThatCaused).getValue();
        if(funnelatorLimitSwitch == false)
        {
            if(useTimeDelay && fingerValveState && latchAccumulatorSwitches)
            {
                hasFirstDiscGoneThrough = true;
                timeAfterDelayToBringDownFinger = Timer.getFPGATimestamp() + switchDelayTime;
            }else if(!useTimeDelay && fingerValveState && !leftAccumulatorLimitSwitch){
                //Unlatch the button states and bring down the funnelator finger
                latchAccumulatorSwitches = false;
                fingerValveState = false;
                
            }
            ((WsHopper)WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_HOPPER)).addDisk();
        }
    }
}
 
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:48,代碼來源:WsIntake.java

示例8: 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

示例9: acceptNotification

import com.wildstangs.subjects.base.BooleanSubject; //導入方法依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
    BooleanSubject button = (BooleanSubject) subjectThatCaused;
    if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON10) {
        fingerDownOverrideButtonState = button.getValue();
    } else if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON9) {
        fingerUpOverrideButtonState = button.getValue();
    } else if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON5) {
        if (button.getValue()) {
            motorForward = true;
            motorBack = false;
        } else {
            motorForward = false;
        }
    } else if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON7) {
        if (button.getValue()) {
            motorForward = false;
            motorBack = true;
        } else {
            motorBack = false;
        }
    } else if (subjectThatCaused.equals(WsInputManager.getInstance().
            getSensorInput(WsInputManager.LEFT_ACCUMULATOR_LIMIT_SWITCH).
            getSubject((ISubjectEnum) null))) {
        leftAccumulatorLimitSwitch = ((BooleanSubject) subjectThatCaused).getValue();
    } else if (subjectThatCaused.equals(WsInputManager.getInstance().
            getSensorInput(WsInputManager.RIGHT_ACCUMULATOR_LIMIT_SWITCH).
            getSubject((ISubjectEnum) null))) {
        rightAccumulatorLimitSwitch = ((BooleanSubject) subjectThatCaused).getValue();
    } else if (subjectThatCaused.equals(WsInputManager.getInstance().
            getSensorInput(WsInputManager.FUNNELATOR_LIMIT_SWITCH).getSubject((ISubjectEnum) null))) {
        funnelatorLimitSwitch = ((BooleanSubject) subjectThatCaused).getValue();
        if(funnelatorLimitSwitch == false)
        {
            if(useTimeDelay && fingerValveState && latchAccumulatorSwitches)
            {
                hasFirstDiscGoneThrough = true;
                timeAfterDelayToBringDownFinger = Timer.getFPGATimestamp() + switchDelayTime;
            }else if(!useTimeDelay && fingerValveState && !leftAccumulatorLimitSwitch){
                //Unlatch the button states and bring down the funnelator finger
                latchAccumulatorSwitches = false;
                fingerValveState = false;
                
            }
            ((WsHopper)WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_HOPPER)).addDisk();
        }
    }
}
 
開發者ID:wildstang111,項目名稱:2013_robot_software,代碼行數:48,代碼來源:WsIntake.java


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