001package com.ctre.phoenix.motorcontrol.can;
002
003import com.ctre.phoenix.motorcontrol.FeedbackDevice;
004
005/**
006 * Configurables available to TalonSRX
007 */
008public class TalonSRXConfiguration extends com.ctre.phoenix.motorcontrol.can.BaseTalonConfiguration {
009
010    /**
011     * Peak current in amps
012     * 
013         * Current limit is activated when current exceeds the peak limit for longer
014         * than the peak duration. Then software will limit to the continuous limit.
015         * This ensures current limiting while allowing for momentary excess current
016         * events.
017     */
018    public int peakCurrentLimit;
019    /**
020     * Peak Current duration in milliseconds
021     * 
022         * Current limit is activated when current exceeds the peak limit for longer
023         * than the peak duration. Then software will limit to the continuous limit.
024         * This ensures current limiting while allowing for momentary excess current
025         * events.
026     */
027    public int peakCurrentDuration;
028    /**
029     * Continuous current in amps
030     * 
031         * Current limit is activated when current exceeds the peak limit for longer
032         * than the peak duration. Then software will limit to the continuous limit.
033         * This ensures current limiting while allowing for momentary excess current
034         * events.
035     */
036    public int continuousCurrentLimit;
037
038        public TalonSRXConfiguration() {
039        super(FeedbackDevice.QuadEncoder);
040        peakCurrentLimit = 1;
041        peakCurrentDuration = 1;
042        continuousCurrentLimit = 1;
043        }
044
045    /**
046     * @return String representation of all the configs
047     */
048        public String toString() {
049                return toString("");
050        }
051
052    /**
053     * @param prependString
054     *              String to prepend to all the configs
055     * @return String representation of all the configs
056     */
057    public String toString(String prependString) {
058
059
060        String retstr = prependString + ".peakCurrentLimit = " + String.valueOf(peakCurrentLimit) + ";\n";
061        retstr += prependString + ".peakCurrentDuration = " + String.valueOf(peakCurrentDuration) + ";\n";
062        retstr += prependString + ".continuousCurrentLimit = " + String.valueOf(continuousCurrentLimit) + ";\n";
063         retstr += super.toString(prependString);
064
065       return retstr;
066    }
067
068}
069