using irisDataBase.Model; using irisHelper; using irisRefactor.FrmService; using libzkfpcsharp; using Newtonsoft.Json.Linq; using System; using System.Reflection; using System.Threading; namespace irisRefactor.fingerThread { public class FingerIdentifyTh { private FingerIdentifyTh() { } private bool captureWorking = false; private static readonly FingerIdentifyTh fingerIdentifyTh = new FingerIdentifyTh(); public static FingerIdentifyTh GetInstance { get => fingerIdentifyTh; } public bool CaptureWorking { get => captureWorking; set => captureWorking = value; } public void FingerIdentify() { LogHelper.WriteDebugLog(MethodBase.GetCurrentMethod().DeclaringType, "FingerIdentifyStarted"); while(true) { if (CaptureWorking) { int retCode = ProMemory.fingerPrintModule.DoCapture(); LogHelper.WriteDebugLog(MethodBase.GetCurrentMethod().DeclaringType, "FingerIdentify Result: " + retCode); if (retCode > 0) { CaptureWorking = false; JObject personFound = new JObject(); ProMemory.fingerPrintModule.FingerPrintZkMgr.UserFingerList.TryGetValue(retCode, out personFound); string personId = personFound.GetValue("personId").ToString(); if (ProMemory.formType == "1") Form1.GetInstance().Success(personId, 3); else if (ProMemory.formType == "2") Form2.GetInstance().Success(personId, 3); // 识别成功界面显示一段时间 Thread.Sleep(ProMemory.appConfig.ShowTimeSuccess); ProMemory.cameraController.ContinuousShot_TriggerOff(); CaptureWorking = true; } else if (retCode == zkfperrdef.ZKFP_ERR_VERIFY_FP || retCode == zkfperrdef.ZKFP_ERR_FAIL) { if (ProMemory.formType == "1") Form1.GetInstance().Failure(); else if (ProMemory.formType == "2") Form2.GetInstance().Failure(); Thread.Sleep(ProMemory.appConfig.ShowTimeFailure); ProMemory.cameraController.ContinuousShot_TriggerOff(); } Thread.Sleep(200); } } } } }