Test Failed
Pull Request — master (#114)
by
unknown
02:02
created

org.usfirst.frc.team3695.robot.OI   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 48
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B OI() 0 37 1
1
package org.usfirst.frc.team3695.robot;
2
3
import org.usfirst.frc.team3695.robot.commands.*;
4
import org.usfirst.frc.team3695.robot.enumeration.Position;
5
import org.usfirst.frc.team3695.robot.util.Util;
6
import org.usfirst.frc.team3695.robot.util.Xbox;
7
8
import edu.wpi.first.wpilibj.DriverStation;
9
import edu.wpi.first.wpilibj.Joystick;
10
import edu.wpi.first.wpilibj.buttons.Button;
11
import edu.wpi.first.wpilibj.buttons.JoystickButton;
12
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
13
14
/** the output/input setup */
15
public class OI {
16
	
17
	public static final Joystick DRIVER = new Joystick(0);
18
	public static final Joystick OPERATOR = new Joystick(1);
19
	
20
	/** 
21
	 * assigns what every SmartDash and controller button does
22
	 * 
23
	 * ye() gets called at teleop enable, assigning button values to controller input
24
	 * still in ye(), below controller value assigns, place each SmartDash button
25
	 * */
26
	public OI() {
0 ignored issues
show
Best Practice introduced by
Hide this public constructor.
Loading history...
27
		/// manipulator clamp
28
			Button toggleClamp = new JoystickButton(OPERATOR, Xbox.A);
29
				toggleClamp.toggleWhenActive(new ButtonCommandClamp());
30
		/// candy cane
31
			Button toggleHook = new JoystickButton(OPERATOR, Xbox.B);
32
				toggleHook.toggleWhenActive(new ButtonCommandHook());
33
		
34
		/// To Compress, or Not To Compress. It is now an option.
35
			SmartDashboard.putData("Disable Compressor", new ButtonCommandKillCompressor());
36
37
		/// PID
38
			SmartDashboard.putData("Kill PID", new ButtonCommandKillPID());
39
			SmartDashboard.putNumber("Right Encoder Position", 0);
40
			SmartDashboard.putNumber("Left Encoder Position", 0);
41
			
42
		/// limit switch displays
43
			SmartDashboard.putBoolean("Lower Screw", true);
44
	    	SmartDashboard.putBoolean("Mid Position", false);
45
	    	SmartDashboard.putBoolean("Upper Screw", false);
46
	    	SmartDashboard.putBoolean("Lower Pinion", true);
47
	    	SmartDashboard.putBoolean("Upper Pinion", false);
48
	    	
49
	    	SmartDashboard.putNumber("Left inches", 0);
50
	    	SmartDashboard.putNumber("Right inches", 0);
51
	    	
52
	    	DriverStation.reportWarning("OI IS INSTANTIATED", false);
53
54
	    /// Cyborg command buttons
55
			SmartDashboard.putData("Ascend", new CyborgCommandAscend());
56
			SmartDashboard.putNumber("Drive Direct Power", 0);
57
			SmartDashboard.putData("Drive Direct", new CyborgCommandDriveDirect(Util.getAndSetDouble("Drive Direct Power", 0)));
58
			SmartDashboard.putNumber("Drive Distance Inches", 0);
59
			SmartDashboard.putData("Drive Distance", new CyborgCommandDriveDistance(Util.getAndSetDouble("Drive Distance Inches", 0)));
60
			SmartDashboard.putData("Drive Until Error", new CyborgCommandDriveUntilError(Position.FORWARD));
61
			SmartDashboard.putNumber("Rotate Degrees", 0);
62
			SmartDashboard.putData("Rotate Degree", new CyborgCommandRotateDegrees(Util.getAndSetDouble("Rotate Degrees", 0)));
63
	}
64
	
65
}