org.usfirst.frc.team3695.robot.subsystems.SubsystemClamp   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
c 0
b 0
f 0
dl 0
loc 28
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
toggleArms 0 2 ?
A toggleArms() 0 2 2
closeArms 0 4 ?
A closeArms() 0 4 1
A initDefaultCommand() 0 1 1
A SubsystemClamp() 0 4 1
A openArms() 0 4 1
openArms 0 4 ?
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