Пример #1
0
 private void UserControl_Unloaded(object sender,RoutedEventArgs e)
 {
     if (currentDevice != null)
     {
         currentDevice.Dispatch(COMMAND.ENROLLMENT_STOP);
     }
     Ambassador.ClearCallback();
 }
Пример #2
0
        public void DeviceFailure(Object sender)
        {
            // only for our device
            foreach (var radioButton in TestDevicePanel.Children.OfType <RadioButton>().Where(rb => rb.Content == sender))
            {
                radioButton.Content = sender.ToString();

                Ambassador.ClearCallback();
                MessageSend(sender, "Connect device and press refresh");
                radioButton.IsEnabled = true;
            }
        }
Пример #3
0
 private void TestScannerDisable()
 {
     if (currentTestDevice != null)
     {
         if (currentTestDevice.Content is IFingerDevice)
         {
             (currentTestDevice.Content as IFingerDevice).Dispatch(COMMAND.LIVECAPTURE_STOP);
             Ambassador.ClearCallback();
             checkFinger.ClearImage();
         }
     }
     if (imageReseter != null)
     {
         imageReseter.Stop();
     }
 }
Пример #4
0
        /// <summary>
        /// Call this function to end / abort enrollment process
        /// </summary>
        public void endEnrollment()
        {
            EnrollmentProgress.Value = 0;

            currentDevice.Dispatch(COMMAND.ENROLLMENT_STOP);
            Ambassador.ClearCallback();

            //currentDevice.StopEnrollment();
            UpdateFingers();
            isBusy = false;
            if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE)
            {
                fingerDisplay.ClearImage();
                fingerChooser.DeSelectFinger(fingerNum);
            }
            else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE)
            {
                palmEnrollControl.SetOriginalColor();
            }
            Cancel.Visibility            = Visibility.Collapsed;
            UpdateBtn.Visibility         = Visibility.Visible;
            ProviderBox.IsEnabled        = true;
            EnrollmentProgress.IsEnabled = false;

            Ambassador.SetCallback(DispatchMessage);
            currentDevice.Dispatch(COMMAND.SINGLECAPTURE_START);
            //showMessageBase("Please, select finger to enroll or touch the scanner to verify it");
            switch (_controlType)
            {
            case ControlTypeEnum.FINGERPRINT_CONTROL_TYPE:
                forceShowMessageBase(baseHint);
                break;

            case ControlTypeEnum.PALM_CONTROL_TYPE:
                forceShowMessageBase(baseHint);
                break;

            default:
                break;
            }
        }
Пример #5
0
        private void DeviceDeselected(object sender, RoutedEventArgs e)
        {
            RadioButton radioButton = (sender as RadioButton);

            try
            {
                // If Provider has an active device
                if (radioButton.Content is IFingerDevice)
                {
                    IFingerDevice device = (sender as RadioButton).Content as IFingerDevice;
                    Ambassador.ClearCallback();

                    device.Dispatch(COMMAND.LIVECAPTURE_STOP);
                    (sender as RadioButton).IsEnabled = true;
                }
            }
            catch (Exception ex)
            {
                Auxiliary.Logger._log.Error(ex);
            }
        }
