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.phoenix6.signals;
008
009import java.util.HashMap;
010
011/**
012 * The applied output of the bridge.
013 */
014public enum BridgeOutputValue
015{
016    BridgeReq_Coast(0),
017    BridgeReq_Brake(1),
018    BridgeReq_Trapez(6),
019    BridgeReq_FOCTorque(7),
020    BridgeReq_MusicTone(8),
021    BridgeReq_FOCEasy(9),
022    BridgeReq_FaultBrake(12),
023    BridgeReq_FaultCoast(13),
024    BridgeReq_ActiveBrake(14),
025    BridgeReq_VariableBrake(15),;
026
027    public final int value;
028
029    BridgeOutputValue(int initValue)
030    {
031        this.value = initValue;
032    }
033
034    private static HashMap<Integer, BridgeOutputValue> _map = null;
035    static
036    {
037        _map = new HashMap<Integer, BridgeOutputValue>();
038        for (BridgeOutputValue type : BridgeOutputValue.values())
039        {
040            _map.put(type.value, type);
041        }
042    }
043
044    /**
045     * Gets BridgeOutputValue from specified value
046     * @param value Value of BridgeOutputValue
047     * @return BridgeOutputValue of specified value
048     */
049    public static BridgeOutputValue valueOf(int value)
050    {
051        BridgeOutputValue retval = _map.get(value);
052        if (retval != null) return retval;
053        return BridgeOutputValue.values()[0];
054    }
055}