/// <summary> /// Initializes the can talon. /// </summary> /// <param name="id">The identifier.</param> /// <returns></returns> public static bool InitializeCanTalon(int id) { CanTalonData data; bool retVal = s_canTalon.TryGetValue(id, out data); if (retVal) { //Contains key. return false saying we did not initialize a new one. return false; } else { //Create a new Can Talon data and return true. data = new CanTalonData(); s_canTalon.Add(id, data); OnTalonSRXAddedOrRemoved?.Invoke(id, new TalonSRXEventArgs(true)); return true; } }
/// <summary> /// Creates a new CAN Talon in the simulator. /// </summary> /// <param name="id">The ID of the talon to read.</param> public SimCANTalon(int id) { Data = SimData.GetCanTalon(id); }