001package com.ctre.phoenix.sensors; 002 003public enum SensorTimeBase{ 004 /** 005 * Legacy Mode 006 */ 007 Per100Ms_Legacy (0), 008 /** 009 * Per-Second Velocities 010 */ 011 PerSecond (1), 012 /** 013 * Per-Minute Velocities 014 */ 015 PerMinute (2); 016 017 public final int value; 018 019 /** 020 * Create SensorTimeBase of initValue 021 * @param initValue Value of SensorTimeBase 022 */ 023 SensorTimeBase(int initValue) 024 { 025 this.value = initValue; 026 } 027 028 /** 029 * String representation of specified SensorTimeBase 030 * @return string representation of SensorTimeBase 031 */ 032 public String toString() { 033 switch (value) { 034 case 0: return "Per 100Ms (legacy)"; 035 case 1: return "Per Second"; 036 case 2: return "Per Minute"; 037 default: return "InvalidValue"; 038 } 039 } 040 /** public lookup to convert int to enum */ 041 public static SensorTimeBase valueOf(int value) { 042 switch (value) { 043 default: // no break 044 case 0: return SensorTimeBase.Per100Ms_Legacy; 045 case 1: return SensorTimeBase.PerSecond; 046 case 2: return SensorTimeBase.PerMinute; 047 } 048 } 049}