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