예제 #1
0
        public override int HalConnect()
        {
            this.id = this.GetDevConnStr(DevConnStr_Id);

            var scanner = this.HalContext.ResourceGetOrDefault <MvamronSentechCameraScanner>(this.resourceKey);

            if (scanner == null)
            {
                scanner = new MvamronSentechCameraScanner();
                scanner.Connect();
                scanner.ScanAlldevice();
                this.HalContext.ResourceRegister(this.resourceKey, scanner);
            }
            foreach (var camera in scanner.cameras)
            {
                if (camera.Key == id)
                {
                    ldd = camera.Value;
                    ldd.Connect();
                    break;
                }
            }

            if (this.ldd == null)
            {
                if (scanner.cameras.ContainsKey(this.id))
                {
                    this.ldd = scanner.cameras[this.id];
                    ldd.Connect();
                }
                //this.HalContext.ResourceRegister(this.resourceKey, this.ldd);
            }
            return(0);
        }
예제 #2
0
        public void TestSentech()
        {
            try
            {
                using (var scanner = new MvamronSentechCameraScanner())
                {
                    scanner.Connect();
                    scanner.ScanAlldevice();
                    var camera = scanner.cameras[""];
                    //camera.CaptureSaveSyn("D:/","jpg");


                    scanner.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }