SubsystemClamp()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
1
package org.usfirst.frc.team3695.robot.subsystems;
2
3
import edu.wpi.first.wpilibj.Solenoid;
4
import edu.wpi.first.wpilibj.command.Subsystem;
5
import org.usfirst.frc.team3695.robot.Constants;
6
7
/**
8
 * opens and closes the clamp part of the manipulator
9
 */
10
public class SubsystemClamp extends Subsystem {
11
	private Solenoid openArms;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like openArms. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
12
	private Solenoid closeArms;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like closeArms. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
13
	private boolean open; // current State of arms; true = open, false = closed
14
	
15
	public SubsystemClamp(){
16
		openArms = new Solenoid(Constants.OPEN_ARMS);
17
		closeArms = new Solenoid(Constants.CLOSE_ARMS);
18
		open = false;
19
	} 
20
21
    public void initDefaultCommand() {}
22
   
23
    public void openArms(){
24
    	openArms.set(true);
25
    	closeArms.set(false);
26
    	open = true;
27
    }
28
29
    
30
    public void closeArms(){
31
    	openArms.set(false);
32
    	closeArms.set(true);
33
    	open = false;
34
    }
35
    
36
    public void toggleArms(){
37
    	if (open) closeArms();	else openArms();
38
    }
39
}
40
41