本文整理汇总了C++中message::FindCRC方法的典型用法代码示例。如果您正苦于以下问题:C++ message::FindCRC方法的具体用法?C++ message::FindCRC怎么用?C++ message::FindCRC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::FindCRC方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GtoT_CameraStatusTCReply
void GtoT_CameraStatusTCReply(
unsigned short ROIX,
unsigned short ROIY,
unsigned short ROIdX,
unsigned short ROIdY,
unsigned char binning,
unsigned short expt
){
static char logentry[128];
static message m;
m.length = 19;
m.body[0]=0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 12;
_pus = (unsigned short *) &m.body[5];
*_puc = 130;
_pus = (unsigned short *) &m.body[6];
*_pus = ROIX;
_pus = (unsigned short *) &m.body[8];
*_pus = ROIY;
_pus = (unsigned short *) &m.body[10];
*_pus = ROIdX;
_pus = (unsigned short *) &m.body[12];
*_pus = ROIdY;
m.body[14] = binning;
_pus = (unsigned short *) &m.body[15];
*_pus = expt;
m.body[17] = m.FindCRC();
m.body[18] = 0xAA;
SendToTMTC(m);
sprintf(logentry,"GtoT,CameraStatusTCReply,%d,%d,%d,%d,%d,%d",ROIX, ROIY,ROIdX, ROIdY, binning, expt);
WriteToLog(logentry);
return;
}
示例2: GtoM_AutoCollimationTC
char GtoM_AutoCollimationTC(
){
static unsigned short *pUS;
static int err;
static message m;
static char logentry[128];
err=0;
static unsigned short int cnt;
m.length = 8;
m.body[0]=0x55;
cnt = GtoM_Count();
pUS = (unsigned short *) &m.body[1];
*pUS = cnt;
pUS = (unsigned short *) &m.body[3];
*pUS = 1;
m.body[5] = 100;
m.body[6] = m.FindCRC();
m.body[7] = 0xAA;
if(SendToMPFNum(m)) return 2;
sprintf(logentry,"GtoM,S,100,AutoCollimationTC");
WriteToLog(logentry);
return 0;
};
示例3: GtoT_ELCETCReply
void GtoT_ELCETCReply(unsigned char success)
{
static char logentry[128];
static char err;
static message m;
err = 0;
if(success == 0 || success == 1){
m.length = 9;
m.body[0]=0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 2;
_pus = (unsigned short *) &m.body[5];
*_puc = 123;
m.body[6] = success;
m.body[7]=m.FindCRC();
m.body[8] = 0xAA;
SendToTMTC(m);
sprintf(logentry,"GtoT,ELCETCReply,%d",success);
WriteToLog(logentry);
};
return;
};
示例4: GtoM_SwitchingDTURequest
char GtoM_SwitchingDTURequest(
){
static unsigned short *pUS;
static int err;
static unsigned short int cnt;
static message m;
static char logentry[128];
err = 0 ;
m.length = 8;
m.body[0]=0x55;
cnt = GtoM_Count();
pUS = (unsigned short *) &m.body[1];
*pUS = cnt;
pUS = (unsigned short *) &m.body[3];
*pUS = 1;
m.body[5] = 4;
m.body[6] = m.FindCRC();
m.body[7] = 0xAA;
if(SendToMPFNum(m)) return 2;
sprintf(logentry,"GtoM,S,4,SwitchingDTURequest");
WriteToLog(logentry);
return 0;
};
示例5: GtoT_MessageRcvd
void GtoT_MessageRcvd(unsigned char msg){
static message m;
m.length = 9;
m.body[0]=0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 2;
m.body[5] = 254;
m.body[6] = msg;
m.body[7]=m.FindCRC();
m.body[8] = 0xAA;
SendToTMTC(m);
// sprintf(logentry,"GtoT,AutoCollimationTCReply,%d",success);
// WriteToLog(logentry);
};
示例6: GtoT_PointingErrors
void GtoT_PointingErrors(float el, float ce){
static message m;
m.length = 16;
m.body[0] = 0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 9;
m.body[5] = 255;
_pf = (float *) &m.body[6];
*_pf = el;
_pf = (float *) &m.body[10];
*_pf = ce;
m.body[14]=m.FindCRC();
m.body[15] = 0xAA;
SendToTMTC(m);
// WriteToLog("Sent out pointint errors!\0");
return;
};
示例7: GtoT_AutocollimationOffsets
void GtoT_AutocollimationOffsets(float x, float y, float r){//251
static message m;
m.length = 20;
m.body[0] = 0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 13;
m.body[5] = 251;
_pf = (float *) &m.body[6];
*_pf = x;
_pf = (float *) &m.body[10];
*_pf = y;
_pf=(float*) &m.body[14];
*_pf = r;
m.body[18]=m.FindCRC();
m.body[19] = 0xAA;
SendToTMTC(m);
// WriteToLog("Sent out pointint errors!\0");
return;
};
示例8: GtoT_FrameBlobs
void GtoT_FrameBlobs(frameblob *fb){
bloblist *pblob;
unsigned short x[10],y[10];
unsigned int flux[10];
double cx, cy;
unsigned char blobs;
unsigned char currentblob;
static message m;
currentblob = 0;
blobs = 0;
pblob = fb->getblobs();
m.length = 89;
m.body[0] = 0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 82;
m.body[5] = 250;
static int i;
for(i=0;i<10;i++){
x[i] = 0;
y[i] = 0;
};
while(pblob!=NULL && currentblob<10){
x[currentblob]=(unsigned short) floor(pblob->getx()+0.5);
y[currentblob]=(unsigned short) floor(pblob->gety()+0.5);
flux[currentblob] = (unsigned int) pblob->getflux();
pblob = pblob->getnextblob();
currentblob++;
};
blobs = currentblob;
m.body[6] = blobs;
for(i=0;i<10;i++){
_pus= (unsigned short *) &m.body[7+8*i];
*_pus = x[i];
_pus= (unsigned short *) &m.body[9+8*i];
*_pus = y[i];
_pui = (unsigned int *) &m.body[11+8*i];
*_pui = flux[i];
};
m.body[87]=m.FindCRC();
m.body[88] = 0xAA;
SendToTMTC(m);
};
示例9: GtoM_TrackingRequest
char GtoM_TrackingRequest(
double ra,
double dec,
unsigned char config
){
static unsigned short *pUS;
static double *pd;
static int err;
static unsigned short int cnt;
static message m;
static char logentry[128];
err = 0 ;
if(config > 2) err++;
if(err >0) return 1;
m.length = 25;
m.body[0] = 0x55;
cnt = GtoM_Count();
pUS = (unsigned short *) &m.body[1];
*pUS = cnt;
pUS = (unsigned short *) &m.body[3];
*pUS = 18;
m.body[5] = 5;
pd = (double *) &m.body[6];
*pd = ra;
pd = (double *) &m.body[14];
*pd = dec;
m.body[22] = config;
m.body[23] = m.FindCRC();
m.body[24] = 0xAA;
if(SendToMPFNum(m)) return 2;
sprintf(logentry,"GtoM:TrackingRequest:%.5f,%.5f,%d",ra,dec,config);
WriteToLog(logentry);
return 0;
};
示例10: GtoT_VideoStatusTCReply
void GtoT_VideoStatusTCReply(
unsigned char freq,
unsigned char cross,
unsigned char GPSt,
unsigned char GPScoord,
unsigned char RADEC,
unsigned char contrast,
unsigned char brightness,
unsigned char gamma
){
static char logentry[128];
static message m;
m.length = 16;
m.body[0]=0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 9;
_pus = (unsigned short *) &m.body[5];
*_puc = 131;
m.body[6] = freq;
m.body[7] = cross;
m.body[8] = GPSt;
m.body[9] = GPScoord;
m.body[10] = RADEC;
m.body[11] = contrast;
m.body[12] = brightness;
m.body[13] = gamma;
m.body[14] = m.FindCRC();
m.body[15] = 0xAA;
SendToTMTC(m);
sprintf(logentry,"GtoT,VideoStatusTCReply,%d,%d,%d,%d,%d,%d,%d,%d",freq,cross,GPSt,GPScoord,RADEC,contrast,brightness,gamma);
return;
};
示例11: GtoM_SlewingRequest
char GtoM_SlewingRequest(
double ra,
double dec
){
static unsigned short *pUS;
static double *pd;
static int err;
static unsigned short cnt;
static message m;
static char logentry[128];
err = 0;
if(err >0) return 1;
m.length = 24;
m.body[0] = 0x55;
cnt = GtoM_Count();
pUS = (unsigned short *) &m.body[1];
*pUS = cnt;
pUS = (unsigned short *) &m.body[3];
*pUS = 17;
m.body[5] = 6;
pd = (double *) &m.body[6];
*pd = ra;
pd = (double *) &m.body[14];
*pd = dec;
m.body[22] = m.FindCRC();
m.body[23] = 0xAA;
if(SendToMPFNum(m)) return 2;
sprintf(logentry,"GtoM:SlewingRequest:%.5lf,%.5lf",ra,dec);
WriteToLog(logentry);
return 0;
};
示例12: GtoT_TextError
void GtoT_TextError(char *str){
static char logentry[255];
static int i;
static unsigned short msglng;
static message m;
msglng = strlen(str);
// sprintf(logentry,"STRINGLENGTH %d",msglng);
// WriteToLog(logentry);
m.length= msglng + 8;
m.body[0]=0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = msglng+1;
_puc = (unsigned char *) &m.body[5];
*_puc = 124;
sprintf(logentry,"GtoT:");
for(i=0;i<msglng;i++){
m.body[6+i] = str[i];
logentry[13+i]= str[i];
};
logentry[13+msglng]=0;
m.body[m.length-2] = m.FindCRC();
m.body[m.length-1] = 0xAA;
SendToTMTC(m);
// sprintf(logentry,"GTT:233");
// WriteToLog(logentry);
return;
};
示例13: GtoM_ELCEOffsetsRequest
char GtoM_ELCEOffsetsRequest(
float EL,
float CE
){
#ifdef MEMCHECK
mtrace();
#endif
static unsigned short *pUS;
static float *pF;
static char elceor_lgntr[128];
static message elceor_m;
static char *logentry;
static unsigned short int cnt;
logentry = elceor_lgntr;
elceor_m.length=16;
elceor_m.body[0] = 0x55;
cnt = GtoM_Count();
pUS = (unsigned short *) &elceor_m.body[1];
*pUS = cnt;
pUS = (unsigned short *) &elceor_m.body[3];
*pUS = 9;
elceor_m.body[5] = 7;
pF = (float *) &elceor_m.body[6];
*pF = EL;
pF = (float *) &elceor_m.body[10];
*pF = CE;
elceor_m.body[14] = elceor_m.FindCRC();
elceor_m.body[15] = 0xAA;
if(SendToMPFNum(elceor_m)) return 2;
sprintf(logentry,"GtoM,S,7,%.2f,%.2f",EL,CE);
WriteToLog(logentry);
return 0;
};
示例14: GtoT_CameraError
void GtoT_CameraError(unsigned char err){ //253
static message m;
m.length = 9;
m.body[0] = 0x55;
_cnt = GtoT_Count();
_pus = (unsigned short *) &m.body[1];
*_pus = _cnt;
_pus = (unsigned short *) &m.body[3];
*_pus = 2;
m.body[5] = 253;
m.body[6] = err;
m.body[7] = m.FindCRC();
m.body[8] = 0xAA;
SendToTMTC(m);
return;
};
示例15: GtoM_GuiderStatusData
char GtoM_GuiderStatusData(
unsigned char OpState,
unsigned char FPController
){
static unsigned short *pUS;
static int err;
static unsigned short int cnt;
static message m_gsd;
err=0;
m_gsd.length = 10;
m_gsd.body[0] = 0x55;
cnt = GtoM_Count();
pUS = (unsigned short *) &m_gsd.body[1];
*pUS = cnt;
pUS = (unsigned short *) &m_gsd.body[3];
*pUS = 3;
m_gsd.body[5] = 8;
m_gsd.body[6] = OpState;
m_gsd.body[7] = FPController;
m_gsd.body[8] = m_gsd.FindCRC();
m_gsd.body[9] = 0xAA;
if(SendToMPFNum(m_gsd)) return 2;
sprintf(logentr,"GtoM,S,8,%d,%d",OpState, FPController);
WriteToLog(logentr);
return 0;
};