public void Dispose() { SendableRegistry.Instance.Remove(this); if (m_allocatedChannel) { m_analogInput.Dispose(); } }
/// <summary> /// Delete the analog components used for the accelerometer. /// </summary> public override void Dispose() { if (m_analogChannel != null && m_allocatedChannel) { m_analogChannel.Dispose(); } m_analogChannel = null; }
/// <summary> /// Frees the potentiometer. /// </summary> public void Dispose() { if (m_initAnalogInput) { m_analogInput.Dispose(); m_analogInput = null; m_initAnalogInput = false; } }
public override void Dispose() { SendableRegistry.Instance.Remove(this); if (m_channelAllocated) { m_analogInput.Dispose(); } Hal.AnalogGyroLowLevel.Free(m_gyroHandle); }
///<inheritdoc/> public override void Dispose() { if (AnalogInput != null && m_channelAllocated) { AnalogInput.Dispose(); } HAL_FreeAnalogGyro(m_gyroHandle); m_gyroHandle = HALInvalidHandle; AnalogInput = null; base.Dispose(); }
/// <summary> /// Release the resources used by this object. /// </summary> public void Dispose() { int status = 0; HAL_CleanAnalogTrigger(HALHandle, ref status); HALHandle = 0; if (m_ownsAnalog) { m_analogInput?.Dispose(); } CheckStatus(status); }
/// <summary> /// Creates a new Analog Gyro on the specified channel. /// </summary> /// <param name="channel">The channel the gyro is on (Must be an accumulator channel). [0..1] on RIO.</param> public AnalogGyro(int channel) { AnalogInput aIn = new AnalogInput(channel); try { CreateGyro(aIn); } catch { aIn.Dispose(); throw; } m_channelAllocated = true; }
/// <summary> /// Creates a new Analog Gyro on the specified channel. /// </summary> /// <param name="channel">The channel the gyro is on (Must be an accumulator channel). [0..1] on RIO.</param> public AnalogGyro(int channel) { AnalogInput = new AnalogInput(channel); try { InitGyro(); } catch { AnalogInput.Dispose(); throw; } Calibrate(); m_channelAllocated = true; }