001/* Copyright (C) Cross The Road Electronics 2024 */
002package com.ctre.phoenix.motion;
003
004/**
005 * Choose what value to set to the motion profile
006 */
007public enum SetValueMotionProfile {
008        /**
009         * Invalid setting
010         */
011        Invalid(-1), 
012        /**
013         * Disable motion profile
014         */
015        Disable(0), 
016        /**
017         * Enable motion profile
018         */
019        Enable(1), 
020        /**
021         * Hold motion profile
022         * This will keep motor controllers enabled and attempt
023         * to servo to the current position
024         */
025        Hold(2);
026
027        /**
028         * Value of SetValueMotionProfile
029         */
030        public final int value;
031
032        /**
033         * Create SetValueMotionProfile of initValue
034         * @param initValue Value to create SetValueMotionProfile
035         */
036        SetValueMotionProfile(int initValue) {
037                this.value = initValue;
038        }
039        
040        /**
041         * Get SetValueMotionProfile from specified value
042         * @param value value to get SetValueMotionProfile
043         * @return SetValueMotionProfile of specified value
044         */
045        public static SetValueMotionProfile valueOf(int value) {
046                for (SetValueMotionProfile e : SetValueMotionProfile.values()) {
047                        if (e.value == value) {
048                                return e;
049                        }
050                }
051                return Invalid;
052        }
053}