public void PubChamInfo(CTMA500 tma) { Messages.cham_msgs.ChamInfo msg = new Messages.cham_msgs.ChamInfo(); tma.__update(); msg.xl = tma.PD[1]; msg.xr = tma.PD[0]; msg.yl = tma.PD[3]; msg.yr = tma.PD[2]; chaminfo.publish(msg); }
/// <summary> /// 加载窗体执行初始化UI和库 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void GxSingleCam_Load(object sender, EventArgs e) { Control.CheckForIllegalCrossThreadCalls = false; if (withTma) { tma = new CTMA500(); } try { IGXFactory.GetInstance().Init(); List <IGXDeviceInfo> listGXDeviceInfo = new List <IGXDeviceInfo>(); IGXFactory.GetInstance().UpdateAllDeviceList(200, listGXDeviceInfo); foreach (IGXDeviceInfo objDeviceInfo in listGXDeviceInfo) { Console.WriteLine("#######################"); Console.WriteLine(objDeviceInfo.GetModelName()); Console.WriteLine(objDeviceInfo.GetVendorName()); Console.WriteLine(objDeviceInfo.GetUserID()); Console.WriteLine(objDeviceInfo.GetIP()); Console.WriteLine(objDeviceInfo.GetSN()); //更多的设备信息详见IGXDeviceInfo接口 } if (listGXDeviceInfo.Count > 1) { caml = new CDHCam(0, m_pic_ShowImage); camr = new CDHCam(1, m_pic2_ShowImage); } else { MessageBox.Show("摄像头数量不足~"); } } catch (CGalaxyException ex) { string strErrorInfo = "错误码为:" + ex.GetErrorCode().ToString() + "错误描述信息为:" + ex.Message; Console.WriteLine(strErrorInfo); } if (withros) { try { ros = new CROS("msi-PC", "http://192.168.1.2:11311"); System.Threading.Thread initthread = new Thread(new ParameterizedThreadStart(Init)); initthread.Start(); } catch (Exception ex) { string strErrorInfo = "错误码为:" + ex.ToString() + "错误描述信息为:" + ex.Message; Console.WriteLine(strErrorInfo); } } }