// ----------------- UpdateInfos ------------------------- // private void UpdateInfos() { listBoxInfo.Items.Clear(); int ver = Uc480.GetDLLVersion(); string strText; strText = String.Format("uc480 SDK Version: {0}.{1}.{2}", (ver >> 24), (ver >> 16 & 0xff), (ver & 0xffff)); listBoxInfo.Items.Add(strText); int nrOfCameras = 0; Uc480.GetNumberOfCameras(ref nrOfCameras); strText = String.Format("Connected cameras: {0}", nrOfCameras); listBoxInfo.Items.Add(strText); // camera infos if (m_uc480.IsOpen()) { listBoxInfo.Items.Add(""); // Sensorinfo Uc480.SENSORINFO sensorInfo = new Uc480.SENSORINFO(); m_uc480.GetSensorInfo(ref sensorInfo); listBoxInfo.Items.Add("Sensor: " + sensorInfo.strSensorName); // Camerainfo Uc480.CAMINFO cameraInfo = new Uc480.CAMINFO(); m_uc480.GetCameraInfo(ref cameraInfo); listBoxInfo.Items.Add("CameraInfo:"); listBoxInfo.Items.Add(" SerNo: " + cameraInfo.SerNo); listBoxInfo.Items.Add(" Date: " + cameraInfo.Date); listBoxInfo.Items.Add(" Version: " + cameraInfo.Version); strText = String.Format(" Camera ID: {0}", cameraInfo.id); listBoxInfo.Items.Add(strText); // Memory board query listBoxInfo.Items.Add(""); strText = m_uc480.IsMemoryBoardConnected() ? "Memoryboard connected" : "No Memoryboard connected"; listBoxInfo.Items.Add(strText); } }
public MainForm() { // dialog controls InitializeComponent(); // init variables m_bLive = false; m_bDrawing = false; m_RenderMode = Uc480.IS_RENDER_NORMAL; m_DmdWidth = m_DmdHeight = 1000; m_DevId = UInt32.MaxValue; // init our uc480 object m_uc480 = new Uc480(); // enable static messages ( no open camera is needed ) m_uc480.EnableMessage(Uc480.IS_NEW_DEVICE, this.Handle.ToInt32()); m_uc480.EnableMessage(Uc480.IS_DEVICE_REMOVAL, this.Handle.ToInt32()); // Set up the delays for the ToolTip. toolTipColor.AutoPopDelay = 5000; toolTipColor.InitialDelay = 1000; toolTipColor.ReshowDelay = 500; toolTipColor.ShowAlways = true; toolTipColor.SetToolTip(this.DisplayWindow, ""); // update listbox info UpdateInfos(); // init our image struct and alloc marshall pointers for the uc480 memory m_Uc480Images = new UC480IMAGE[IMAGE_COUNT]; int nLoop = 0; for (nLoop = 0; nLoop < IMAGE_COUNT; nLoop++) { m_Uc480Images[nLoop].pMemory = Marshal.AllocCoTaskMem(4); // create marshal object pointers m_Uc480Images[nLoop].MemID = 0; m_Uc480Images[nLoop].nSeqNum = 0; } }