Class WsPhoenixConfig

  • All Implemented Interfaces:
    OutputConfig

    public class WsPhoenixConfig
    extends java.lang.Object
    implements OutputConfig
    Contains configurations for Phoenix Talon and Victor motor controllers.
    • 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 class java.lang.Object
        Returns:
        Channel number and controller type.