/*
|
* Copyright(C) 2010,Hikvision Digital Technology Co., Ltd
|
*
|
* ÎļþÃû³Æ£ºcatmnetparams.cpp
|
* Ãè Êö£º
|
* µ±Ç°°æ±¾£º1.0
|
* ×÷ ÕߣºÅËÑǶ«
|
* ´´½¨ÈÕÆÚ£º2010Äê1ÔÂ12ÈÕ
|
* Ð޸ļǼ£º
|
*/
|
|
|
#include "catmnetparams.h"
|
#include "publicfuc.h"
|
|
|
#include <QMessageBox>
|
|
/*******************************************************************
|
Function: CATMNetParams::CATMNetParams
|
Parameter: (IN) QWidget *parent ¸¸´°¿ÚÖ¸Õë
|
Description: ¹¹Ô캯Êý
|
**********************************************************************/
|
CATMNetParams::CATMNetParams(QWidget *parent)
|
: QWidget(parent)
|
{
|
ui.setupUi(this);
|
|
//ATMÀàÐÍ
|
QStringList listATMType;
|
listATMType<<"NCR"<<"DIEBOLD"<<"WINCOR-NIXDORF"<<"SIEMENS"<<"OLIVETTI";
|
listATMType<<"FUJITSU"<<"HITACHI"<<"SMI"<<"IBM"<<"BULL";
|
listATMType<<"âù»¯"<<"Á¢µÂ"<<"¹ãµçÔËͨ"<<"Mini-Banl"<<"¹ãÀû"<<"¶«ÐÅ";
|
listATMType<<"³½Í¨"<<"ÄÏÌì"<<"ÏþÐÇ"<<"¹ãÖÝÓùÒø"<<"ÇàºþÌ©ÀûÌØ"<<"DRS918";
|
listATMType<<"KALATEL"<<"NCR_2"<<"NXS";
|
ui.comboATMType->addItems(listATMType);
|
|
//²éѯÀàÐÍ
|
QStringList listCodeType;
|
listCodeType<<"Query"<<"Fetch"<<"Disposit"<<"Modify Passwd"<<"Transfer";
|
|
ui.comboCodeType->addItems(listCodeType);
|
|
m_bCode = FALSE;
|
memset(m_frameTypeCode, 0, sizeof(NET_DVR_FRAMETYPECODE)*10);
|
|
connect(ui.comboCodeType, SIGNAL(activated(int)), this, SLOT(comboCodeTypeChanged(int)));
|
}
|
|
/*******************************************************************
|
Function: CATMNetParams::~CATMNetParams
|
Parameter: (IN) ÎÞ²ÎÊý
|
Description: Îö¹¹º¯Êý
|
**********************************************************************/
|
CATMNetParams::~CATMNetParams()
|
{
|
|
}
|
|
/*******************************************************************
|
Function: CATMNetParams::getATMInfo
|
Parameter: (IN) LPNET_DVR_FRAMEFORMAT pstruATMInfo ATM²ÎÊýÖ¸Õë
|
Return: HPR_OK--³É¹¦£¬HPR_ERROR--ʧ°Ü¡£
|
Description: ½«Íⲿ»ñÈ¡µÄ²ÎÊýÉèÖõ½½çÃæÖÐ
|
**********************************************************************/
|
int CATMNetParams::getATMInfo(LPNET_DVR_FRAMEFORMAT pstruATMInfo)
|
{
|
if(NULL == pstruATMInfo)
|
{
|
m_bCode = FALSE;
|
return HPR_ERROR;
|
}
|
|
//IPµØÖ·
|
ui.editIP->setText(pstruATMInfo->sATMIP);
|
//ATMÀàÐÍ
|
ui.comboATMType->setCurrentIndex((int)pstruATMInfo->dwATMType);
|
|
//±¨Îıê־λ£ºÆðʼλÖÃ
|
KIT_intToEdit(ui.editSignBeginPos, (int)pstruATMInfo->dwFrameSignBeginPos);
|
//±¨Îıê־λ£º³¤¶È
|
KIT_intToEdit(ui.editSignLength, (int)pstruATMInfo->dwFrameSignLength);
|
//±¨Îıê־λ£ºÄÚÈÝ
|
ui.editSignContent->setText((char *)pstruATMInfo->byFrameSignContent);
|
|
//¿¨ºÅ³¤¶ÈÐÅÏ¢: ÆðʼλÖÃ
|
KIT_intToEdit(ui.editCardLenBeginPos, (int)pstruATMInfo->dwCardLengthInfoBeginPos);
|
//¿¨ºÅ³¤¶ÈÐÅÏ¢: ³¤¶È
|
KIT_intToEdit(ui.editCardLenLen, (int)pstruATMInfo->dwCardLengthInfoLength);
|
|
//¿¨ºÅÐÅÏ¢: ÆðʼλÖÃ
|
KIT_intToEdit(ui.editCardPos, (int)pstruATMInfo->dwCardNumberInfoBeginPos);
|
//¿¨ºÅÐÅÏ¢: ³¤¶È
|
KIT_intToEdit(ui.editCardLen, (int)pstruATMInfo->dwCardNumberInfoLength);
|
|
//½»Ò×ÐÅÏ¢: ÆðʼλÖÃ
|
KIT_intToEdit(ui.editBusinessPos, (int)pstruATMInfo->dwBusinessTypeBeginPos);
|
//½»Ò×ÐÅÏ¢: ÆðʼλÖÃ
|
KIT_intToEdit(ui.editBusinessLen, (int)pstruATMInfo->dwBusinessTypeLength);
|
|
//´úÂë
|
m_bCode = TRUE;
|
memcpy(m_frameTypeCode, pstruATMInfo->frameTypeCode, sizeof(NET_DVR_FRAMETYPECODE)*10);
|
ui.comboCodeType->setCurrentIndex(0);
|
ui.editCode->setText( (char *)pstruATMInfo->frameTypeCode[0].code);
|
return HPR_OK;
|
}
|
|
/*******************************************************************
|
Function: CATMNetParams::setATMInfo
|
Parameter: (IN) LPNET_DVR_FRAMEFORMAT pstruATMInfo ATM²ÎÊýÖ¸Õë
|
Return: HPR_OK--³É¹¦£¬HPR_ERROR--ʧ°Ü¡£
|
Description: ½«½çÃæÉϵÄÊý¾ÝдÈëAMT²ÎÊýÖ¸ÕëÖÐ
|
**********************************************************************/
|
int CATMNetParams::setATMInfo(LPNET_DVR_FRAMEFORMAT pstruATMInfo)
|
{
|
if(NULL == pstruATMInfo)
|
{
|
return HPR_ERROR;
|
}
|
|
//IPµØÖ·
|
KIT_editToIP(ui.editIP, (BYTE *)pstruATMInfo->sATMIP, 16);
|
//ÉèÖÃATMÀàÐÍ
|
pstruATMInfo->dwATMType = ui.comboATMType->currentIndex();
|
|
//±¨Îıê־λ£ºÆðʼλÖÃ
|
KIT_editToInt(ui.editSignBeginPos, (int *)&(pstruATMInfo->dwFrameSignBeginPos));
|
//±¨Îıê־λ£º³¤¶È
|
KIT_editToInt(ui.editSignLength, (int *)&(pstruATMInfo->dwFrameSignLength));
|
//±¨Îıê־λ£ºÄÚÈÝ
|
KIT_editToStr(ui.editSignContent, pstruATMInfo->byFrameSignContent, 12);
|
|
//¿¨ºÅ³¤¶ÈÐÅÏ¢: ÆðʼλÖÃ
|
KIT_editToInt(ui.editCardLenBeginPos, (int *)&(pstruATMInfo->dwCardLengthInfoBeginPos));
|
//¿¨ºÅ³¤¶ÈÐÅÏ¢: ³¤¶È
|
KIT_editToInt(ui.editCardLenLen, (int *)&(pstruATMInfo->dwCardLengthInfoLength));
|
|
//¿¨ºÅÐÅÏ¢: ÆðʼλÖÃ
|
KIT_editToInt(ui.editCardPos, (int *)&(pstruATMInfo->dwCardNumberInfoBeginPos));
|
//¿¨ºÅÐÅÏ¢: ³¤¶È
|
KIT_editToInt(ui.editCardLen, (int *)&(pstruATMInfo->dwCardNumberInfoLength));
|
|
//½»Ò×ÐÅÏ¢: ÆðʼλÖÃ
|
KIT_editToInt(ui.editBusinessPos, (int *)&(pstruATMInfo->dwBusinessTypeBeginPos));
|
//½»Ò×ÐÅÏ¢: ÆðʼλÖÃ
|
KIT_editToInt(ui.editBusinessLen, (int *)&(pstruATMInfo->dwBusinessTypeLength));
|
|
//´úÂë
|
int iCodeType;
|
iCodeType = ui.comboCodeType->currentIndex();
|
KIT_editToStr(ui.editCode, pstruATMInfo->frameTypeCode[iCodeType].code, 12);
|
|
return HPR_OK;
|
}
|
|
/*******************************************************************
|
Function: CATMNetParams::comboCodeTypeChanged
|
Parameter: (IN) int iType ATM²ÎÊýµÄcode×ֶεÄÐòºÅ
|
Return: HPR_OK--³É¹¦£¬HPR_ERROR--ʧ°Ü¡£
|
Description: ATM²ÎÊýµÄcode×ֶεÄÐòºÅ¸Ä±äʱ£¬ÔÚedit¿Ø¼þÖÐдÈëÏàÓ¦µÄÖµ
|
**********************************************************************/
|
void CATMNetParams::comboCodeTypeChanged(int iType)
|
{
|
//QMessageBox::information(this, "Please check!", "The error is");
|
if(m_bCode)
|
{
|
ui.editCode->setText((char *)m_frameTypeCode[iType].code);
|
}
|
}
|
|
|
|
|
|