Delete unused methods and correct logic errors
authorKevin Zhang <icestormf1@gmail.com>
Mon, 15 Feb 2016 00:31:20 +0000 (16:31 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Mon, 15 Feb 2016 00:31:20 +0000 (16:31 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java
src/org/usfirst/frc/team3501/robot/commands/scaler/StopWinch.java [new file with mode: 0644]
src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java

index 65fca516efc02c971de76cbbd46ba2327d25fe32..232681683e28fb1fa029574f40514dd0aedaa85b 100644 (file)
@@ -59,13 +59,13 @@ public class Constants {
   public static class Scaler {
     // Piston channels
     public final static int FORWARD_CHANNEL = 0;
-    public final static int REVERSE_CHANNEL = 0;
+    public final static int REVERSE_CHANNEL = 1;
 
     // Winch port
     public final static int WINCH_MOTOR = 0;
 
     // Winch speeds
-    public final static double WINCH_STOP_SPEED = 00;
+    public final static double WINCH_STOP_SPEED = 0.0;
 
   }
 
index 304c983aac6a925666a72e322bfb31b1eaad4115..8f3f428167e525b9ee35ebc5b7e288c41258b6a3 100644 (file)
@@ -1,4 +1,4 @@
-package org.usfirst.frc.team3501.robot.commands;
+package org.usfirst.frc.team3501.robot.commands.scaler;
 
 import org.usfirst.frc.team3501.robot.Robot;
 
@@ -41,7 +41,6 @@ public class RunWinchContinuous extends Command {
 
   @Override
   protected void end() {
-    Robot.scaler.stopWinch();
   }
 
   @Override
diff --git a/src/org/usfirst/frc/team3501/robot/commands/scaler/StopWinch.java b/src/org/usfirst/frc/team3501/robot/commands/scaler/StopWinch.java
new file mode 100644 (file)
index 0000000..d6bfef0
--- /dev/null
@@ -0,0 +1,34 @@
+package org.usfirst.frc.team3501.robot.commands.scaler;
+
+import org.usfirst.frc.team3501.robot.Robot;
+
+import edu.wpi.first.wpilibj.command.Command;
+
+public class StopWinch extends Command {
+
+  @Override
+  protected void initialize() {
+    Robot.scaler.stopWinch();
+  }
+
+  @Override
+  protected void execute() {
+
+  }
+
+  @Override
+  protected boolean isFinished() {
+    return true;
+  }
+
+  @Override
+  protected void end() {
+
+  }
+
+  @Override
+  protected void interrupted() {
+    end();
+  }
+
+}
index c6d400778e523692a5d1ff88449510bc7822a825..e56e4a81721df4c9d9ea28b2b3a3f555cb6da534 100755 (executable)
@@ -8,32 +8,25 @@ import edu.wpi.first.wpilibj.DoubleSolenoid.Value;
 import edu.wpi.first.wpilibj.command.Subsystem;
 
 public class Scaler extends Subsystem {
-  private DoubleSolenoid piston;
+  private DoubleSolenoid scaler;
   private CANTalon winch;
 
   public Scaler() {
-    piston = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL,
+    scaler = new DoubleSolenoid(Constants.Scaler.FORWARD_CHANNEL,
         Constants.Scaler.REVERSE_CHANNEL);
     winch = new CANTalon(Constants.Scaler.WINCH_MOTOR);
   }
 
   public Value getSolenoidValue() {
-    return piston.get();
+    return scaler.get();
   }
 
   public void liftScissorLift() {
-    piston.set(DoubleSolenoid.Value.kReverse);
+    scaler.set(DoubleSolenoid.Value.kReverse);
   }
 
   public void lowerScissorLift() {
-    piston.set(DoubleSolenoid.Value.kForward);
-  }
-
-  public void engageHook() {
-
-  }
-
-  public void disengageHook() {
+    scaler.set(DoubleSolenoid.Value.kForward);
   }
 
   public void runWinch(double speed) {
@@ -49,29 +42,6 @@ public class Scaler extends Subsystem {
     runWinch(Constants.Scaler.WINCH_STOP_SPEED);
   }
 
-  /***
-   * This method returns boolean value true or false on whether piston is
-   * extended or not.
-   *
-   * @return returns true if piston is extended, false if otherwise.
-   */
-  public boolean getPistonStatus() {
-    return true;
-  }
-
-  /***
-   * This method sets the piston status for the scissor lift. The piston can
-   * either be extended or not extended.
-   *
-   * @param status
-   *          The status of the piston. 0 for the piston to be extended, 1 for
-   *          the piston to not be extended.
-   */
-
-  public void setPistonStatus(int status) {
-
-  }
-
   @Override
   protected void initDefaultCommand() {