Master104real.cpp
上传用户:tengfei
上传日期:2014-02-20
资源大小:423k
文件大小:1k
- #include "stdafx.h"
- #include "IEC104link.h"
- #include "Master104_Demo.h"
- #include "Master104_DemoDlg.h"
- #include "Master104real.h"
- CMaster104real::CMaster104real()
- {
- }
- CMaster104real::~CMaster104real()
- {
- }
- void CMaster104real::On_Recv_ASDU_Msg(BYTE *msgbuf,int len )//显示接收报文
- {
- CString ch, str;
- str="Rx:";
- int plen=len;
- if (len>10) plen=10;
- ch.Format(" len=%04d ",len);
- str=str+ch;
- for(int i=0;i<plen;i++)
- {
- ch.Format(" %02x",msgbuf[i]);
- str+=ch;
- }
- str=str+".......";
- dlg->m_list.AddString(str);
- if(dlg->m_list.GetCount()>100)
- dlg->m_list.DeleteString(0);
- int count=dlg->m_list.GetCount();
- dlg->m_list.SetCurSel(count-1);
- }
- void CMaster104real::On_SendMsg(BYTE *msgbuf,int len)
- {
- TRACE("nSend: ");
- for(int i=0;i<len;i++)
- {
- TRACE(" %02x ",msgbuf[i]);
- }
- }
- void CMaster104real::On_RecvMsg(BYTE *msgbuf,int len)
- {
- TRACE("nRecv: ");
- for(int i=0;i<len;i++)
- {
- TRACE(" %02x ",msgbuf[i]);
- }
- }
- void CMaster104real::On_ErrorMsg(char *msgbuf)
- {
- TRACE("n%s",msgbuf);
- }