/// <summary> /// 采集指纹状态切换 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void OnStateChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { CollectFingerWindow fingerWindow = sender as CollectFingerWindow; FingerStatus fingerStatus = (FingerStatus)e.NewValue; fingerWindow.txtMsg.Visibility = Visibility.Collapsed; fingerWindow.recordGrid.Visibility = Visibility.Collapsed; fingerWindow.btnStart.Content = fingerWindow.TryFindResource("appSure").ToString(); switch (fingerStatus) { case FingerStatus.Recording: fingerWindow.recordGrid.Visibility = Visibility.Visible; fingerWindow.fingerImg.Source = new BitmapImage(new Uri(@"/Hytera.EEMS.Resources;Component/Images/Finger/recordImg.png", UriKind.RelativeOrAbsolute)); break; case FingerStatus.RecordFail: fingerWindow.fingerImg.Source = new BitmapImage(new Uri(@"/Hytera.EEMS.Resources;Component/Images/Finger/recordFail.png", UriKind.RelativeOrAbsolute)); fingerWindow.txtMsg.Visibility = Visibility.Visible; fingerWindow.btnStart.Content = fingerWindow.TryFindResource("FingerReRecord").ToString();; break; case FingerStatus.RecordSuccess: fingerWindow.fingerImg.Source = new BitmapImage(new Uri(@"/Hytera.EEMS.Resources;Component/Images/Finger/recordSuccess.png", UriKind.RelativeOrAbsolute)); break; default: break; } }
public void UpdateAnim(FingerStatus _fingerStatus) { anim.SetBool("ThumbDown", _fingerStatus.GetFingerStatus(FingerStatus.Finger.thumb)); anim.SetBool("IndexDown", _fingerStatus.GetFingerStatus(FingerStatus.Finger.index)); anim.SetBool("MiddleDown", _fingerStatus.GetFingerStatus(FingerStatus.Finger.middle)); anim.SetBool("RingDown", _fingerStatus.GetFingerStatus(FingerStatus.Finger.ring)); anim.SetBool("PinkyDown", _fingerStatus.GetFingerStatus(FingerStatus.Finger.pinky)); }
void Start() { fingerStatus = new FingerStatus[5]; fingerStatus[0] = new FingerStatus("thumb", 0, 0, 0); fingerStatus[1] = new FingerStatus("index", 0, 0, 0); fingerStatus[2] = new FingerStatus("middle", 0, 0, 0); fingerStatus[3] = new FingerStatus("ring", 0, 0, 0); fingerStatus[4] = new FingerStatus("pinky", 0, 0, 0); }
public bool CheckFingers(List <FingerStatus.Finger> _fingers) { FingerStatus fingerStatus = handInputCtrl.GetFingerStatus(); for (int i = 0; i < _fingers.Count; i++) { if (fingerStatus.GetFingerStatus(_fingers[i])) { continue; } return(false); } return(true); }
private Finger CreateFinger(FingerStatus status) { var mouse = _window.MouseState; var mouseLast = _window.LastMouseState; var x = mouse.X / _window.Size.X; var y = mouse.Y / _window.Size.Y; var devX = x * EmulatedDevices.Display.VisibleWidth; var devY = y * EmulatedDevices.Display.VisibleHeight; var rawX = x * Width; var rawY = y * Height; var xLast = mouseLast.X / _window.Size.X; var yLast = mouseLast.Y / _window.Size.Y; var devXLast = xLast * EmulatedDevices.Display.VisibleWidth; var devYLast = yLast * EmulatedDevices.Display.VisibleHeight; var rawXLast = xLast * Width; var rawYLast = yLast * Height; var finger = new Finger { Status = status, Id = _trackingId, DeviceX = (int)devX, DeviceY = (int)devY, RawX = (int)rawX, RawY = (int)rawY, PreviousDeviceX = (int)devXLast, PreviousDeviceY = (int)devYLast, PreviousRawX = (int)rawXLast, PreviousRawY = (int)rawYLast, Pressure = 128, PreviousPressure = 128 }; return(finger); }
/// <summary> /// 点击确定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnStart_Click(object sender, RoutedEventArgs e) { tbMsg.Text = string.Empty; if (FingerStatus == FingerStatus.RecordSuccess) { Conditions con = new Conditions(); con.AddItem("UserID", CurrentUser.UserID); con.AddItem("FingerName", btnEditor.Text); con.AddItem("FingerImage", FingerImage); // 发送配对消息 ResultWindow resultWindow = WindowsHelper.ShowDialogWindow <ResultWindow>(this, MsgType.FingerSaveRequest, MsgType.FingerSaveRespond, con, TryFindResource("FingerSaveData").ToString()); MessageBoxResult msgBoxResult = resultWindow.MessageBoxResult; if (msgBoxResult == MessageBoxResult.Cancel) { tbMsg.Text = TryFindResource("FingerSaveOverTime").ToString(); } else if (msgBoxResult == MessageBoxResult.Yes) { ModelResponsible.Instance.SendOperationLog("CollectFingerGather"); FingerStatus = FingerStatus.Finish; this.Close(); NewMessageBox.ShowTip(TryFindResource("FingerSaveSuccess").ToString(), ModelResponsible.Instance.ParentWindow); } else if (msgBoxResult == MessageBoxResult.No) { FingerResult fingerResult = resultWindow.ResultValue as FingerResult; tbMsg.Text = (TryFindResource("FingerCollectCode_" + fingerResult.ResultCode) ?? string.Empty).ToString(); } } else if (FingerStatus == FingerStatus.RecordFail) { SendStartCollectFinger(); FingerStatus = FingerStatus.Recording; } }
private void Awake() { animCtrl = GetComponentInChildren <HandAnimationController>(); fingerStatus = new FingerStatus(); }