Exemplo n.º 1
0
        public static bool Init()
        {
            if (_Webcam != null)
            {
                return(false);
            }
            switch (CConfig.Config.Video.WebcamLib)
            {
            case EWebcamLib.AForgeNet:
                _Webcam = new CAForgeNet();
                break;

            default:
                _Webcam = new CAForgeNet();
                break;
            }
            if (!_Webcam.Init())
            {
                return(false);
            }
            _Webcam.Select(CConfig.Config.Video.WebcamConfig.HasValue ? CConfig.Config.Video.WebcamConfig.Value : new SWebcamConfig());

            CConfig.Config.Video.WebcamConfig = _Webcam.GetConfig();
            CConfig.SaveConfig();
            return(true);
        }
Exemplo n.º 2
0
 public static void Close()
 {
     if (_Webcam == null)
     {
         return;
     }
     _Webcam.Close();
     _Webcam = null;
 }
Exemplo n.º 3
0
        public Scanner(ScannerSettings settings, IParser parser, IWebcam webcam)
        {
            Status = ScannerStatus.Initialize;

            // Default Properties
            Settings = (settings == null) ? new ScannerSettings() : settings;
            Parser   = (parser == null) ? new ZXingParser(Settings) : parser;
            Camera   = (webcam == null) ? new UnityWebcam(Settings) : webcam;
            // Check Device Authorization
            if (!Application.HasUserAuthorization(UserAuthorization.WebCam))
            {
                throw new Exception("This Webcam Library can't work without the webcam authorization");
            }
        }
Exemplo n.º 4
0
        public Scanner(IParser parser = null, IWebcam webcam = null)
        {
            // Check Device Authorization
            if (!Application.HasUserAuthorization(UserAuthorization.WebCam))
            {
                throw new Exception("This Webcam Library can't work without the webcam authorization");
            }

            Status = ScannerStatus.Initialize;
            Parser = (parser == null) ? new ZXingParser() : parser;
            Camera = (webcam == null) ? new UnityWebcam() : webcam;

                        #if UNITY_WEBGL
            useBackgroundThread = false;
                        #endif
        }
Exemplo n.º 5
0
        public WebCamActor(ActorElement ae)
        {
            IPAddress ip = IPAddress.Parse(ae.Ip);

            var type = Type.GetType(ae.WebCamModel);

            if (type == null)
            {
                throw new ApplicationException("The webcam model " + ae.WebCamModel + " cannot be found in the list of available supported web cams. Please review the config file.");
            }
            _physicalWebcam = (IWebcam)Activator.CreateInstance(type, ae.WebCamUsername, ae.WebCamPassword, ip, Int32.Parse(ae.WebCamPort));

            _pushBullet = new Pushbullet(ae.PushbulletKey, ae.PushbulletDeviceToSendMessagesTo);

            Become(Disalarmed);
        }
Exemplo n.º 6
0
        public static void Init()
        {
            switch (CConfig.WebcamLib)
            {
                case EWebcamLib.AForgeNet:
                    _Webcam = new CAForgeNet();
                    break;

                default:
                    _Webcam = new CAForgeNet();
                    break;
            }
            _Webcam.Init();
            _Webcam.Select(CConfig.WebcamConfig);

            CConfig.WebcamConfig = _Webcam.GetConfig();
            CConfig.SaveConfig();
        }
Exemplo n.º 7
0
        public static void Init()
        {
            switch (CConfig.WebcamLib)
            {
            case EWebcamLib.AForgeNet:
                _Webcam = new CAForgeNet();
                break;

            default:
                _Webcam = new CAForgeNet();
                break;
            }
            _Webcam.Init();
            _Webcam.Select(CConfig.WebcamConfig);

            CConfig.WebcamConfig = _Webcam.GetConfig();
            CConfig.SaveConfig();
        }
Exemplo n.º 8
0
 public Scanner(IParser parser, IWebcam webcam) : this(null, parser, webcam)
 {
 }
 public InitiateBarcodeScanner(IBarcodeParser parser, IWebcam webcam) : this(null, parser, webcam)
 {
 }