Esempio n. 1
0
 public FrmBarcodeScannerTest()
 {
     InitializeComponent();
     _barcodeScanner = new SckBarcodeScanner("", "192.168.1.123", 2112, this, LoggerFactory.GetSerilogFileLogger());
     _barcodeScanner.BarcodeScanned         += _barcodeScanner_BarcodeScanned;
     _barcodeScanner.BarcodeCouldNotScanned += _barcodeScanner_BarcodeCouldNotScanned;
     _barcodeScanner.Connect();
 }
        public ProductPricePresenter(IPriceDisplay priceDisplay, IBarcodeScanner scanner, IPriceLookup priceLookup)
        {
            m_PriceDisplay = priceDisplay;
            m_PriceLookup = priceLookup;
            m_Scanner = scanner;

            m_Scanner.BarcodeScanned += Scanner_BarcodeScanned;
        }
Esempio n. 3
0
 /// <summary>
 /// Disposes the <see cref="BarcodeReader"/>
 /// </summary>
 public void Dispose()
 {
     if (Scanner == null)
     {
         return;
     }
     Scanner.Dispose();
     Scanner = null;
 }
            public QRCodeAnalyser(Action <IList <Barcode>, int, int> listener)
            {
                var options = new BarcodeScannerOptions.Builder()
                              .SetBarcodeFormats(Barcode.FormatQrCode)
                              .Build();

                detector      = BarcodeScanning.GetClient(options);
                this.listener = listener;
            }
Esempio n. 5
0
        public HomeScreenViewModel(IdleTimeoutTimer timer, Settings Settings) : base(timer, Settings)
        {
            this.Scanner = DependencyService.Get <IBarcodeScanner>();

            // TODO add option to press trigger to proceed
            this.NavigateToScanRequestedScreenCommand = new Command(p => this.AssessConnection());
            this.BypassCommand = new Command(p => this.CompletePage());

            // HACK not sure how to get this to fire otherwise
            this.Initialize();
        }
Esempio n. 6
0
        private void LoadType(Type type)
        {
            var typeLoadEx = new TypeLoadException(
                string.Format("Unable to GetType() for {0}. Check if the Type name is correct", type));

            var typeInitEx = new TypeInitializationException(
                string.Format("Unable to load {0}. Check if the Type name is correct", type),
                typeLoadEx);

            if (type == null)
            {
                throw typeLoadEx;
            }

            Scanner = (IBarcodeScanner)Activator.CreateInstance(type);
            if (Scanner == null)
            {
                throw typeInitEx;
            }
        }
        // Use this for initialization of camera takes a raw image as inputwhich needs to be set in Unity Editor
        void StartScannerCamera()
        {
            //Initizalize webcam and BarcodeScanner

            BarcodeScanner = new InitiateBarcodeScanner();

            BarcodeScanner.Camera.Play();

            // Display the camera texture through a RawImage
            BarcodeScanner.OnReady += (sender, arg) =>
            {
                //Set Orientation & Texture
                Image.transform.localEulerAngles = BarcodeScanner.Camera.GetEulerAngles();
                Image.transform.localScale       = BarcodeScanner.Camera.GetScale();
                Image.texture = BarcodeScanner.Camera.Texture;

                // Keep Image Aspect Ratio
                var rect      = Image.GetComponent <RectTransform>();
                var newHeight = rect.sizeDelta.x * BarcodeScanner.Camera.Height / BarcodeScanner.Camera.Width;
                rect.sizeDelta = new Vector2(rect.sizeDelta.x, newHeight);

                RestartTime = Time.realtimeSinceStartup;
            };
        }
 public ScanBarcodeCommand(PosProductListViewModel viewModel, IBarcodeScanner barcodeScanner)
 {
     this.viewModel      = viewModel;
     this.barcodeScanner = barcodeScanner;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MyViewModel"/> class.
 /// </summary>
 /// <param name="scanner">The scanner, dependency-injected</param>
 public MyViewModel(IBarcodeScanner scanner)
 {
     // all business logic for scanners, just like DB, should be in "service"
     // and not in the VM
     _scanner = scanner;
 }