📄 iccardcom.cpp
字号:
// iccardcom.cpp : implementation file
//
#include "stdafx.h"
#include "FingerDemo.h"
#include "iccardcom.h"
#include "reader.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Ciccardcom dialog
Ciccardcom::Ciccardcom(CWnd* pParent /*=NULL*/)
: CDialog(Ciccardcom::IDD, pParent)
{
//{{AFX_DATA_INIT(Ciccardcom)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void Ciccardcom::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Ciccardcom)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Ciccardcom, CDialog)
//{{AFX_MSG_MAP(Ciccardcom)
ON_BN_CLICKED(IDC_COM1_RADIO, OnCom1Radio)
ON_BN_CLICKED(IDC_COM2_RADIO, OnCom2Radio)
ON_BN_CLICKED(IDC_COM3_RADIO, OnCom3Radio)
ON_BN_CLICKED(IDC_COM4_RADIO, OnCom4Radio)
ON_BN_CLICKED(IDC_9600_RADIO, On9600Radio)
ON_BN_CLICKED(IDC_19200_RADIO, On19200Radio)
ON_BN_CLICKED(IDC_38400_RADIO, On38400Radio)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Ciccardcom message handlers
void Ciccardcom::OnCom1Radio()
{
// TODO: Add your control notification handler code here
m_csCOM="COM1";
}
void Ciccardcom::OnCom2Radio()
{
// TODO: Add your control notification handler code here
m_csCOM="COM2";
}
void Ciccardcom::OnCom3Radio()
{
// TODO: Add your control notification handler code here
m_csCOM="COM3";
}
void Ciccardcom::OnCom4Radio()
{
// TODO: Add your control notification handler code here
m_csCOM="COM4";
}
void Ciccardcom::On9600Radio()
{
// TODO: Add your control notification handler code here
m_csBaudRate="9600";
}
void Ciccardcom::On19200Radio()
{
// TODO: Add your control notification handler code here
m_csBaudRate="19200";
}
void Ciccardcom::On38400Radio()
{
// TODO: Add your control notification handler code here
m_csBaudRate="38400";
}
void Ciccardcom::OnOK()
{
// TODO: Add extra validation here
CReader m_Reader;
AfxGetApp()->WriteProfileString("Interface option","COM PORT",m_csCOM);
AfxGetApp()->WriteProfileString("Interface option","BAUD RATE",m_csBaudRate);
m_Reader.closecomm();
Sleep(1000);
if (!m_Reader.opencomm())
{
AfxMessageBox("Reader setup Error!",MB_OK);
CDialog::OnOK();
return;
}
if(!m_Reader.rfon())
{
AfxMessageBox("RF On Error!",MB_OK);
CDialog::OnOK();
return;
}
m_Reader.typeBmode();
CDialog::OnOK();
}
void Ciccardcom::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -