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 * Whether the closed-loop is running on position or velocity.
013 */
014public enum DiffPIDRefPIDErr_ClosedLoopModeValue
015{
016    Position(0),
017    Velocity(1),;
018
019    public final int value;
020
021    DiffPIDRefPIDErr_ClosedLoopModeValue(int initValue)
022    {
023        this.value = initValue;
024    }
025
026    private static HashMap<Integer, DiffPIDRefPIDErr_ClosedLoopModeValue> _map = null;
027    static
028    {
029        _map = new HashMap<Integer, DiffPIDRefPIDErr_ClosedLoopModeValue>();
030        for (DiffPIDRefPIDErr_ClosedLoopModeValue type : DiffPIDRefPIDErr_ClosedLoopModeValue.values())
031        {
032            _map.put(type.value, type);
033        }
034    }
035
036    /**
037     * Gets DiffPIDRefPIDErr_ClosedLoopModeValue from specified value
038     * @param value Value of DiffPIDRefPIDErr_ClosedLoopModeValue
039     * @return DiffPIDRefPIDErr_ClosedLoopModeValue of specified value
040     */
041    public static DiffPIDRefPIDErr_ClosedLoopModeValue valueOf(int value)
042    {
043        DiffPIDRefPIDErr_ClosedLoopModeValue retval = _map.get(value);
044        if (retval != null) return retval;
045        return DiffPIDRefPIDErr_ClosedLoopModeValue.values()[0];
046    }
047}