Fix conflict for camera feed
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / OI.java
1 package org.usfirst.frc.team3501.robot;
2
3 <<<<<<< HEAD
4 import org.usfirst.frc.team3501.robot.commands.driving.BrakeCANTalons;
5 import org.usfirst.frc.team3501.robot.commands.driving.CoastCANTalons;
6 =======
7 import java.awt.event.KeyEvent;
8 import java.awt.event.KeyListener;
9
10 import org.usfirst.frc.team3501.robot.commands.climber.ToggleWinch;
11 >>>>>>> Fix ChangeCameraView
12 import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
13 import org.usfirst.frc.team3501.robot.commands.intake.ReverseIntakeContinuous;
14 import org.usfirst.frc.team3501.robot.commands.intake.RunIntakeContinuous;
15 import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed;
16 import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed;
17 import org.usfirst.frc.team3501.robot.commands.shooter.ReverseIndexWheelContinuous;
18 import org.usfirst.frc.team3501.robot.commands.shooter.RunFlyWheelContinuous;
19 import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
20 <<<<<<< HEAD
21 import org.usfirst.frc.team3501.robot.commands.shooter.ToggleIndexerPiston;
22 =======
23 >>>>>>> Fix ChangeCameraView
24 import org.usfirst.frc.team3501.robot.utils.ChangeCameraView;
25
26 import edu.wpi.first.wpilibj.Joystick;
27 import edu.wpi.first.wpilibj.buttons.Button;
28 import edu.wpi.first.wpilibj.buttons.JoystickButton;
29
30 <<<<<<< HEAD
31 public class OI /* implements KeyListener */ {
32 =======
33 public class OI implements KeyListener {
34 >>>>>>> Fix ChangeCameraView
35 private static OI oi;
36 public static Joystick leftJoystick;
37 public static Joystick rightJoystick;
38
39 public static Button runIndexWheel;
40 public static Button reverseIndexWheel;
41 public static Button toggleFlyWheel;
42
43 public static Button toggleGear;
44
45 public static Button runIntake;
46 public static Button reverseIntake;
47
48 public static Button increaseShooterSpeed;
49 public static Button decreaseShooterSpeed;
50
51 private static Button changeCam;
52
53 private static Button togglePiston;
54 private static Button toggleDriveTrainPiston;
55
56 public static Button brakeCANTalons;
57 public static Button coastCANTalons;
58
59 public OI() {
60
61 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
62 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
63
64 runIndexWheel = new JoystickButton(rightJoystick,
65 Constants.OI.RUN_INDEXWHEEL_PORT);
66 runIndexWheel.whileHeld(new RunIndexWheelContinuous());
67
68 reverseIndexWheel = new JoystickButton(rightJoystick,
69 Constants.OI.REVERSE_INDEXWHEEL_PORT);
70 reverseIndexWheel.whileHeld(new ReverseIndexWheelContinuous());
71
72 toggleFlyWheel = new JoystickButton(rightJoystick,
73 Constants.OI.TOGGLE_FLYWHEEL_PORT);
74 toggleFlyWheel.toggleWhenPressed(new RunFlyWheelContinuous());
75
76 toggleGear = new JoystickButton(leftJoystick,
77 Constants.OI.TOGGLE_GEAR_PORT);
78 toggleGear.whenPressed(new ToggleGear());
79
80 runIntake = new JoystickButton(leftJoystick, Constants.OI.RUN_INTAKE_PORT);
81 runIntake.whileHeld(new RunIntakeContinuous());
82
83 reverseIntake = new JoystickButton(leftJoystick,
84 Constants.OI.REVERSE_INTAKE_PORT);
85 reverseIntake.whileHeld(new ReverseIntakeContinuous());
86
87 increaseShooterSpeed = new JoystickButton(leftJoystick,
88 Constants.OI.INCREASE_SHOOTER_SPEED_PORT);
89 increaseShooterSpeed.whenPressed(new IncreaseShootingSpeed());
90
91 decreaseShooterSpeed = new JoystickButton(leftJoystick,
92 Constants.OI.DECREASE_SHOOTER_SPEED_PORT);
93 decreaseShooterSpeed.whenPressed(new DecreaseShootingSpeed());
94
95 changeCam = new JoystickButton(rightJoystick,
96 Constants.OI.CHANGE_CAMERA_VIEW);
97 changeCam.toggleWhenPressed(new ChangeCameraView());
98
99 togglePiston = new JoystickButton(rightJoystick,
100 Constants.Shooter.TOGGLE_INDEXER);
101 togglePiston.whenPressed(new ToggleIndexerPiston());
102
103 toggleDriveTrainPiston = new JoystickButton(rightJoystick,
104 Constants.DriveTrain.TOGGLE_DRIVE_PISTON);
105 toggleDriveTrainPiston.whenPressed(new ToggleGear());
106
107 brakeCANTalons = new JoystickButton(rightJoystick,
108 Constants.OI.BRAKE_CANTALONS_PORT);
109 brakeCANTalons.whenPressed(new BrakeCANTalons());
110
111 coastCANTalons = new JoystickButton(rightJoystick,
112 Constants.OI.COAST_CANTALONS_PORT);
113 coastCANTalons.whenPressed(new CoastCANTalons());
114 }
115
116 public static OI getOI() {
117 if (oi == null)
118 oi = new OI();
119 return oi;
120 }
121
122 <<<<<<< HEAD
123 /*
124 * @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() ==
125 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
126 * Robot.getShooter().runIndexWheel(); } }
127 *
128 * @Override public void keyReleased(KeyEvent e) { if (e.getKeyCode() ==
129 * KeyEvent.VK_Z) { // Robot.swapCameraFeed();
130 * Robot.getShooter().stopIndexWheel(); } }
131 *
132 * @Override public void keyTyped(KeyEvent e) { }
133 */
134
135 =======
136 @Override
137 public void keyTyped(KeyEvent e) {
138
139 }
140
141 @Override
142 public void keyPressed(KeyEvent e) {
143 // TODO Auto-generated method stub
144
145 }
146
147 @Override
148 public void keyReleased(KeyEvent e) {
149 // TODO Auto-generated method stub
150
151 }
152 >>>>>>> Fix ChangeCameraView
153 }