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.phoenixpro.sim; 008 009import java.util.HashMap; 010 011/** 012 * Enumeration of all supported device types. 013 * 014 * @deprecated Classes in the phoenixpro package will be removed in 2024. 015 * Users should instead use classes from the phoenix6 package. 016 */ 017@Deprecated(forRemoval = true) 018public enum DeviceType 019{ 020 TalonSRXType(0), 021 VictorSPXType(1), 022 PigeonIMUType(2), 023 RibbonPigeonIMUType(3), 024 TalonFXType(4), 025 CANCoderType(5), 026 PRO_TalonFXType(6), 027 PRO_CANcoderType(7), 028 PRO_Pigeon2Type(8),; 029 030 public final int value; 031 032 DeviceType(int initValue) 033 { 034 this.value = initValue; 035 } 036 037 private static HashMap<Integer, DeviceType> _map = null; 038 static 039 { 040 _map = new HashMap<Integer, DeviceType>(); 041 for (DeviceType type : DeviceType.values()) 042 { 043 _map.put(type.value, type); 044 } 045 } 046 047 /** 048 * Gets DeviceType from specified value 049 * @param value Value of DeviceType 050 * @return DeviceType of specified value 051 */ 052 public static DeviceType valueOf(int value) 053 { 054 DeviceType retval = _map.get(value); 055 if(retval != null) return retval; 056 return DeviceType.values()[0]; 057 } 058}