/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.edinarobotics.zephyr.autonomous;

import com.edinarobotics.utils.autonomous.AutonomousStep;
import com.edinarobotics.zephyr.Zephyr;
import edu.wpi.first.wpilibj.Timer;

/**
 *
 * @author Danny
 */
public class ShooterStep extends AutonomousStep{
    private static final double SHOOTER_WARMUP_DELAY = 3;
    private static final double SHOOTER_PISTON_UP_TIME = 0.5;
    
    double shooterSpeed;
    Zephyr robot;
    Timer time;
    boolean isFinished;
   
    public ShooterStep(double shooterSpeed,Zephyr robot)
    {
        this.shooterSpeed = shooterSpeed;
        this.robot = robot;
        time = new Timer();
        isFinished = false;
    }
    
    public void start()
    {
        robot.shooterSpeed = -shooterSpeed;
        robot.mechanismSet();
        time.start();
    }
    
    public void run()
    {
        if(time.get() >= SHOOTER_WARMUP_DELAY+SHOOTER_PISTON_UP_TIME){
            robot.ballLoaderUp = false;
            robot.mechanismSet();
            isFinished = true;
        }
        else if(time.get() >= SHOOTER_WARMUP_DELAY){
            robot.ballLoaderUp = true;
            robot.mechanismSet();
        }
        else{
            robot.mechanismSet();
        }
    }
    
    public boolean isFinished()
    {
        return isFinished;
    }
    
}

@@ -1395,10 +1395,102 @@
  %7D%0A    %0A
+    public void stop()%7B%0A        robot.shooterSpeed = 0;%0A        robot.mechanismSet();%0A    %7D%0A
 %7D%0A

Add shooter stop instruction to ShooterStep.