Exemple #1
0
        /// <summary>
        /// Init Channel Information
        /// </summary>
        /// <param name="m_aConf">apax 5000 device object</param>
        private void InitialDataTabPages()
        {
            int          i = 0, idx = 0;
            byte         type = (byte)_HardwareIOType.AI; //APAX-5017 is AI module
            ListViewItem lvItem;

            string[] strRanges;
            ushort[] m_usRanges_supAI;

            for (i = 0; i < m_aConf.HwIoType.Length; i++)
            {
                if (m_aConf.HwIoType[i] == type)
                {
                    idx = i;
                }
            }
            m_tmpidx = idx;

            //init range combobox
            if (m_tmpidx == 0)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_0_Range;
            }
            else if (m_tmpidx == 1)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_1_Range;
            }
            else if (m_tmpidx == 2)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_2_Range;
            }
            else if (m_tmpidx == 3)
            {
                m_usRanges_supAI = m_aConf.wHwIoType_3_Range;
            }
            else
            {
                m_usRanges_supAI = m_aConf.wHwIoType_4_Range;
            }
            //Get combobox items of Range
            strRanges = new string[m_aConf.HwIoType_TotalRange[m_tmpidx]];
            for (i = 0; i < strRanges.Length; i++)
            {
                strRanges[i] = AnalogInput.GetRangeName(m_usRanges_supAI[i]);
            }
            SetRangeComboBox(strRanges);
            //Get combobox items of Integration Time
            SetIntegrationComboBox(new string[] { AnalogInput.GetIntegrationName(AdamType.Apax5000, (byte)Apax_Integration.Auto) });
            //Get combobox items of Burnout Detect Mode
            SetBurnoutFcnValueComboBox(new string[] { "Down Scale", "Up Scale" });
            //Get combobox items of Sampling rate (Hz/Ch)
            SetSampleRateComboBox(new string[] { "1", "10" });
            //init channel information
            listViewChInfo.BeginUpdate();
            listViewChInfo.Items.Clear();
            for (i = 0; i < m_aConf.HwIoTotal[m_tmpidx]; i++)
            {
                lvItem = new ListViewItem(_HardwareIOType.AI.ToString()); //type
                lvItem.SubItems.Add(i.ToString());                        //Ch
                lvItem.SubItems.Add("*****");                             //Value
                lvItem.SubItems.Add("*****");                             //Ch Status
                lvItem.SubItems.Add("*****");                             //Range
                listViewChInfo.Items.Add(lvItem);
            }
            listViewChInfo.EndUpdate();
        }
Exemple #2
0
        /// <summary>
        /// Init Channel Information
        /// </summary>
        /// <param name="aConf">apax 5000 device object</param>
        private void InitialDataTabPages()
        {
            int          i = 0, idx = 0;
            byte         type = (byte)_HardwareIOType.AI; //APAX-5018 is AI module
            ListViewItem lvItem;

            string[] strRanges;
            ushort[] m_usRanges_supAI;

            for (i = 0; i < m_aConf.HwIoType.Length; i++)
            {
                if (m_aConf.HwIoType[i] == type)
                {
                    idx = i;
                }
            }
            m_tmpidx = idx;

            //init range combobox
            if (m_tmpidx == 0)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 0);
                m_usRanges_supAI = m_aConf.wHwIoType_0_Range;
            }
            else if (m_tmpidx == 1)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 1);
                m_usRanges_supAI = m_aConf.wHwIoType_1_Range;
            }
            else if (m_tmpidx == 2)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 2);
                m_usRanges_supAI = m_aConf.wHwIoType_2_Range;
            }
            else if (m_tmpidx == 3)
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 3);
                m_usRanges_supAI = m_aConf.wHwIoType_3_Range;
            }
            else
            {
                m_adamSocket.Configuration().GetModuleTotalRange((int)m_idxID, m_aConf, 4);
                m_usRanges_supAI = m_aConf.wHwIoType_4_Range;
            }
            //Get combobox items of Range
            strRanges = new string[m_aConf.HwIoType_TotalRange[m_tmpidx]];
            for (i = 0; i < strRanges.Length; i++)
            {
                strRanges[i] = AnalogInput.GetRangeName(m_usRanges_supAI[i]);
            }
            SetRangeComboBox(strRanges);
            cbxRange.SelectedIndex = GetChannelRangeIdx(AnalogInput.GetRangeName(m_usRanges[0]));  //get the first channel range
            //Get combobox items of Integration Time
            SetIntegrationComboBox(new string[] { AnalogInput.GetIntegrationName(AdamType.Apax5000, (byte)Apax_Integration.Auto) });
            //Get combobox items of Burnout Detect Mode
            SetBurnoutFcnValueComboBox(new string[] { "Down Scale", "Up Scale" });
            //init channel information
            listViewChInfo.BeginUpdate();
            listViewChInfo.Items.Clear();
            for (i = 0; i < m_aConf.HwIoTotal[m_tmpidx]; i++)
            {
                lvItem = new ListViewItem(_HardwareIOType.AI.ToString()); //type
                lvItem.SubItems.Add(i.ToString());                        //Ch
                if (m_adamType == AdamType.Apax5070)
                {
                    lvItem.SubItems.Add(Convert.ToString(m_usStart + i));     //Modbus address
                }
                else
                {
                    lvItem.SubItems.Add("*****");
                }
                lvItem.SubItems.Add("*****");           //Value
                lvItem.SubItems.Add("*****");           //Ch Status
                lvItem.SubItems.Add("*****");           //Range
                listViewChInfo.Items.Add(lvItem);
            }
            listViewChInfo.EndUpdate();
        }