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.phoenix6.signals; 008 009import java.util.HashMap; 010 011/** 012 * System state of the device 013 */ 014public enum System_StateValue 015{ 016 Bootup_0(0), 017 Bootup_1(1), 018 Bootup_2(2), 019 Bootup_3(3), 020 Bootup_4(4), 021 Bootup_5(5), 022 Bootup_6(6), 023 Bootup_7(7), 024 BootBeep(8), 025 ControlDisabled(9), 026 ControlEnabled(10), 027 ControlEnabled_11(11), 028 Fault(12), 029 Recover(13), 030 NotLicensed(14), 031 Production(15),; 032 033 public final int value; 034 035 System_StateValue(int initValue) 036 { 037 this.value = initValue; 038 } 039 040 private static HashMap<Integer, System_StateValue> _map = null; 041 static 042 { 043 _map = new HashMap<Integer, System_StateValue>(); 044 for (System_StateValue type : System_StateValue.values()) 045 { 046 _map.put(type.value, type); 047 } 048 } 049 050 /** 051 * Gets System_StateValue from specified value 052 * @param value Value of System_StateValue 053 * @return System_StateValue of specified value 054 */ 055 public static System_StateValue valueOf(int value) 056 { 057 System_StateValue retval = _map.get(value); 058 if (retval != null) return retval; 059 return System_StateValue.values()[0]; 060 } 061}