|
|
|
|
#include "StdAfx.h"
|
|
|
|
|
#include "SinglechipCardMgr.h"
|
|
|
|
|
#include "Propertie.h"
|
|
|
|
|
#include "PropertieMgr.h"
|
|
|
|
|
#include "AuthorityMgr.h"
|
|
|
|
|
#include "BitOperation.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define MAX_CARD_CNT 10//<2F><><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD><D6B5>ѻ<EFBFBD><D1BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
CSinglechipCardMgr *gSinglechipCardMgr = new CSinglechipCardMgr;
|
|
|
|
|
CSinglechipCardMgr::CSinglechipCardMgr(void)
|
|
|
|
|
{
|
|
|
|
|
m_CardCnt = 1;//<2F><>ǰʹ<C7B0>õ<EFBFBD><C3B5>ϻ<EFBFBD><CFBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
for(int i=0;i<MAX_CARD_CNT;i++)
|
|
|
|
|
{
|
|
|
|
|
CSinglechipCard card;
|
|
|
|
|
m_CardVec.push_back(card);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CSinglechipCardMgr::~CSinglechipCardMgr(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
#if 1//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CMFCPropertyGridProperty *CSinglechipCardMgr::CreatGridProperty()
|
|
|
|
|
{
|
|
|
|
|
CString PropertyName;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CString Description;//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
CString Path = _T("SinglechipCard");;//<2F>洢·<E6B4A2><C2B7>
|
|
|
|
|
CString Name;
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
PropertyName = _T("<EFBFBD>ѻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƿ<EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
if(gAuthorityMgr->CheckAuthority(_FACTORY))
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
Name = _T("m_CardCnt");//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&m_CardCnt);
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_INT);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD>ѻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
Description = _T("<EFBFBD><EFBFBD>ǰ<EFBFBD>豸ʹ<EFBFBD><EFBFBD><EFBFBD>ѻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD>,<2C>ĺ<DEB8><C4BA><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* p = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_CardCnt, Description);
|
|
|
|
|
pGroup->AddSubItem(p);
|
|
|
|
|
|
|
|
|
|
gDevicePropertieMgr.Insert(p, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
for(int i=0;i<m_CardCnt;i++)
|
|
|
|
|
{
|
|
|
|
|
CString Idx;
|
|
|
|
|
Idx.Format("%ld",i+1);
|
|
|
|
|
PropertyName = "<EFBFBD>ѻ<EFBFBD><EFBFBD><EFBFBD>" + Idx;
|
|
|
|
|
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(PropertyName);
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա<EFBFBD><D4B1><EFBFBD>ӳ<EFBFBD><D3B3>
|
|
|
|
|
|
|
|
|
|
Name = "m_CardVec_Com_" + Idx;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
CPropertie *pPropertie = new CPropertie;
|
|
|
|
|
pPropertie->SetpVal((void*)&(m_CardVec[i].m_ComPort));
|
|
|
|
|
pPropertie->SetType(_PROP_TYPE_INT);
|
|
|
|
|
pPropertie->SetpModule(this);
|
|
|
|
|
pPropertie->SetPath(Path);
|
|
|
|
|
pPropertie->SetName(Name);
|
|
|
|
|
pPropertie->WriteRead(true);//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|
|
|
|
PropertyName = _T("<EFBFBD><EFBFBD><EFBFBD>ں<EFBFBD>");
|
|
|
|
|
Description = _T("<EFBFBD>ϻ<EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD>õĴ<EFBFBD><EFBFBD>ں<EFBFBD>");
|
|
|
|
|
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName,(_variant_t)m_CardVec[i].m_ComPort, Description);
|
|
|
|
|
|
|
|
|
|
pGroup1->AddSubItem(p1);
|
|
|
|
|
gDevicePropertieMgr.Insert(p1, pPropertie);
|
|
|
|
|
}
|
|
|
|
|
pGroup->AddSubItem(pGroup1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//-------------------------------------------------------------------------------//
|
|
|
|
|
return pGroup;
|
|
|
|
|
}
|
|
|
|
|
void CSinglechipCardMgr::ExportPar(ofstream *pFile)
|
|
|
|
|
{
|
|
|
|
|
(*pFile)<<"[ģ<><C4A3>] [CSinglechipCardMgr]------------------------------------------------"<<endl;
|
|
|
|
|
for(int i=0;i<m_CardCnt;i++)
|
|
|
|
|
{
|
|
|
|
|
(*pFile)<<"[<5B>ϻ<EFBFBD><CFBB><EFBFBD>]"<<i<<endl;
|
|
|
|
|
(*pFile)<<"[<5B><><EFBFBD>ں<EFBFBD>]"<<m_CardVec[i].m_ComPort<<endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD><CFBB><EFBFBD><EFBFBD><EFBFBD>com <20>˿ں<CBBF>(idx <20><>0 <20><>ʼ)
|
|
|
|
|
//129 <20><><EFBFBD><EFBFBD>com <20><>1 (10000001) //<2F>ڰ<EFBFBD>λ<EFBFBD><CEBB>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
|
|
//130 <20><><EFBFBD><EFBFBD>com <20><>2 (10000010) //<2F>ڰ<EFBFBD>λ<EFBFBD><CEBB>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
|
|
//131 <20><><EFBFBD><EFBFBD>com <20><>3 (10000011) //<2F>ڰ<EFBFBD>λ<EFBFBD><CEBB>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|
|
|
|
BYTE CSinglechipCardMgr::GetCardCom(int idx)
|
|
|
|
|
{
|
|
|
|
|
if((idx+1)>m_CardCnt)
|
|
|
|
|
return 0;
|
|
|
|
|
int com = m_CardVec[idx].m_ComPort;
|
|
|
|
|
BYTE ret = (BYTE)com;
|
|
|
|
|
ret = SetBitOn(ret,7);//<2F><>λ<EFBFBD><CEBB>1
|
|
|
|
|
return ret;
|
|
|
|
|
}
|