📄 comm.cpp
字号:
// comm.cpp: implementation of the Ccomm class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
//#include "Communication.h"
#include "comm.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Ccomm::Ccomm()
{
}
Ccomm::~Ccomm()
{
}
int Ccomm::InitCom(int portnumber)
{//com1=1, com2=2
m_Comm.Init(portnumber);
return(0);
}
int Ccomm::SendCommand(int RbNo, int vl,int vr)
{
vl=vl/2;
vr=vr/2;
Command[RbNo][0]=RbNo+0x7D;
Command[RbNo][1]=vl;
Command[RbNo][2]=vr;
return(0);
}
void Ccomm::SendIt(int which)
{
int i;
char* p;
/* char szInit[] = {0x55, 0x55, -1};
p = szInit;
for (int i=0; i<3; i++)
{
m_Comm.Write(p);
p++;
}*/
p=&Command[0][0];
for(i=0;i<9;i++)
{
m_Comm.Write(p);
p++;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -