001package com.ctre.phoenix.motorcontrol; 002 003/** 004 * Choose the control mode for a VictorSPX. 005 */ 006public enum VictorSPXControlMode 007{ 008 /** 009 * Percent output [-1,1] 010 */ 011 PercentOutput(0), 012 /** 013 * Position closed loop 014 */ 015 Position(1), 016 /** 017 * Velocity closed loop 018 */ 019 Velocity(2), 020 /** 021 * Follow other motor controller 022 */ 023 Follower(5), 024 /** 025 * Motion Profile 026 */ 027 MotionProfile(6), 028 /** 029 * Motion Magic 030 */ 031 MotionMagic(7), 032 /** 033 * Motion Profile with auxiliary output 034 */ 035 MotionProfileArc(10), 036 037 /** 038 * Disable Motor Controller 039 */ 040 Disabled(15); 041 042 /** 043 * Value of control mode 044 */ 045 public final int value; 046 047 /** 048 * Create VictorSPXControlMode of initValue 049 * @param initValue Value of VictorSPXControlMode 050 */ 051 VictorSPXControlMode(int initValue) 052 { 053 this.value = initValue; 054 } 055 056 /** 057 * Helper method to convert to generic ControlMode enum. 058 * @return value cast as ControlMode 059 */ 060 public ControlMode toControlMode(){ 061 switch(value){ 062 case 0: return ControlMode.PercentOutput; 063 case 1: return ControlMode.Position; 064 case 2: return ControlMode.Velocity; 065 case 5: return ControlMode.Follower; 066 case 6: return ControlMode.MotionProfile; 067 case 7: return ControlMode.MotionMagic; 068 case 10: return ControlMode.MotionProfileArc; 069 case 15: return ControlMode.Disabled; 070 default: return ControlMode.PercentOutput; 071 } 072 } 073};