本文整理匯總了Java中com.wildstangs.subjects.base.BooleanSubject類的典型用法代碼示例。如果您正苦於以下問題:Java BooleanSubject類的具體用法?Java BooleanSubject怎麽用?Java BooleanSubject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BooleanSubject類屬於com.wildstangs.subjects.base包,在下文中一共展示了BooleanSubject類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: WsManipulatorJoystick
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public WsManipulatorJoystick() {
enterFlywheelAdjustment = new DoubleSubject(WsJoystickAxisEnum.MANIPULATOR_ENTER_FLYWHEEL_ADJUSTMENT);
exitFlywheelAdjustment = new DoubleSubject(WsJoystickAxisEnum.MANIPULATOR_EXIT_FLYWHEEL_ADJUSTMENT);
dPadUpDown = new DoubleSubject(WsJoystickAxisEnum.MANIPULATOR_D_PAD_UP_DOWN);
dPadLeftRight = new DoubleSubject(WsJoystickAxisEnum.MANIPULATOR_D_PAD_LEFT_RIGHT);
manipulatorJoystick = (Joystick) new Joystick(2);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kX, 1);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kY, 2);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kZ, 4);
// manipulatorJoystick.setAxisChannel(Joystick.AxisType.k, 4);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kTwist, 5);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kThrottle, 6);
buttons = new BooleanSubject[numberOfButtons];
for (int i = 0; i < buttons.length; i++) {
buttons[i] = new BooleanSubject(WsJoystickButtonEnum.getEnumFromIndex(false, i));
}
}
示例2: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_8) {
antiTurboFlag = ((BooleanSubject) subjectThatCaused).getValue();
} else if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_6) {
if (((BooleanSubject) subjectThatCaused).getValue() == true) {
shifterFlag = shifterFlag.equals(DoubleSolenoid.Value.kForward)
? DoubleSolenoid.Value.kReverse : DoubleSolenoid.Value.kForward;
}
} else if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_7) {
turboFlag = ((BooleanSubject) subjectThatCaused).getValue();
} else if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_3) {
slowTurnLeftFlag = ((BooleanSubject) subjectThatCaused).getValue();
} else if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_1) {
slowTurnRightFlag = ((BooleanSubject) subjectThatCaused).getValue();
}
}
示例3: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
boolean buttonState = ((BooleanSubject) subjectThatCaused).getValue();
if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_6) {
kickerButtonPressed = buttonState;
}
if (subjectThatCaused.getType() == WsJoystickButtonEnum.MANIPULATOR_BUTTON_5) {
if (intakeButtonPreviousState == false) {
if ((intakeButtonPreviousState = buttonState) == true) {
intakeChanged = true;
}
} else if (intakeButtonPreviousState != buttonState) {
intakeButtonPreviousState = buttonState;
intakeChanged = true;
} else {
intakeChanged = false;
}
}
if (subjectThatCaused.getType() == WsJoystickButtonEnum.DRIVER_BUTTON_2) {
climbButtonPressed = buttonState;
}
}
示例4: DriverJoystick
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public DriverJoystick() {
driverJoystick = (Joystick) new Joystick(1);
axes = new DoubleSubject[numberOfAxes];
for (int i = 0; i < axes.length; i++) {
if (JoystickAxisEnum.getEnumFromIndex(true, i) != null) {
axes[i] = new DoubleSubject(JoystickAxisEnum.getEnumFromIndex(true, i));
} else {
axes[i] = new DoubleSubject("DriverSubject" + i);
}
}
buttons = new BooleanSubject[numberOfButtons];
for (int i = 0; i < buttons.length; i++) {
buttons[i] = new BooleanSubject(JoystickButtonEnum.getEnumFromIndex(true, i));
}
dPadButtons = new BooleanSubject[numberOfDPadButtons];
dPadDebouncers = new Debouncer[numberOfDPadButtons];
for(int i = 0; i < dPadButtons.length; i++)
{
dPadButtons[i] = new BooleanSubject(JoystickDPadButtonEnum.getEnumFromIndex(true, i));
dPadDebouncers[i] = new Debouncer(20, new Boolean(false));
}
}
示例5: ManipulatorJoystick
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public ManipulatorJoystick() {
manipulatorJoystick = (Joystick) new Joystick(2);
axes = new DoubleSubject[numberOfAxes];
for (int i = 0; i < axes.length; i++) {
if (JoystickAxisEnum.getEnumFromIndex(false, i) != null) {
axes[i] = new DoubleSubject(JoystickAxisEnum.getEnumFromIndex(false, i));
} else {
axes[i] = new DoubleSubject("ManipulatorSubject" + 1);
}
}
buttons = new BooleanSubject[numberOfButtons];
for (int i = 0; i < buttons.length; i++) {
buttons[i] = new BooleanSubject(JoystickButtonEnum.getEnumFromIndex(false, i));
}
dPadButtons = new BooleanSubject[numberOfDPadButtons];
dPadDebouncers = new Debouncer[numberOfDPadButtons];
for(int i = 0; i < dPadButtons.length; i++)
{
dPadButtons[i] = new BooleanSubject(JoystickDPadButtonEnum.getEnumFromIndex(false, i));
dPadDebouncers[i] = new Debouncer(20, new Boolean(false));
}
}
示例6: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused)
{
if(((BooleanSubject) subjectThatCaused).getValue())
{
// if(subjectThatCaused.getType() == JoystickDPadButtonEnum.MANIPULATOR_D_PAD_BUTTON_DOWN)
// {
// SmartDashboard.putBoolean("Looking For Hot Goal", true);
// SmartDashboard.putBoolean("Found Hot Goal", this.checkForHotGoal());
// SmartDashboard.putBoolean("Looking For Hot Goal", false);
// }
if(subjectThatCaused.getType() == JoystickDPadButtonEnum.MANIPULATOR_D_PAD_BUTTON_RIGHT)
{
ledState = (ledState == Relay.Value.kOff ? Relay.Value.kOn : Relay.Value.kOff);
}
}
}
示例7: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused)
{
if (DriverStation.getInstance().isEnabled())
{
boolean buttonState = ((BooleanSubject) subjectThatCaused).getValue();
if (subjectThatCaused.getType() == JoystickButtonEnum.MANIPULATOR_BUTTON_4)
{
if (buttonState)
{
SHOOT_PATTERN.sendPattern();
}
}
else if (subjectThatCaused.equals(InputManager.getInstance().getSensorInput(InputManager.TENSION_LIMIT_SWITCH_INDEX).getSubject()))
{
if (buttonState)
{
TENSIONED_PATTERN.sendPattern();
}
}
}
}
示例8: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused)
{
boolean buttonState = ((BooleanSubject) subjectThatCaused).getValue();
if (subjectThatCaused.getType() == JoystickDPadButtonEnum.MANIPULATOR_D_PAD_BUTTON_UP)
{
this.currentEarState = buttonState;
}
// else if(subjectThatCaused.getType() == JoystickDPadButtonEnum.MANIPULATOR_D_PAD_BUTTON_DOWN)
// {
// this.currentEarState = false;
// }
else if(subjectThatCaused.getType() == JoystickButtonEnum.DRIVER_BUTTON_10)
{
if(buttonState)
{
ohNoFlag = !ohNoFlag;
this.currentEarState = false;
}
}
}
示例9: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused)
{
if(subjectThatCaused.getType() == JoystickButtonEnum.MANIPULATOR_BUTTON_1 || subjectThatCaused.getType() == JoystickButtonEnum.MANIPULATOR_BUTTON_3)
{
currentState = ((BooleanSubject)subjectThatCaused).getValue();
}
else if(subjectThatCaused.getType() == JoystickButtonEnum.DRIVER_BUTTON_10)
{
if(((BooleanSubject)subjectThatCaused).getValue())
{
ohNoFlag = !ohNoFlag;
if(ohNoFlag)
{
currentState = false;
}
}
}
}
示例10: WsManipulatorJoystick
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public WsManipulatorJoystick() {
enterFlywheelAdjustment = new DoubleSubject(WsManipulatorJoystickEnum.ENTER_FLYWHEEL_ADJUSTMENT);
exitFlywheelAdjustment = new DoubleSubject(WsManipulatorJoystickEnum.EXIT_FLYWHEEL_ADJUSTMENT);
dPadUpDown = new DoubleSubject(WsManipulatorJoystickEnum.D_PAD_UP_DOWN);
dPadLeftRight = new DoubleSubject(WsManipulatorJoystickEnum.D_PAD_LEFT_RIGHT);
manipulatorJoystick = (Joystick) new Joystick(2);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kX, 1);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kY, 2);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kZ, 4);
// manipulatorJoystick.setAxisChannel(Joystick.AxisType.k, 4);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kTwist, 5);
manipulatorJoystick.setAxisChannel(Joystick.AxisType.kThrottle, 6);
buttons = new BooleanSubject[numberOfButtons];
for (int i = 0; i < buttons.length; i++) {
buttons[i] = new BooleanSubject(WsManipulatorJoystickButtonEnum.getEnumFromIndex(i));
}
}
示例11: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON8) {
antiTurboFlag = ((BooleanSubject) subjectThatCaused).getValue();
} else if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON6) {
if (((BooleanSubject) subjectThatCaused).getValue() == true) {
shifterFlag = shifterFlag.equals(DoubleSolenoid.Value.kForward)
? DoubleSolenoid.Value.kReverse : DoubleSolenoid.Value.kForward;
}
} else if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON7) {
turboFlag = ((BooleanSubject) subjectThatCaused).getValue();
} else if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON3) {
slowTurnLeftFlag = ((BooleanSubject) subjectThatCaused).getValue();
} else if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON1) {
slowTurnRightFlag = ((BooleanSubject) subjectThatCaused).getValue();
}
}
示例12: acceptNotification
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void acceptNotification(Subject subjectThatCaused) {
boolean buttonState = ((BooleanSubject) subjectThatCaused).getValue();
if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON6) {
kickerButtonPressed = buttonState;
}
if (subjectThatCaused.getType() == WsManipulatorJoystickButtonEnum.BUTTON5) {
if (intakeButtonPreviousState == false) {
if ((intakeButtonPreviousState = buttonState) == true) {
intakeChanged = true;
}
} else if (intakeButtonPreviousState != buttonState) {
intakeButtonPreviousState = buttonState;
intakeChanged = true;
} else {
intakeChanged = false;
}
}
if (subjectThatCaused.getType() == WsDriverJoystickButtonEnum.BUTTON2) {
climbButtonPressed = buttonState;
}
}
示例13: update
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void update() {
if (((BooleanSubject) WsInputManager.getInstance().
getSensorInput(WsInputManager.LEFT_ACCUMULATOR_LIMIT_SWITCH).getSubject((ISubjectEnum) null)).
getValue() == true && ((BooleanSubject) WsInputManager.getInstance().
getSensorInput(WsInputManager.RIGHT_ACCUMULATOR_LIMIT_SWITCH).getSubject((ISubjectEnum) null)).
getValue() == true) {
finished = true;
}
}
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:10,代碼來源:WsAutonomousStepWaitForAccumulatorLeftAndRightLimitSwitches.java
示例14: initialize
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void initialize() {
if (false == funnelatorSwitch) {
finished = true;
} else {
WsFloorPickup subsystem = (WsFloorPickup) (WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_FLOOR_PICKUP));
Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsJoystickButtonEnum.MANIPULATOR_BUTTON_5);
BooleanSubject backButton = (BooleanSubject) subject;
if (subsystem.getMotorBack() == false) {
backButton.setValue(true);
}
}
}
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:14,代碼來源:WsAutonomousStepIntakeIfFunnelatorTripped.java
示例15: update
import com.wildstangs.subjects.base.BooleanSubject; //導入依賴的package包/類
public void update() {
if (false == funnelatorSwitch) {
Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsJoystickButtonEnum.MANIPULATOR_BUTTON_5);
BooleanSubject backButton = (BooleanSubject) subject;
backButton.setValue(false);
finished = true;
}
}
開發者ID:wildstang111,項目名稱:2013_drivebase_proto,代碼行數:9,代碼來源:WsAutonomousStepIntakeIfFunnelatorTripped.java