Completed
Push — master ( 0672dd...74c8db )
by John
33s
created

org.usfirst.frc.team3695.robot.commands.CyborgCommandGoToMid   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

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

6 Methods

Rating   Name   Duplication   Size   Complexity  
A interrupted() 0 2 1
A isFinished() 0 3 1
A initialize() 0 3 1
A execute() 0 3 2
A end() 0 1 1
A CyborgCommandGoToMid() 0 2 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.DigitalInput;
4
import edu.wpi.first.wpilibj.DriverStation;
5
6
import org.usfirst.frc.team3695.robot.Robot;
7
import org.usfirst.frc.team3695.robot.enumeration.Position;
8
9
import edu.wpi.first.wpilibj.command.Command;
10
11
/**
12
 * toggles the state of the clamp
13
 */
14
public class CyborgCommandGoToMid extends Command {
15
	
16
	Boolean isFinished;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like isFinished. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
17
	
18
    public CyborgCommandGoToMid() {
19
        requires(Robot.SUB_MAST);
20
    }
21
22
    protected void initialize() {
23
    	DriverStation.reportWarning("MOVING TO MID POSITION", false);
24
    	isFinished = true;
25
    }
26
27
    protected void execute() {
28
    	if (!isFinished) {
29
    		isFinished = Robot.SUB_MAST.goToMiddle();
30
    	}
31
    }
32
33
    protected boolean isFinished() {
34
    	DriverStation.reportWarning("AT MID POSITION", false);
35
    	return isFinished; 
36
	}
37
38
    protected void end() {}
39
40
    protected void interrupted() {
41
    	end();
42
    }
43
}
44