Class WsSparkFollowerConfig
java.lang.Object
org.wildstang.hardware.roborio.outputs.config.WsSparkFollowerConfig
- All Implemented Interfaces:
OutputConfig
Contains configurations for Spark Max/Flex motor controller followers.
-
Constructor Summary
ConstructorsConstructorDescriptionWsSparkFollowerConfig(String following, int channel, WsMotorControllers controller) Construct the Phoenix config.WsSparkFollowerConfig(String following, int channel, WsMotorControllers controller, boolean oppose) Construct the Phoenix config. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the hardware port number.Returns the name of the followed motor controller.getType()Returns true if the motor controller is a Talon.booleanReturns if the follower should oppose the followed.toString()Builds a JSON String describing the Phoenix config.
-
Constructor Details
-
WsSparkFollowerConfig
Construct the Phoenix config.- Parameters:
following- Name of motor controller being followed.channel- Hardware port number.controller- Enumeration representing type of controller.
-
WsSparkFollowerConfig
public WsSparkFollowerConfig(String following, int channel, WsMotorControllers controller, boolean oppose) Construct the Phoenix config.- Parameters:
following- Name 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 Details
-
getFollowing
Returns the name of the followed motor controller.- Returns:
- The name of followed motor controller.
-
getChannel
public int getChannel()Returns the hardware port number.- Returns:
- The hardware port number.
-
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
Builds a JSON String describing the Phoenix config.
-