Class WsPhoenixFollowerConfig
- java.lang.Object
-
- org.wildstang.hardware.roborio.outputs.config.WsPhoenixFollowerConfig
-
- All Implemented Interfaces:
OutputConfig
public class WsPhoenixFollowerConfig extends java.lang.Object implements OutputConfig
Contains configurations for Phoenix Talon and Victor motor controller followers.
-
-
Constructor Summary
Constructors Constructor Description WsPhoenixFollowerConfig(Outputs following, int channel, WsMotorControllers controller)
Construct the Phoenix config.WsPhoenixFollowerConfig(Outputs following, int channel, WsMotorControllers controller, boolean oppose)
Construct the Phoenix config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChannel()
Returns the hardware port number.Outputs
getFollowing()
Returns the enumeration of followed motor controller.WsMotorControllers
getType()
Returns true if the motor controller is a Talon.boolean
isOpposing()
Returns if the follower should oppose the followed.java.lang.String
toString()
Builds a JSON String describing the Phoenix config.
-
-
-
Constructor Detail
-
WsPhoenixFollowerConfig
public WsPhoenixFollowerConfig(Outputs following, int channel, WsMotorControllers controller)
Construct the Phoenix config.- Parameters:
following
- Enumeration of motor controller being followed.channel
- Hardware port number.controller
- Enumeration representing type of controller.
-
WsPhoenixFollowerConfig
public WsPhoenixFollowerConfig(Outputs following, int channel, WsMotorControllers controller, boolean oppose)
Construct the Phoenix config.- Parameters:
following
- Enumeration of motor controller being followed.channel
- Hardware port number.controller
- Enumeration representing type of controller.oppose
- True if the follow should oppose the direction of this motor.
-
-
Method Detail
-
getFollowing
public Outputs getFollowing()
Returns the enumeration of followed motor controller.- Returns:
- The followed motor controller.
-
getChannel
public int getChannel()
Returns the hardware port number.- Returns:
- The hardware port number.
-
getType
public WsMotorControllers getType()
Returns true if the motor controller is a Talon.- Returns:
- True if Talon, false if Victor.
-
isOpposing
public boolean isOpposing()
Returns if the follower should oppose the followed.- Returns:
- True if opposing.
-
toString
public java.lang.String toString()
Builds a JSON String describing the Phoenix config.- Overrides:
toString
in classjava.lang.Object
- Returns:
- Channel number, is talon, and is opposing.
-
-