/// <summary> /// Every IMAGE_RESETER_TIMER_PERIOD_MS check if we need to Clear some Image /// </summary> /// <param name="Sender"></param> /// <param name="e"></param> private void imageClearTimerHandler(object sender, EventArgs e) { if (nextReset > 0) { nextReset -= RESETER_TIMER_PERIOD_MS; if (nextReset <= 0) { try { fingerDisplay.ClearImage(); } catch (Exception ex) { //Log.Error("Error while stopping the timer" + ex); } } } if (textReset > 0) { textReset -= RESETER_TIMER_PERIOD_MS; if (textReset <= 0) { try { if (!isBusy) { Info.Content = baseMessage; } if (_controlType == ControlTypeEnum.FINGERPRINT_CONTROL_TYPE) { UpdateFingers(); } else if (_controlType == ControlTypeEnum.PALM_CONTROL_TYPE) { palmEnrollControl.SetOriginalColor(); switch (highlightedPalm) { case 10: palmEnrollControl.LeftStatePalmP = StatePalm.WhiteBlack; highlightedPalm = -1; break; case 11: palmEnrollControl.RightStatePalmP = StatePalm.WhiteBlack; highlightedPalm = -1; break; default: break; } } } catch (Exception ex) { //Log.Error("Error while stopping the timer" + ex); } } } }
/// <summary> /// Every IMAGE_RESETER_TIMER_PERIOD_MS check if we need to Clear some Image /// </summary> /// <param name="Sender"></param> /// <param name="e"></param> private void imageClearTimerHandler(object sender,EventArgs e) { if (imageReset > 0) { imageReset -= RESETER_TIMER_PERIOD_MS; if (imageReset <= 0) { try { checkFinger.ClearImage(); } catch (Exception ex) { //Log.Error("Error while stopping the timer" + ex); } } } if (textReset > 0) { textReset -= RESETER_TIMER_PERIOD_MS; if (textReset <= 0) { try { // checkFinger.SetText("Please, touch the scanner"); } catch (Exception ex) { //Log.Error("Error while stopping the timer" + ex); } } } }
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; } }