/* 
 * Copyright (c) 2016 RobotsByTheC. All rights reserved.
 *
 * Open Source Software - may be modified and shared by FRC teams. The code must
 * be accompanied by the BSD license file in the root directory of the project.
 */
package org.usfirst.frc.team2084.CMonster2016.commands;

import org.usfirst.frc.team2084.CMonster2016.Robot;
import org.usfirst.frc.team2084.CMonster2016.subsystems.ShooterSubsystem;

/**
 * Sets the shooter firing servo. Even though the firing servo is part of the
 * shooter, this command does not require the {@link ShooterSubsystem}, because
 * it pretty much separate from it.
 */
public class SetFiringServo extends ParameterCommand {

    public static final String FIRE_KEY = "Fire";

    private boolean m_fire;

    /**
     * Sets the firing servo position.
     * 
     * @param fire if true, extend the servo, otherwise retract it
     */
    public SetFiringServo(boolean fire) {
        m_fire = fire;

        addBooleanParameter(FIRE_KEY, fire);
    }

    @Override
    protected void initialize() {
        m_fire = getBooleanParameter(FIRE_KEY);
    }

    @Override
    protected void execute() {
        Robot.shooterSubsystem.setFiringServo(m_fire);
    }

    @Override
    protected boolean isFinished() {
        return true;
    }

    @Override
    protected void end() {
    }

    @Override
    protected void interrupted() {
    }
}

@@ -406,16 +406,77 @@
 ystem;%0A%0A
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;%0A%0A
 /**%0A * S
@@ -763,52 +763,323 @@
  FIR
-E_KEY = %22Fire%22;%0A%0A    private boolean m_fire;
+ING_SERVO_ACTUATION_KEY = %22Firing Servo Actuations%22;%0A%0A    public static final String FIRE_KEY = %22Fire%22;%0A%0A    private boolean m_fire;%0A%0A    private static int actuations = 0;%0A    private static boolean lastPosition = false;%0A%0A    static %7B%0A        SmartDashboard.putNumber(FIRING_SERVO_ACTUATION_KEY, actuations);%0A    %7D
 %0A%0A  
@@ -1420,16 +1420,179 @@
 E_KEY);%0A
+        if (m_fire != lastPosition) %7B%0A            SmartDashboard.putNumber(FIRING_SERVO_ACTUATION_KEY, ++actuations);%0A            lastPosition = m_fire;%0A        %7D%0A
     %7D%0A%0A 

Add firing servo actuation counter.