package com.team254.frc2013.subsystems;

import com.team254.frc2013.Constants;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;

/**
 * Represents the six motors in the drive gearbox.
 * Used by the drive and the climbing mechanism via power take-off.
 *
 * @author eliwu26@gmail.com (Elias Wu)
 */
public class DriveMotors extends Subsystem{
  private Talon leftDriveA = new Talon(Constants.leftDrivePortA.getInt());
  private Talon leftDriveB = new Talon(Constants.leftDrivePortB.getInt());
  private Talon leftDriveC = new Talon(Constants.leftDrivePortC.getInt());
  private Talon rightDriveA = new Talon(Constants.rightDrivePortA.getInt());
  private Talon rightDriveB = new Talon(Constants.rightDrivePortB.getInt());
  private Talon rightDriveC = new Talon(Constants.rightDrivePortC.getInt());
  
  private boolean isDriveMode = true;
  
  public void driveLR(double leftPower, double rightPower){
    leftDriveA.set(leftPower);
    leftDriveB.set(leftPower);
    leftDriveC.set(leftPower);
    rightDriveA.set(rightPower);
    rightDriveB.set(rightPower);
    rightDriveC.set(rightPower);
  }
  
  public void set(double allPower){
    driveLR(allPower, -allPower);
  }
  
  public void setMotor(int portNum, double power) {
    if(portNum == 3) {
      rightDriveA.set(power);
    }
    else if(portNum == 4) {
      rightDriveB.set(power);
    }
    else if(portNum == 5) {
      rightDriveC.set(power);
    }
    else if(portNum == 6) {
      leftDriveA.set(power);
    }
    else if(portNum == 7) {
      leftDriveB.set(power);
    }
    else if(portNum == 8) {
      leftDriveC.set(power);
    }
  }
  
  public void setDriveMode(boolean wantsDrive) {
    isDriveMode = wantsDrive;
  }
  
  public boolean isDriveMode() {
    return isDriveMode;
  }
  
  protected void initDefaultCommand() {
  }
}

@@ -927,24 +927,49 @@
 ightPower)%7B%0A
+    if (isDriveMode) %7B%0A  
     leftDriv
@@ -979,32 +979,34 @@
 set(leftPower);%0A
+  
     leftDriveB.s
@@ -1020,24 +1020,26 @@
 Power);%0A    
+ 
+ 
 leftDriveC.s
@@ -1045,32 +1045,34 @@
 set(leftPower);%0A
+  
     rightDriveA.
@@ -1084,32 +1084,34 @@
 ightPower);%0A    
+  
 rightDriveB.set(
@@ -1119,24 +1119,26 @@
 ightPower);%0A
+  
     rightDri
@@ -1150,32 +1150,38 @@
 et(rightPower);%0A
+    %7D%0A
   %7D%0A  %0A  public 
@@ -1215,37 +1215,231 @@
     
-driveLR(allPower, -allPower);
+if (!isDriveMode) %7B%0A      leftDriveA.set(allPower);%0A      leftDriveB.set(allPower);%0A      leftDriveC.set(allPower);%0A      rightDriveA.set(-allPower);%0A      rightDriveB.set(-allPower);%0A      rightDriveC.set(-allPower);%0A    %7D
 %0A  %7D

Fix DriveMotors