add timeout variable
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / scaler / RunWinchContinuous.java
index 8f3f428167e525b9ee35ebc5b7e288c41258b6a3..5b45d0b4d3fad18e07e83f7272012843d03117e7 100644 (file)
@@ -19,14 +19,17 @@ import edu.wpi.first.wpilibj.command.Command;
 
 public class RunWinchContinuous extends Command {
   private double winchUpSpeed;
+  private int timeoutAmount;
 
-  public RunWinchContinuous(double speed) {
+  public RunWinchContinuous(double speed, int timeout) {
     requires(Robot.scaler);
     winchUpSpeed = speed;
+    timeoutAmount = timeout;
   }
 
   @Override
   protected void initialize() {
+    this.setTimeout(timeoutAmount);
     Robot.scaler.runWinch(winchUpSpeed);
   }
 
@@ -36,7 +39,7 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected boolean isFinished() {
-    return true;
+    return this.isTimedOut();
   }
 
   @Override