Added and implemented GetInverted method.

Change-Id: I53bd51e41311e3ffcd3fa3ffbc4e72cfab530109
This commit is contained in:
Joseph
2015-06-15 15:32:47 -04:00
committed by James Kuszmaul
parent 0122086d23
commit bd64d9a7ef
25 changed files with 226 additions and 32 deletions

View File

@@ -432,6 +432,17 @@ public class CANJaguar implements MotorSafety, PIDOutput, PIDInterface, CANSpeed
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Check all unverified params and make sure they're equal to their local
* cached versions. If a value isn't available, it gets requested. If a value

View File

@@ -169,15 +169,26 @@ public class CANTalon implements MotorSafety, PIDOutput, PIDSource, PIDInterface
}
/**
* Inverts the direction of the motor's rotation
* Only works in PercentVbus mode
* Inverts the direction of the motor's rotation.
* Only works in PercentVbus mode.
*
* @param isInverted The state of inversion true is inverted
* @param isInverted The state of inversion, true is inverted.
*/
@Override
public void setInverted(boolean isInverted) {
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Sets the output of the Talon.

View File

@@ -82,15 +82,26 @@ private boolean isInverted = false;
}
/**
* Common interface for inverting direction of a speed controller
* Common interface for inverting direction of a speed controller.
*
* @param isInverted The state of inversion true is inverted
* @param isInverted The state of inversion, true is inverted.
*/
@Override
public void setInverted(boolean isInverted) {
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Get the recently set value of the PWM.
*

View File

@@ -35,11 +35,23 @@ public interface SpeedController extends PIDOutput {
void set(double speed);
/**
* Common interface for inverting direction of a speed controller
* Common interface for inverting direction of a speed controller.
*
* @param isInverted The state of inversion true is inverted
* @param isInverted The state of inversion true is inverted.
*/
void setInverted(boolean isInverted);
/**
* Common interface for returning if a speed controller
* is in the inverted state or not.
*
* @return isInverted The state of the inversion true is inverted.
*
*/
boolean getInverted();
/**
* Disable the speed controller
*/

View File

@@ -89,6 +89,17 @@ private boolean isInverted = false;
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Get the recently set value of the PWM.
*

View File

@@ -81,15 +81,26 @@ public class TalonSRX extends SafePWM implements SpeedController {
}
/**
* Common interface for inverting direction of a speed controller
* Common interface for inverting direction of a speed controller.
*
* @param isInverted The state of inversion true is inverted
* @param isInverted The state of inversion, true is inverted.
*/
@Override
public void setInverted(boolean isInverted) {
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Get the recently set value of the PWM.
*

View File

@@ -94,6 +94,17 @@ private boolean isInverted = false;
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Get the recently set value of the PWM.
*

View File

@@ -89,6 +89,17 @@ private boolean isInverted = false;
this.isInverted = isInverted;
}
/**
* Common interface for the inverting direction of a speed controller.
*
* @return isInverted The state of inversion, true is inverted.
*
*/
@Override
public boolean getInverted() {
return this.isInverted;
}
/**
* Get the recently set value of the PWM.
*