001/* Copyright (C) Cross The Road Electronics 2024 */
002package com.ctre.phoenix.led;
003
004import com.ctre.phoenix.CustomParamConfiguration;
005import com.ctre.phoenix.led.CANdle.LEDStripType;
006import com.ctre.phoenix.led.CANdle.VBatOutputMode;
007
008/**
009 * Configurables available to CANdle
010 */
011public class CANdleConfiguration extends CustomParamConfiguration{
012    /**
013     * What type of LEDs the CANdle controls
014     */
015    public LEDStripType stripType = LEDStripType.RGB;
016    /**
017     * Brightness scalar for all LEDs controlled
018     */
019    public double brightnessScalar = 1.0;
020    /**
021     * True to turn off LEDs when Loss of Signal occurrs
022     */
023    public boolean disableWhenLOS = false;
024    /**
025     * True to turn off Status LED when CANdle is actively being controlled
026     */
027    public boolean statusLedOffWhenActive = false;
028    /**
029     * The behavior of VBat output
030     */
031    public VBatOutputMode vBatOutputMode = VBatOutputMode.On;
032    /**
033     * True to turn off the 5V rail. This turns off the on-board LEDs as well.
034     */
035    public boolean v5Enabled = false;
036
037    public CANdleConfiguration() {
038    }
039
040    /**
041     * @return String representation of configs
042     */
043    public String toString() {
044        return toString("");
045    }
046
047    /**
048     * @param prependString
049     *              String to prepend to configs
050     * @return String representation of configs
051     */
052    public String toString(String prependString) {
053
054        String retstr = prependString + ".stripType = " + stripType.toString() + ";\n";
055        retstr += prependString + ".brightnessScalar = " + String.valueOf(brightnessScalar) + ";\n";
056        retstr += prependString + ".disableWhenLOS = " + String.valueOf(disableWhenLOS) + ";\n";
057        retstr += prependString + ".statusLedOffWhenActive = " + String.valueOf(statusLedOffWhenActive) + ";\n";
058        retstr += prependString + ".vBatOutputMode = " + String.valueOf(vBatOutputMode) + ";\n";
059        retstr += prependString + ".v5Enabled = " + String.valueOf(v5Enabled) + ";\n";
060
061        retstr += super.toString(prependString);
062
063        return retstr;
064    }
065
066}