Пример #6
0
        void TestPageDeviceSelected(object sender, RoutedEventArgs e)
        {
            RadioButton radioButton = (sender as RadioButton);

            try
            {
                // If Provider has an active device
                if (radioButton.Content is IFingerDevice)
                {
                    currentTestDevice           = (sender as RadioButton);
                    currentTestDevice.IsEnabled = false;
                    IFingerDevice device = (sender as RadioButton).Content as IFingerDevice;

                    TestScannerPage.Children.Clear();
                    checkFinger = new FingerDisplay();
                    TestScannerPage.Children.Add(checkFinger);

                    //checkFinger.SetText("Please, touch the scanner");
                    Ambassador.SetCallback(DispatchMessage);
                    device.Dispatch(COMMAND.LIVECAPTURE_START);
                    imageReseter.Start();
                }
                else
                {
                    Ambassador.ClearCallback();
                    if (checkFinger != null)
                    {
                        TestScannerPage.Children.Clear();
                        checkFinger = null;
                    }
                    checkFinger = new FingerDisplay(Properties.Resources.no_device);
                    TestScannerPage.Children.Add(checkFinger);
                    checkFinger.SetText("Connect device and press refresh");
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
Пример #7
0
        public void DeviceFailure(Object sender)
        {
            // only for our device
            foreach (var radioButton in TestDevicePanel.Children.OfType <RadioButton>().Where(rb => rb.Content == sender))
            {
                radioButton.Content = sender.ToString();

                checkFinger.SetText("");
                textClearTimerStop();
                Ambassador.ClearCallback();
                if (checkFinger != null)
                {
                    TestScannerPage.Children.Clear();
                    checkFinger = null;
                }
                checkFinger = new FingerDisplay(Properties.Resources.no_device);
                TestScannerPage.Children.Add(checkFinger);
                MessageSend(sender, "Connect device and press refresh");

                radioButton.IsEnabled = true;
            }
        }
Пример #8
0
        private void ProviderBox_SelectionChanged(object sender,SelectionChangedEventArgs e)
        {
            if (currentCredential != null)
            {
                UpdateCredential();
            }
            currentCredential        = null;
            EnrollmentProgress.Value = 0;
            IFingerDevice device = (sender as ComboBox).SelectedItem as IFingerDevice;

            //if (currentDevice != null)
            if (isOnline)
            {
                Ambassador.ClearCallback();
                currentDevice.Dispatch(COMMAND.SINGLECAPTURE_STOP);
            }

            currentDevice = device;
            isOnline      = true;
            if (device.BSPCode == 24)
            {
                _controlType                 = ControlTypeEnum.PALM_CONTROL_TYPE;
                fingerChooser.Visibility     = Visibility.Collapsed;
                palmEnrollControl.Visibility = Visibility.Visible;
            }
            else
            {
                _controlType                 = ControlTypeEnum.FINGERPRINT_CONTROL_TYPE;
                fingerChooser.Visibility     = Visibility.Visible;
                palmEnrollControl.Visibility = Visibility.Collapsed;
            }

            Ambassador.SetCallback(DispatchMessage);
            currentDevice.Dispatch(COMMAND.SINGLECAPTURE_START);



            foreach (var iface in currentDevice.GetType().GetInterfaces())
            {
                foreach (var fingerCred in Owner.Credentials.OfType <FingerCredential>())
                {
                    if (fingerCred.device.Equals(currentDevice.ToString()))
                    {
                        currentCredential = new FingerCredential(fingerCred);
                    }
                }
            }

            if (currentCredential == null)
            {
                currentCredential            = new FingerCredential();
                currentCredential.device     = currentDevice.ToString();
                currentCredential.deviceName = currentDevice.ToString();
                //Owner.Credentials.Add(currentCredential);
            }

            fingerDisplay = new FingerDisplay();
            Scanner.Children.Clear();
            Scanner.Children.Add(fingerDisplay);
            fingerDisplay.ClearImage();
            Cancel.Visibility            = Visibility.Collapsed;
            UpdateBtn.Visibility         = Visibility.Visible;
            ProviderBox.IsEnabled        = true;
            EnrollmentProgress.IsEnabled = false;

            UpdateFingers();
//            showMessageBase("Please, select finger to enroll or touch the scanner to verify it");
            switch (_controlType)
            {
            case ControlTypeEnum.FINGERPRINT_CONTROL_TYPE:
                baseHint = "Please, select finger to enroll or touch the scanner to verify it";    //
                showMessageBase(baseHint);
                break;

            case ControlTypeEnum.PALM_CONTROL_TYPE:
                baseHint = "Please, select palm to enroll or place your hand above the scanner to verify it";    //
                showMessageBase(baseHint);
                break;

            default:
                break;
            }
        }