From: Kevin Zhang Date: Mon, 15 Feb 2016 00:31:20 +0000 (-0800) Subject: Delete unused methods and correct logic errors X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=cef820abab686c8bb7f7cc85428183f1cf110edd Delete unused methods and correct logic errors --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 65fca516..23268168 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -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; } diff --git a/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java b/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java index 304c983a..8f3f4281 100644 --- a/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java +++ b/src/org/usfirst/frc/team3501/robot/commands/scaler/RunWinchContinuous.java @@ -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 index 00000000..d6bfef09 --- /dev/null +++ b/src/org/usfirst/frc/team3501/robot/commands/scaler/StopWinch.java @@ -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(); + } + +} diff --git a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java index c6d40077..e56e4a81 100755 --- a/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java +++ b/src/org/usfirst/frc/team3501/robot/subsystems/Scaler.java @@ -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() {