16,554
社区成员
发帖
与我相关
我的任务
分享
// 设备系统设置信息结构
typedef struct _SYSTEM_INFO_STRUCT
{
UINT16 wUserCnt; /*用户登记数*/
UINT16 wAdminCnt; /*管理员登记数*/
UINT16 wTempCnt; /*临时用户登记数*/
UINT16 wFpCnt; /*指纹登记数*/
UINT16 wPwsCnt; /*密码登记数*/
UINT16 wCardCnt; /*ID卡登记数*/
UINT16 wAttLogCnt; /*Attendance考勤记录数*/
UINT16 wAdminLogCnt; /*管理记录数*/
UINT16 wLogCnt; /*日志记录数*/
//剩余容量
UINT16 wFpFreeNum; /*指纹登记余量*/
UINT16 wPwsFreeNum; /*密码登记余量*/
UINT16 wCardFreeNum; /*ID卡登记余量*/
UINT16 wLogFreeNum; /*记录余量*/
//设备信息
UINT16 wFpNum; /*指纹容量*/
UINT16 wLogNum; /*记录容量,单位:万*/
TIME_FORMAT sManuTime; /*出厂日期*/
UINT8 cSerialNum[13]; /*厂商序列号*/
UINT8 cManuName[16]; /*制造商*/
UINT8 cDevName[8]; /*设备名称*/
UINT8 cAlgVer[16]; /*算法版本*/
UINT8 cFirmwareVer[24]; /*固件版本*/
UINT8 cMAC_Addr[12]; /*MAC地址*/
}
void CFingerDlg::OnBtnEnroll()
{
// TODO: Add your control notification handler code here
g_bStop = FALSE;
UpdateData(TRUE);
EnableBtn(false);
AfxBeginThread( J_gEnroll,NULL);//开始执行线程
}
UINT GenSearch(LPVOID pParam)//录入指纹
{
int ret=0,iFingerNum = 0;
pMyDlg->ShowDefaltImg();
CString str;
CString strB;
//while (iFingerNum<3)//需按3次手指
{
strB.Format("Please Put Finger...");
pMyDlg->ShowMsgInfo(0, strB);
ret = PRGetImage();
while(ret!=PS_OK)
{
ret = PRGetImage();
if(gbCancel || (ret==-1) || (ret==-2) || (ret==1) )//收发数据包失败时退出
{
pMyDlg->ShowMsgInfo(0, "GetImage Error");
ret = 1;
goto FLAG_END;
}
}
if(gbCancel)
{
ret = 1;
goto FLAG_END;
}
pMyDlg->ShowMsgInfo(0, "Release Finger..");
Sleep(300);
// if(pMyDlg->m_bShowBMP)
{
pMyDlg->ShowMsgInfo(0,"GetImage Success ! \r\n UpImageing...");
ret = PRUpImage(FILENAME);
//pMyDlg->J_bImgPosN(gImageData,g_bImgpos);//######图象正反矫正
if(PS_OK!= ret)
{
pMyDlg->ShowMsgInfo(0, "UpImage Error");
ret = 1;
goto FLAG_END;
}
pMyDlg->ShowImage();
}
ret = PRGenChar(iFingerNum+1 );//.......................................生成模板 Step_2
if(ret!=PS_OK)
{//录入失败,需重新录入
str.Format("Store Finger Failed ,Please Enroll again!");
pMyDlg->ShowMsgInfo(0, str);
Sleep(300);
// continue;
}
}
int iUserID, iScore;
ret = PRSearch(iFingerNum+1, 0, 100, &iUserID, &iScore);
if ( ret== PS_OK)
{
str.Format("Verify Success,iUserID=%d iScore=%d", iUserID, iScore);
}
else
{
str.Format("Verify Failed");
}
pMyDlg->ShowMsgInfo(0, str);
ret = 0;
FLAG_END:
pMyDlg->EnableBtn(true);
return ret;
}