Class WsPhoenixConfig
- java.lang.Object
-
- org.wildstang.hardware.roborio.outputs.config.WsPhoenixConfig
-
- All Implemented Interfaces:
OutputConfig
public class WsPhoenixConfig extends java.lang.Object implements OutputConfig
Contains configurations for Phoenix Talon and Victor motor controllers.
-
-
Constructor Summary
Constructors Constructor Description WsPhoenixConfig(int channel, WsMotorControllers controller)
Construct the Phoenix config.WsPhoenixConfig(int channel, WsMotorControllers controller, boolean invert)
Construct the Phoenix config.WsPhoenixConfig(int channel, WsMotorControllers controller, boolean invert, double p_default)
Construct the Phoenix config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChannel()
Returns the hardware port number.double
getDefault()
Returns the default output value.WsMotorControllers
getType()
Returns true if the motor controller is a Talon.boolean
isInverted()
Returns if the controller should be inverted.java.lang.String
toString()
Builds a JSON String describing the Phoenix config.
-
-
-
Constructor Detail
-
WsPhoenixConfig
public WsPhoenixConfig(int channel, WsMotorControllers controller)
Construct the Phoenix config.- Parameters:
channel
- Controller CAN constant.controller
- Enumeration representing type of controller.
-
WsPhoenixConfig
public WsPhoenixConfig(int channel, WsMotorControllers controller, boolean invert)
Construct the Phoenix config.- Parameters:
channel
- Controller CAN constant.controller
- Enumeration representing type of controller.invert
- True if motor output should be inverted.
-
WsPhoenixConfig
public WsPhoenixConfig(int channel, WsMotorControllers controller, boolean invert, double p_default)
Construct the Phoenix config.- Parameters:
channel
- Controller CAN constant.controller
- Enumeration representing type of controller.invert
- True if motor output should be inverted.p_default
- Default output value.
-
-
Method Detail
-
getChannel
public int getChannel()
Returns the hardware port number.- Returns:
- The hardware port number.
-
getDefault
public double getDefault()
Returns the default output value.- Returns:
- The default value.
-
getType
public WsMotorControllers getType()
Returns true if the motor controller is a Talon.- Returns:
- True if Talon, false if Victor.
-
isInverted
public boolean isInverted()
Returns if the controller should be inverted.- Returns:
- True if inverted.
-
toString
public java.lang.String toString()
Builds a JSON String describing the Phoenix config.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Channel number and controller type.
-
-