public void Dispose()
 {
     SendableRegistry.Instance.Remove(this);
     if (m_allocatedChannel)
     {
         m_analogInput.Dispose();
     }
 }
Beispiel #2
0
 /// <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;
 }
Beispiel #3
0
 /// <summary>
 /// Frees the potentiometer.
 /// </summary>
 public void Dispose()
 {
     if (m_initAnalogInput)
     {
         m_analogInput.Dispose();
         m_analogInput     = null;
         m_initAnalogInput = false;
     }
 }
Beispiel #4
0
        public override void Dispose()
        {
            SendableRegistry.Instance.Remove(this);
            if (m_channelAllocated)
            {
                m_analogInput.Dispose();
            }

            Hal.AnalogGyroLowLevel.Free(m_gyroHandle);
        }
Beispiel #5
0
 ///<inheritdoc/>
 public override void Dispose()
 {
     if (AnalogInput != null && m_channelAllocated)
     {
         AnalogInput.Dispose();
     }
     HAL_FreeAnalogGyro(m_gyroHandle);
     m_gyroHandle = HALInvalidHandle;
     AnalogInput  = null;
     base.Dispose();
 }
Beispiel #6
0
        /// <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);
        }
Beispiel #7
0
 /// <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;
 }
Beispiel #8
0
 /// <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;
 }