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