001/*
002 * Copyright (C) Cross The Road Electronics.  All rights reserved.
003 * License information can be found in CTRE_LICENSE.txt
004 * For support and suggestions contact support@ctr-electronics.com or file
005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
006 */
007package com.ctre.phoenixpro.signals;
008
009import java.util.HashMap;
010
011/**
012 *  The applied output of the bridge.
013 *
014 * @deprecated Classes in the phoenixpro package will be removed in 2024.
015 *             Users should instead use classes from the phoenix6 package.
016 */
017@Deprecated(forRemoval = true)
018public enum BridgeOuputValue
019{
020    BridgeReq_Coast(0),
021    BridgeReq_Brake(1),
022    BridgeReq_Trapez(6),
023    BridgeReq_FOCTorque(7),
024    BridgeReq_MusicTone(8),
025    BridgeReq_FOCEasy(9),
026    BridgeReq_FaultBrake(12),
027    BridgeReq_FaultCoast(13),;
028
029    public final int value;
030
031    BridgeOuputValue(int initValue)
032    {
033        this.value = initValue;
034    }
035
036    private static HashMap<Integer, BridgeOuputValue> _map = null;
037    static
038    {
039        _map = new HashMap<Integer, BridgeOuputValue>();
040        for (BridgeOuputValue type : BridgeOuputValue.values())
041        {
042            _map.put(type.value, type);
043        }
044    }
045
046    /**
047     * Gets BridgeOuputValue from specified value
048     * @param value Value of BridgeOuputValue
049     * @return BridgeOuputValue of specified value
050     */
051    public static BridgeOuputValue valueOf(int value)
052    {
053        BridgeOuputValue retval = _map.get(value);
054        if(retval != null) return retval;
055        return BridgeOuputValue.values()[0];
056    }
057}