Beispiel #1
0
        private void FormCard_Load(object sender, EventArgs e)
        {
            short err;
            int   i;

            // scan the active USB DASK module
            err = USBDASK.UD_Device_Scan(out wModuleNum, AvailModules);
            if (err != USBDASK.NoError)
            {
                MessageBox.Show("UD_Device_Scan() Failed !!, Error Code:" + err.ToString());
                return;
            }

            for (i = 0; i < wModuleNum; i++)
            {
                switch (AvailModules[i].wModuleType)
                {
                case USBDASK.USB_1902:
                    if (AvialableCardType[USBDASK.USB_1902] == 0x00)
                    {
                        AvialableCardType[USBDASK.USB_1902] = 0x01;
                        radioButton_1902.Enabled            = true;
                    }
                    break;

                case USBDASK.USB_1903:
                    if (AvialableCardType[USBDASK.USB_1903] == 0x00)
                    {
                        AvialableCardType[USBDASK.USB_1903] = 0x01;
                        radioButton_1903.Enabled            = true;
                    }
                    break;

                case USBDASK.USB_1901:
                    if (AvialableCardType[USBDASK.USB_1901] == 0x00)
                    {
                        AvialableCardType[USBDASK.USB_1901] = 0x01;
                        radioButton_1901.Enabled            = true;
                    }
                    break;
                }
            }

            // re-assign the wSelCardType
            if (AvialableCardType[USBDASK.USB_1902] == 0x01)
            {
                wSelCardType             = USBDASK.USB_1902;
                radioButton_1902.Checked = true;

                button_OK.Enabled = true;
                // UpdateComboBox();
            }
            else if (AvialableCardType[USBDASK.USB_1903] == 0x01)
            {
                wSelCardType             = USBDASK.USB_1903;
                radioButton_1903.Checked = true;

                button_OK.Enabled = true;
                // UpdateComboBox();
            }
            else if (AvialableCardType[USBDASK.USB_1901] == 0x01)
            {
                wSelCardType             = USBDASK.USB_1901;
                radioButton_1901.Checked = true;

                button_OK.Enabled = true;
                //UpdateComboBox();
            }
        }