本文整理汇总了Java中com.wildstangs.subjects.base.Subject类的典型用法代码示例。如果您正苦于以下问题:Java Subject类的具体用法?Java Subject怎么用?Java Subject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Subject类属于com.wildstangs.subjects.base包,在下文中一共展示了Subject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSubject
import com.wildstangs.subjects.base.Subject; //导入依赖的package包/类
public Subject getSubject(ISubjectEnum subjectEnum) {
if (subjectEnum == WsJoystickAxisEnum.MANIPULATOR_ENTER_FLYWHEEL_ADJUSTMENT) {
return enterFlywheelAdjustment;
} else if (subjectEnum == WsJoystickAxisEnum.MANIPULATOR_EXIT_FLYWHEEL_ADJUSTMENT) {
return exitFlywheelAdjustment;
} else if (subjectEnum == WsJoystickAxisEnum.MANIPULATOR_D_PAD_UP_DOWN) {
return dPadUpDown;
} else if (subjectEnum == WsJoystickAxisEnum.MANIPULATOR_D_PAD_LEFT_RIGHT) {
return dPadLeftRight;
} else if (subjectEnum instanceof WsJoystickButtonEnum && ((WsJoystickButtonEnum) subjectEnum).isDriver() == false) {
return buttons[((WsJoystickButtonEnum) subjectEnum).toValue()];
} else {
System.out.println("Subject not supported or incorrect.");
return null;
}
}
示例2: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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.Subject; //导入依赖的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: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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);
}
}
}
示例5: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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();
}
}
}
}
示例6: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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;
}
}
}
示例7: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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;
}
}
}
}
示例8: getSubject
import com.wildstangs.subjects.base.Subject; //导入依赖的package包/类
public Subject getSubject(ISubjectEnum subjectEnum) {
if (subjectEnum == WsManipulatorJoystickEnum.ENTER_FLYWHEEL_ADJUSTMENT) {
return enterFlywheelAdjustment;
} else if (subjectEnum == WsManipulatorJoystickEnum.EXIT_FLYWHEEL_ADJUSTMENT) {
return exitFlywheelAdjustment;
} else if (subjectEnum == WsManipulatorJoystickEnum.D_PAD_UP_DOWN) {
return dPadUpDown;
} else if (subjectEnum == WsManipulatorJoystickEnum.D_PAD_LEFT_RIGHT) {
return dPadLeftRight;
} else if (subjectEnum instanceof WsManipulatorJoystickButtonEnum) {
return buttons[((WsManipulatorJoystickButtonEnum) subjectEnum).toValue()];
} else {
System.out.println("Subject not supported or incorrect.");
return null;
}
}
示例9: WsFloorPickup
import com.wildstangs.subjects.base.Subject; //导入依赖的package包/类
public WsFloorPickup(String name) {
super(name);
Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON5);
subject.attach(this);
subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON7);
subject.attach(this);
subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON5);
subject.attach(this);
subject = WsInputManager.getInstance().getSensorInput(WsInputManager.ACCUMULATOR_UP_LIMIT_SWITCH).getSubject((ISubjectEnum) null);
subject.attach(this);
maxVictorSpeed = maxSpeed.getValue();
}
示例10: WsHopper
import com.wildstangs.subjects.base.Subject; //导入依赖的package包/类
public WsHopper(String name) {
super(name);
init();
Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON6);
subject.attach(this);
subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON8);
subject.attach(this);
subject = WsInputManager.getInstance().getSensorInput(WsInputManager.HOPPER_DOWN_LIMIT_SWITCH).getSubject((ISubjectEnum) null);
subject.attach(this);
subject = WsInputManager.getInstance().getSensorInput(WsInputManager.HOPPER_UP_LIMIT_SWITCH).getSubject((ISubjectEnum) null);
subject.attach(this);
subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON1);
subject.attach(this);
//Needed for tomahawk control
subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON5);
subject.attach(this);
}
示例11: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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: WsLED
import com.wildstangs.subjects.base.Subject; //导入依赖的package包/类
public WsLED(String name) {
super(name);
//Fire up the message sender thread.
Thread t = new Thread(messageSender = new MessageHandler());
//This is safe because there is only one instance of the subsystem in the subsystem container.
t.start();
//Kicker
Subject subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON6);
subject.attach(this);
//Intake
subject = WsInputManager.getInstance().getOiInput(WsInputManager.MANIPULATOR_JOYSTICK).getSubject(WsManipulatorJoystickButtonEnum.BUTTON5);
subject.attach(this);
//Climb
subject = WsInputManager.getInstance().getOiInput(WsInputManager.DRIVER_JOYSTICK).getSubject(WsDriverJoystickButtonEnum.BUTTON2);
subject.attach(this);
}
示例13: acceptNotification
import com.wildstangs.subjects.base.Subject; //导入依赖的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;
}
}
示例14: initialize
import com.wildstangs.subjects.base.Subject; //导入依赖的package包/类
public void initialize() {
Subject subject = WsInputManager.getInstance().getSensorInput(WsInputManager.FUNNELATOR_LIMIT_SWITCH).getSubject((ISubjectEnum) null);
subject.attach(this);
numLatchedDiscs = ((WsIntake) WsSubsystemContainer.getInstance().getSubsystem(WsSubsystemContainer.WS_INTAKE)).getNumLatchedDiscs();
if (numLatchedDiscs == 0) {
//No discs were collected, no need to intake
finished = true;
// numLatchedDiscs = 1 ;
}
}
开发者ID:wildstang111,项目名称:2013_drivebase_proto,代码行数:11,代码来源:WsAutonomousStepWaitForDiscsLatchedThroughFunnelator.java
示例15: initialize
import com.wildstangs.subjects.base.Subject; //导入依赖的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