예제 #1
0
        /// <summary>
        /// Refresh Integration time
        /// </summary>
        private void RefreshAiSetting()
        {
            if (m_adamCtl.Configuration().GetModuleConfig(m_idxID, out m_aConf))
            {
                int  idx;
                uint uiFcnParam;

                //Check if support SampleRate
                if (this.m_aConf.byFunType_0 == (byte)_FunctionType.Filter)
                {
                    uiFcnParam = m_aConf.dwFunParam_0;
                }
                else if (this.m_aConf.byFunType_1 == (byte)_FunctionType.Filter)
                {
                    uiFcnParam = m_aConf.dwFunParam_1;
                }
                else if (this.m_aConf.byFunType_2 == (byte)_FunctionType.Filter)
                {
                    uiFcnParam = m_aConf.dwFunParam_2;
                }
                else if (this.m_aConf.byFunType_3 == (byte)_FunctionType.Filter)
                {
                    uiFcnParam = m_aConf.dwFunParam_3;
                }
                else if (this.m_aConf.byFunType_4 == (byte)_FunctionType.Filter)
                {
                    uiFcnParam = m_aConf.dwFunParam_4;
                }
                else
                {
                    return;
                }
                idx = AnalogInput.GetIntegrationIndex(AdamType.Apax5000, (byte)uiFcnParam);
                if (idx > cbxIntegration.Items.Count - 1)
                {
                    cbxIntegration.SelectedIndex = -1;
                }
                else
                {
                    cbxIntegration.SelectedIndex = idx;
                }
            }
            else
            {
                StatusBar_IO.Text += "GetModuleConfig(Error:" + m_adamCtl.Configuration().ApiLastError.ToString() + ") Failed! ";
            }
        }