Example #1
0
        private void DeviceSelected(object sender, RoutedEventArgs e)
        {
            RadioButton rb = (sender as RadioButton);

            try
            {
                checkFinger.SetText("");
                arrowClicked = true;
                // If Provider has an active device
                if (rb.Content is IFingerDevice)
                {
                    Ambassador.SetCallback(DispatchMessage);
                    _currDevice = rb.Content as IFingerDevice;
                    _currDevice.Dispatch(COMMAND.SINGLECAPTURE_START);
                    checkFinger.IsDeviceConnected = true;
                }
                else
                {
                    checkFinger.IsDeviceConnected = false;
                }
                ShowState();
            }
            catch (Exception ex)
            {
                Auxiliary.Logger._log.Error(ex);
            }
        }
Example #2
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;
            }
        }
Example #3
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);
            }
        }
Example #4
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;
            }
        }
Example #5
0
        public void fingerClicked(int fingerNum)
        {
            if (isBusy)
            {
                showMessagePopup("Please, finish current enrollment");
                return;
            }


            if (currentCredential.getFingerList().Contains(fingerNum))
            {
                MessageBoxButton btnMessageBox  = MessageBoxButton.YesNo;
                MessageBoxImage  icnMessageBox  = MessageBoxImage.Warning;
                MessageBoxResult rsltMessageBox = MessageBox.Show("Do you want to remove enrollment?","Remove enrollment",btnMessageBox,icnMessageBox);

                switch (rsltMessageBox)
                {
                case MessageBoxResult.Yes:
                    if (startCredential.ContainsKey(currentDevice.ToString()))
                    {
                        if (startCredential[currentDevice.ToString()].getFingerList().Contains(fingerNum))
                        {
                            startCredential[currentDevice.ToString()].RemoveFinger(fingerNum);
                        }
                    }
                    currentCredential.RemoveFinger(fingerNum);
                    UpdateFingers();
                    break;

                case MessageBoxResult.No:
                    break;
                }
            }
            else
            {
                if (currentDevice == null)
                {
                    return;
                }
                if (!isOnline)
                {
                    return;
                }
                this.fingerNum = fingerNum;
                isBusy         = true;
                UpdateFingers();
                if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE)
                {
                    fingerChooser.SelectFinger(fingerNum);
                }
                else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE)
                {
                    if (fingerNum == 10)
                    {
                        palmEnrollControl.LeftStatePalmP = StatePalm.Orange;
                    }
                    else if (fingerNum == 11)
                    {
                        palmEnrollControl.RightStatePalmP = StatePalm.Orange;
                    }
                }
                Cancel.Visibility            = Visibility.Visible;
                UpdateBtn.Visibility         = Visibility.Collapsed;
                ProviderBox.IsEnabled        = false;
                EnrollmentProgress.IsEnabled = true;

                this.UpdateLayout();
                currentDevice.Dispatch(COMMAND.SINGLECAPTURE_STOP);
                Ambassador.SetCallback(DispatchMessage);
                currentDevice.Dispatch(COMMAND.ENROLLMENT_START); //BiometricsCaptured, SendMessage, BiometricsEnrolled
            }
        }