org.usfirst.frc.team3695.robot.commands.CommandWait   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
dl 0
loc 26
c 1
b 0
f 0
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A isFinished() 0 2 1
A end() 0 2 1
A interrupted() 0 2 1
A execute() 0 1 1
A initialize() 0 3 1
A CommandWait(long) 0 2 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.DriverStation;
4
import edu.wpi.first.wpilibj.command.Command;
5
6
/**
7
 * Enables and disables the shooter
8
 */
9
public class CommandWait extends Command {
10
11
	private long wait;
12
	private long startTime;
13
	
14
    public CommandWait(long time) {
15
        this.wait = time;
16
    }
17
18
    protected void initialize() {
19
    	DriverStation.reportWarning("WAITING " + wait + " MILISECONDS", false);
20
    	startTime = System.currentTimeMillis();
21
    }
22
23
    protected void execute() {}
24
25
    protected boolean isFinished() {
26
        return startTime + wait < System.currentTimeMillis();
27
    }
28
29
    protected void end() {
30
    	DriverStation.reportWarning("DONE WAITING", false);
31
    }
32
33
    protected void interrupted() {
34
    	end();
35
    }
36
}
37