public override void Do(object pData) { FaceDetect detector = (FaceDetect)pData; detector.SwitchTicketCam(true); bool bCmp = false; string strQrCode=""; for (int i=0; i<detector.GetMaxTicketChkTimes(); i++) { bCmp = detector.DoCheckTicket(ref strQrCode); if (bCmp) { break; } JobManager.Sleep(JobManager.IDLE_WAIT_MS * 2); } detector.SwitchTicketCam(false); if (bCmp) { string str = string.Format("二维码内容: {0}", strQrCode); detector.PromptInfo(str); JobManager.Sleep(200); //! for demo only GetMgr().disPatch(JobManager.sHandlerOpenGate, pData); } else { detector.PromptError("车票验证不通过!\n请走人工验票通道。"); detector.PlayVoice(ConstValue.VOICE_FAIL_TICKCHK, true); GetMgr().disPatch(JobManager.sHandlerException, pData); } }
public override void Do(object pData) { FaceDetect detector = (FaceDetect)pData; detector.SwitchLight(2, true); detector.SwitchLight(3, true); detector.PlayVoice(ConstValue.VOICE_VIEW_CAM); float fScore = 0.0f; bool bCmp = false; for (int i = 0; i < detector.GetMaxFaceCmpTimes(); i++) { bCmp = detector.DoFaceCmp(ref fScore); if (bCmp) { break; } JobManager.Sleep(JobManager.IDLE_WAIT_MS); } detector.SwitchLight(2, false); detector.SwitchLight(3, false); detector.KeepCompareInfo(fScore); if (bCmp) { detector.PromptInfo("人脸识别通过"); JobManager.Sleep(100); //for test GetMgr().disPatch(JobManager.sHandlerTicketCheck, pData); } else { detector.PromptError("人脸识别不通过"); detector.PlayVoice(ConstValue.VOICE_FAIL_FACECMP); GetMgr().disPatch(JobManager.sHandlerException, pData); } detector.WriteFaceCmpLog(fScore); }