Пример #1
0
        public MainViewModel()
        {
            LoadConfig();

            var listName = new List <string>();

            foreach (var it in CamConfigMgr.Cameras)
            {
                listName.Add(it.CamName);
            }

            CamInfoDataList  = Vision.FindCamera(EnumCamType.GigEVision, listName, out List <string> ErrorList);
            CameraCollection = new ObservableCollection <string>();
            foreach (var data in CamInfoDataList)
            {
                if (Vision.OpenCam(data.CamID, EnumColorSpace.Rgb))
                {
                    CameraCollection.Add(data.NameForVision);
                }
            }

            //初始化样式
            GridDataModelCollect = new ObservableCollection <CameraGridDataModel>();
            SetGridData(CameraCollection.Count);
            WindowsList = new List <HWindow>()
            {
                new HWindow(), new HWindow(), new HWindow(), new HWindow()
            };
        }
Пример #2
0
        public MainViewModel()
        {
            var Cam = Vision.FindCamera(VisionDefinitions.EnumCamType.GigEVision, new List <string>()
            {
                "CamTop"
            }, out List <string> ErrorList);

            Cam0 = Cam[0];
        }
Пример #3
0
        public void FindCameraTest()
        {
            var Res = Vision.FindCamera(VisionDefinitions.EnumCamType.GigEVision, new List <string>()
            {
                "Cam_Up"
            }, out List <string> ErrorList);
            var Cam = Res[0];

            Vision.OpenCam(Cam.CamID);
            Vision.GrabImage(Cam.CamID);

            Vision.SaveImage(Cam.CamID, VisionDefinitions.EnumImageType.Image, "C:\\公司文件资料", "2225678.jpg", 0);
            Vision.CloseCam(Cam.CamID);
        }