Test Failed
Push — master ( 519662...d9c046 )
by John
04:15 queued 01:23
created

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

Complexity

Total Complexity 6

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

8 Methods

Rating   Name   Duplication   Size   Complexity  
toggleArms 0 2 ?
A initDefaultCommand() 0 1 1
A SubsystemClamp() 0 4 1
A toggleArms() 0 2 2
closeArms 0 4 ?
A openArms() 0 4 1
openArms 0 4 ?
A closeArms() 0 4 1
1
package org.usfirst.frc.team3695.robot.subsystems;
2
3
import org.usfirst.frc.team3695.robot.Constants;
4
5
import edu.wpi.first.wpilibj.Solenoid;
6
import edu.wpi.first.wpilibj.command.Subsystem;
7
8
/**
9
 * opens and closes the clamp part of the manipulator
10
 */
11
public class SubsystemClamp extends Subsystem {
12
	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...
13
	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...
14
	private boolean open; // current State of arms; true = open, false = closed
15
	
16
	public SubsystemClamp(){
17
		openArms = new Solenoid(Constants.OPEN_ARMS);
18
		closeArms = new Solenoid(Constants.CLOSE_ARMS);
19
		open = false;
20
	}
21
22
    public void initDefaultCommand() {}
23
    
24
    public void openArms(){
25
    	openArms.set(true);
26
    	closeArms.set(false);
27
    	open = true;
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