public void UpdateDeviceList() { KSJApiBase.KSJ_UnInit(); KSJApiBase.KSJ_Init(); ComboBox_DEVICE_LIST.Items.Clear(); m_nDeviceNum = KSJApiBase.KSJ_DeviceGetCount(); Label__DEVICENUM.Text = String.Format("{0} Device Found:", m_nDeviceNum); if (m_nDeviceNum == 0) { m_nDeviceCurSel = -1; return; } if (m_nDeviceCurSel >= m_nDeviceNum) { m_nDeviceCurSel = 0; } for (int i = 0; i < m_nDeviceNum; i++) { m_DeviceInfo[i].nIndex = i; KSJApiBase.KSJ_DeviceGetInformationEx(i, ref m_DeviceInfo[i].DeviceType, ref m_DeviceInfo[i].nSerials, ref m_DeviceInfo[i].wFirmwareVersion, ref m_DeviceInfo[i].wFpgaVersion); byte btMajVersion = (byte)((m_DeviceInfo[i].wFirmwareVersion & 0xFF00) >> 8); // 得到主版本号 byte btMinVersion = (byte)(m_DeviceInfo[i].wFirmwareVersion & 0x00FF); // 得到副版本号 byte btFpgaMajVersion = (byte)((m_DeviceInfo[i].wFpgaVersion & 0xFF00) >> 8); // 得到主版本号 byte btFpgaMinVersion = (byte)(m_DeviceInfo[i].wFpgaVersion & 0x00FF); // 得到副版本号 string szText = String.Format("Index({0})-Type({1})-Serials({2})-FwVer({3}.{4})-FpgaVer({5}.{6})", i, KSJGS.g_szDeviceType[(int)(m_DeviceInfo[i].DeviceType)], m_DeviceInfo[i].nSerials, btMajVersion, btMinVersion, btFpgaMajVersion, btFpgaMinVersion); ComboBox_DEVICE_LIST.Items.Insert(i, szText); } }
public Form1() { InitializeComponent(); m_nDeviceNum = 0; m_nDeviceCurSel = -1; // 初始化动态库 KSJApiBase.KSJ_Init(); }
public Form1() { InitializeComponent(); m_nDeviceNum = 0; m_nDeviceCurSel = -1; // 初始化动态库 KSJApiBase.KSJ_Init(); previewCallBack = new KSJApiCallback.KSJ_PREVIEWCALLBACK(PreviewCallback); previewCallBackEx = new KSJApiCallback.KSJ_PREVIEWCALLBACKEX(PreviewCallbackEx); }