/// <summary> /// Sets the down source object for the counter. /// </summary> /// <param name="source">The DigitalSource to use for counting down.</param> public void SetDownSource(DigitalSource source) { if (m_downSource != null && m_allocatedDownSource) { m_downSource.Dispose(); m_allocatedDownSource = false; } m_downSource = source; int status = 0; HAL_SetCounterDownSource(m_counter, source.PortHandleForRouting, (HALAnalogTriggerType)source.AnalogTriggerTypeForRouting, ref status); CheckStatus(status); }
/// <inheritdoc/> public override void Dispose() { if (ASource != null && m_allocatedA) { ASource.Dispose(); m_allocatedA = false; } if (BSource != null && m_allocatedB) { BSource.Dispose(); m_allocatedB = false; } if (IndexSource != null && m_allocatedI) { IndexSource.Dispose(); m_allocatedI = false; } ASource = null; BSource = null; IndexSource = null; int status = 0; HAL_FreeEncoder(m_encoder, ref status); CheckStatus(status); }