当前位置: 首页>>代码示例>>C++>>正文


C++ DPRINT2函数代码示例

本文整理汇总了C++中DPRINT2函数的典型用法代码示例。如果您正苦于以下问题:C++ DPRINT2函数的具体用法?C++ DPRINT2怎么用?C++ DPRINT2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了DPRINT2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gilShow

int gilShow(int level)
{
    int location, type;
    int i,j;

    DPRINT(0,"Defined Racks: \n");
    for(j=0;j<g215Bed.NumRacks;j++)
    {

        DPRINT4(0,"Rack[%d]: 0x%lx, Id: '%s', Type: %d\n", j,
            g215Bed.DefinedRacks[j].pRackObj,
            g215Bed.DefinedRacks[j].IdStr,
            g215Bed.DefinedRacks[j].type);
    }

    DPRINT(0,"\n\nCenters: \n");
    DPRINT3(0,"Injector: X: %d, Y: %d, Z: %d\n",
        g215Bed.InjectorCenter[0],
        g215Bed.InjectorCenter[1],
        g215Bed.InjectorBot);
    DPRINT2(0,"1st Rack: X: %d, Y: %d\n",
	g215Bed.Rack1Center[0],
        g215Bed.Rack1Center[1]);

    DPRINT(0,"Loaded Racks: \n");
    for(j=0;j<GIL_MAX_RACKS;j++)
    {

        if (g215Bed.LoadedRacks[j] != NULL)
            DPRINT2(0,"Rack[%d]: 0x%lx \n", j, g215Bed.LoadedRacks[j]);
    }

    return 0;
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:34,代码来源:gilfuncs.c

示例2: DPRINT2

Rval *selectERval(varInfo *v, int i)
{   int   j;
    Rval *p;

    DPRINT2(3,"selectERval: find %dth ERval of var 0x%08x...\n",i,v);
    if (0 < i)
    {	p = v->E;
	j = 1;
	while ((j < i) && p)
	{
	    DPRINT2(3,"selectERval: ...not %dth (was 0x%08x)\n",j,p);
	    p  = p->next;
	    j += 1;
	}
#ifdef DEBUG
	if (p)
	   DPRINT2(3,"selectERval: SUCCEEDED, %dth is 0x%08x\n",i,p);
	else
	   DPRINT0(3,"selectERval: FAILED, ran out of ERval packets!\n");
#endif 
	return(p);
    }
    else
    {
	DPRINT0(3,"selectERval: FAILED, can't select 0th value\n");
	return(NULL);
    }
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:28,代码来源:variables1.c

示例3: pubFidCtStatus

/*
 *   Task waits for the semaphore to be given then publishes the Status
 *   This is done to avoid doing the publishing from within a ISR routines.
 *
 *     Author:  Greg Brissey 9/29/04
 */
pubFidCtStatus()
{
   int arg,bytes;
   FidCt_Stat fstat;
   int timeoutnticks;
   timeoutnticks = calcSysClkTicks(5000);  /* 5 sec timeout */
   FOREVER
   {
       /* semTake(pFidCtPubSem, WAIT_FOREVER); see bugzilla bug #150 WSR TSR# 421424 */
       /* bytes = msgQReceive(pFidCtPubMsgQ, (char*)&fstat,sizeof(FidCt_Stat), WAIT_FOREVER); */
       bytes = msgQReceive(pFidCtPubMsgQ, (char*)&fstat,sizeof(FidCt_Stat), timeoutnticks);
       
       /* DPRINT1(-1,"pubFidCtStatus: CT: %d\n",arg); */
       if (pFidCtStatusPub != NULL)
       {
          if (bytes != ERROR)
          {
             pFidCtStat->FidCt=fstat.FidCt;
             pFidCtStat->Ct=fstat.Ct;
             DPRINT2(1,"pubFidCtStatus: QRECV: fid:%d ct:%d\n", (int)fstat.FidCt,(int)fstat.Ct); 
          }
          else   /* timed out, allows console to go idle if time Procs running before comlink is set up */
          {
             pFidCtStat->FidCt=fid_count;
             pFidCtStat->Ct=fid_ct;
             DPRINT2(5,"pubFidCtStatus: Timed out: fid:%d ct:%d\n", (int)fid_count,(int)fid_ct); 
          }
#ifndef RTI_NDDS_4x
          nddsPublishData(pFidCtStatusPub);
#else  /* RTI_NDDS_4x */
          publishFidCtStat(pFidCtStatusPub);
#endif  /* RTI_NDDS_4x */
       }
   }
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:41,代码来源:ddrFidCtPub.c

示例4: setLockPar

int
setLockPar( int acode, int value, int startfifo )
{
	unsigned short	  apvalue, latch, lockapreg;
	int		  tindex;
	int		(*converter)();
	int		(*storevalue)();

    DPRINT2( 9, "do lock A-code starts with acode = %d and value = %d\n", acode, value );
	tindex = acode2index( acode );
	if (tindex < 0) {
    		DPRINT1(0, "error getting index for lock A-code %d\n",acode);
		return( -1 );
	}
	latch = AP_LATCH4LOCK;
	lockapreg = index2apreg( tindex );
	converter = index2converter( tindex );
	if (converter != NULL)
	  apvalue = (*converter)( value );
	else
	  apvalue = value;
    DPRINT2( 9, "do lock A-code, AP register: 0x%x, AP value: 0x%x\n", lockapreg, apvalue );
        if (startfifo)
	   writeapwordStandAlone( lockapreg, (apvalue & 0xff) | latch, AP_LOCKDELAY );
        else
	   writeapword( lockapreg, (apvalue & 0xff) | latch, AP_LOCKDELAY );

	storevalue = index2valuestore( tindex );
	if (storevalue != NULL)
	  (*storevalue)( value );
        return(0);
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:32,代码来源:lock_interface.c

示例5: App_NodeCallback

RTIBool App_NodeCallback(const NDDSRecvInfo *issue, NDDSInstance *instance,
                             void *callBackRtnParam)
{
 
   App_HB *recvIssue;
   int cntlrType;
 
   /*    possible status values:
     NDDS_FRESH_DATA, NDDS_DESERIALIZATION_ERROR, NDDS_UPDATE_OF_OLD_DATA,
     NDDS_NO_NEW_DATA, NDDS_NEVER_RECEIVED_DATA
   */ 
   /* cntlrType = *((int*)callBackRtnParam); */
   if (issue->status == NDDS_FRESH_DATA)
   {         
     recvIssue = (App_HB *) instance;
     DPRINT6(+3, "'%s': App_NodeCallback: '%s': received AppStr: '%s', HB cnt: %lu, ThreadId: %d, AppID: %d\n",
        ProcName,issue->nddsTopic,recvIssue->AppIdStr, recvIssue->HBcnt, recvIssue->ThreadId,recvIssue->AppId);
     
      if (DDR_HB < 1)
      {
          DDR_HB = 1;
          DPRINT2(+1,"'%s': App_NodeCallback: Issue: '%s', Is Back.\n", ProcName, issue->nddsTopic);
      }
   }
   else if (issue->status == NDDS_NO_NEW_DATA)
   {
      DPRINT2(+1,"'%s': App_NodeCallback: Issue: '%s', Missed Deadline, Node must be gone.\n", ProcName, issue->nddsTopic);
      DDR_HB = -1;
   }
   return RTI_TRUE;
}
开发者ID:timburrow,项目名称:ovj3,代码行数:31,代码来源:recvHBListener.c

示例6: hashShow

/**************************************************************
*
* hashShow - show hash table information 
*
*
*  This routine display that state and optionally the
*  hash table contents.
*
* RETURNS:
*
*	Author Greg Brissey 8/5/93
*/
void hashShow (HASH_ID hashid, int level)
/* HASH_ID    hashid;	hash table to show */
/* int        level;   	level of information output */
{

   DPRINT2(3,"Hash Table ID: '%s', 0x%lx\n",hashid->pHashIdStr,hashid);
   DPRINT(3,"Hash Stats:\n");
   DPRINT2(3,"Hash Table Address:  %ld, 0x%lx\n",
		hashid->pHashEntries,hashid->pHashEntries);
   DPRINT2(3,"Entries: %ld, Max Entries: %ld\n", hashid->numEntries, 
			hashid->maxEntries);
   DPRINT1(3,"Number of Hashing Collisions: %ld\n",hashid->collisions);
   DPRINT2(3,"Hash Func: 0x%lx, Comparison Func: 0x%lx\n",hashid->pHashFunc,
			hashid->pCmpFunc);

   if (level > 0)
   {
     long i;
     register HASH_ENTRY *hashlist;

     hashlist = hashid->pHashEntries;

     DPRINT(3,"\n\nHash Table Entries:\n");
     for(i=0;i<hashid->maxEntries;i++)
     {
      if (hashlist[i].hashKey)
      {
	DPRINT3(3,"Hash Index[%ld]: Key: 0x%lx, Reference Addr: 0x%lx\n",
	 i,hashlist[i].hashKey,hashlist[i].refAddr);
      }
     }

   }

}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:47,代码来源:hhashLib.c

示例7: wait4DoneCntlrStatus

/*
 * Used by processFID() thread, to wait for the recvFID() threads to reach the non-active state
 * then it can safely proceed to close up experimenr files, etc.
 * I tried setting time out less than 1 second via getimeofday()
 * gettimeofday(&tp,NULL);
 *  timeout.tv_sec = tp.tv_sec;    This never worked properly
 *  timeout.tv_nsec =  (tp.tv_usec * 1000) + 500000000;   .50 sec
 * But this never worked.
 */
wait4DoneCntlrStatus()
{
    int status, cancel, temp;
    cntlr_status_t *pCntlrStatus;
    struct timespec timeout;

   pCntlrStatus = &CntlrStatus;
    status = pthread_mutex_lock( &pCntlrStatus->mutex );
    if (status != 0)
        return status;

    pCntlrStatus->waiting4Done = 1;		/* thread waiting for done */
    if (pCntlrStatus->cntlrsActive == 0)
    {
       DPRINT(+2,"wait4DoneCntlrStatus: count is Zero, Just return\n");
       status = 0;
    }
    else
    {
       /* not a cancellation point, disable it */
       pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cancel);

       /*
        * Wait until wrkdone == 1 which means that it
        * has been boradcast to continue
        */
       DPRINT2(+2,"wait4DoneCntlrStatus: active: %d, workdone: %d, wait on conditional\n",
		pCntlrStatus->cntlrsActive,pCntlrStatus->wrkdone);
       while( pCntlrStatus->wrkdone != 1 )
       {
          barrierWaitAbort(&TheBarrier);  /* free any struck threads */
          time(&timeout.tv_sec);
          timeout.tv_sec += 1;    /* one second timeout */
          timeout.tv_nsec = 0;
          status = pthread_cond_timedwait( &pCntlrStatus->done, &pCntlrStatus->mutex,&timeout);
          /* status = pthread_cond_wait( &pCntlrStatus->done, &pCntlrStatus->mutex); */
          DPRINT2(+2,"pthread_cond_timedwait: status return: %d, ETIMEDOUT: %d\n",status,ETIMEDOUT);
          if (status == ETIMEDOUT )
          {
		DPRINT(+2,"wait4DoneCntlrStatus: timeout, retry\n");
          }
/*
          if (status != ETIMEDOUT ) 
          {
	      DPRINT(-4,"wait4DoneCntlrStatus: Error return\n");
              break;
          }
*/
       }
       pthread_setcancelstate( cancel, &temp);
    }
    pCntlrStatus->waiting4Done = 0;		/* thread waiting for done */
    pthread_mutex_unlock( &pCntlrStatus->mutex);
    return status;     /* error, -1 for waker, or 0 */
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:64,代码来源:recvthrdfuncs.c

示例8: main

int main( int argc, char * argv[] )
{
	int i;
	int x = 100;
	int y = 2;	

	int name1 = 100;

	printf( "hello, Cruel World! \n" );
	
	dprint( x/y );
	dprint( x+y );
	dprint( x+y+2 );

	//return 0;

	printf( "name1 = %d \n", name1 );
	paste( name, 1 ) = 123;
	printf( "name1 = %d \n", name1 );

#if 0
	dprint( a );
	dprint( b );
	
	DPRINT( "a = %d b=%d ", 100, 200 );
	DPRINT2( "a = %d b=%d ", 100, 200 );
#endif
//	paste2( name, 2 );
	return 0; 
}
开发者ID:guolilong2012,项目名称:study,代码行数:30,代码来源:hello.c

示例9: strsave

/* Lookup <str> and install if necessary; return pointer. */
char *
strsave(char *str)
{
   int h;
   struct str *p;

   h = hash(str);
   for (p = stab[h]; p != NULL; p = p->next)
      if (strcmp(str, p->str) == 0)
         return (p->str);
   p = (struct str *) emalloc(sizeof(struct str));
   if (p == NULL)
      return NULL;
   p->str = (char *) emalloc(strlen(str) + 1);
	if (p->str == NULL) {
		efree(p);
      return NULL;
	}
   strcpy(p->str, str);
   p->next = stab[h];
   stab[h] = p;

   DPRINT2("strsave ('%s') => %p\n", str, p);
   return p->str;
}
开发者ID:marahelmuth,项目名称:RTcmix,代码行数:26,代码来源:sym.c

示例10: createLockCmdPub

/*
 * Create a Publication Topic to communicate with the Lock
 *
 *					Author Greg Brissey 5-06-04
 */
NDDS_ID createLockCmdPub(NDDS_ID nddsId, char *topic, char *cntlrName)
{
     int result;
     NDDS_ID pPubObj;
     char pubtopic[128];
     Lock_Cmd  *issue;

    /* Build Data type Object for both publication and subscription to Expproc */
    /* ------- malloc space for data type object --------- */
    if ( (pPubObj = (NDDS_ID) malloc( sizeof(NDDS_OBJ)) ) == NULL )
      {  
        return(NULL);
      }  

    /* zero out structure */
    memset(pPubObj,0,sizeof(NDDS_OBJ));
    memcpy(pPubObj,nddsId,sizeof(NDDS_OBJ));

    strcpy(pPubObj->topicName,topic);
    pPubObj->pubThreadId = 89;    /* DEFAULT_PUB_THREADID; */
         
    /* fills in dataTypeName, TypeRegisterFunc, TypeAllocFunc, TypeSizeFunc */
    getLock_CmdInfo(pPubObj);
         
    DPRINT2(-1,"Create Pub topic: '%s' for Cntlr: '%s'\n",pPubObj->topicName,cntlrName);
    createPublication(pPubObj);
    issue = (Lock_Cmd  *) pPubObj->instance;
    return(pPubObj);
}        
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:34,代码来源:lockcomm.c

示例11: pthread_detach

/*
 * AcceptConnection() is a posix thread which waits on Accept,
 * when accept returns the newly created accept socket is placed on a queue
 * and a SIGIO signal is sent to the main thread to perform the read and processing
 * the socket message
 *
 *   Author greg Brissey 3/21/2006
 */
void *AcceptConnection( void *arg)
{
    int result;
    Socket  *pAcceptSocket;
    Socket   *pListenSocket;

    pListenSocket = (Socket *) arg;

    pthread_detach(AcceptThreadId);   /* if thread terminates no need to join it to recover resources */
   

    for ( ;; )
    {
        pAcceptSocket = (Socket *) malloc( sizeof( Socket ) );
        if (pAcceptSocket == NULL) {
                return( NULL );
        }
        pListenSocket = (Socket *) arg;

        memset( pAcceptSocket, 0, sizeof( Socket ) );
        result = acceptSocket_r( pListenSocket, pAcceptSocket );
	if (result < 0) {
		errLogSysRet(ErrLogOp,debugInfo,"acceptSocket_r" );
	}
        else
        {
		DPRINT2(+3,"AcceptConnection: 0x%lx, fd: %d\n", pAcceptSocket,pAcceptSocket->sd);
		rngBlkPut(pAcceptQueue, &pAcceptSocket, 1);
                pthread_kill(main_threadId,SIGIO); /* signal console socket msg arrival to main thread */
                /* kill(getpid(), SIGIO); */
        }
   }

}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:42,代码来源:expsocket.c

示例12: set2ExpEndState

/* WARNING this function will changed the calling task priority if it is
   lower than the Stuffer, to greater than the stuffer while putting fifo words
   into the fifo buffer 
*/
void set2ExpEndState()  /* reprogram HSlines, ap registers to safe state, Normal end */
{
   int callTaskId;
   int callTaskPrior;
   DPRINT(0,"set2ExpEndState");

#ifdef INOVA
   /* Keep the MTS gradient amp disabled whenever possible! */
   gpaTuneSet(pTheAutoObject, SET_GPAENABLE, GPA_DISABLE_DELAY);

   DPRINT(0,"Stuff FIFO through Normal channels with Safe State & Run fifo");
   fifoResetStufferFlagNSem(pTheFifoObject);
   
   callTaskId = taskIdSelf();
   taskPriorityGet(callTaskId,&callTaskPrior);
   /* Lower priority to allow stuffer in, if needed  */
   /* if priority <= to that of the stuffer then lower the priority of this task */
   /* thus allowing the stuffer to stuff the fifo */
   DPRINT2(0,"set2ExpEndState: tid: 0x%lx, priority: %d\n",callTaskId,callTaskPrior);
   setlksample();
   set2khz();
   activate_ssha();
   /* reset priority back if changed */
   if (callTaskPrior <= FIFO_STUFFER_PRIORITY)
   {
      DPRINT(0,"Set priority Back \n");
      taskPrioritySet(callTaskId,callTaskPrior);  
   }
#endif
   return;
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:35,代码来源:phandler.c

示例13: decActiveCntlrStatus

/*
 * As each thread recvFid() finishs it's work it decrements the number threads active  
 */
decActiveCntlrStatus(char *cntlrId)
{
    int status;
   cntlr_status_t *pCntlrStatus;

   pCntlrStatus = &CntlrStatus;

    status = pthread_mutex_lock( &pCntlrStatus->mutex );
    if (status != 0)
        return status;

    pCntlrStatus->cntlrsActive--;

    DPRINT2(+2,"'%s': decActiveCntlrStatus: active: %d\n", cntlrId,pCntlrStatus->cntlrsActive);
    if (pCntlrStatus->cntlrsActive == 0)
    {
       DPRINT1(+2,"decActiveCntlrStatus: wait4done: %d\n",pCntlrStatus->waiting4Done);
       /* the usage of waiting4Done never worked properly occassional ending up never
        * broadcasting the conditiona variable */
       /* if ( pCntlrStatus->waiting4Done == 1)		/* thread waiting for done */
       /* {  */
         DPRINT(+2,"decActiveCntlrStatus: count Zero, and someone waiting broadcast to show all done\n");
         pCntlrStatus->wrkdone = 1;
         status = pthread_cond_broadcast( &pCntlrStatus->done );
       /*  } */
    }

    pthread_mutex_unlock( &pCntlrStatus->mutex);
    return 0;     /* error, -1 for waker, or 0 */

}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:34,代码来源:recvthrdfuncs.c

示例14: doUpdtNoAcodes

static int doUpdtNoAcodes( char *startarg )
{
   unsigned int offset;
   int  cmd, num;
   int	paramvec[ MAXNUMARGS ];
   char	*currentarg, *paramptr;

   currentarg = startarg;
   paramptr = strtok_r(currentarg,",",&currentarg);
   cmd = atoi(paramptr);

   switch (cmd)
   {
     case FIX_APREG:
	num = getintargs(&currentarg, paramvec, 3);
	DPRINT2( 1, "FIX APREG: APBUS: 0x%x, value: %d\n", paramvec[ 0 ], paramvec[ 2 ] );
	updtapbus( paramvec[ 0 ], paramvec[ 2 ] );
	break;

     case LKPHASE:
        num = getintargs(&currentarg, paramvec, 1);
        updtLockphase ( paramvec[ 0 ] );
	break;

     default: 
	errLogRet( LOGIT, debugInfo,
                  "Command not found or not supported unless A-codes are active.\n" );
	DPRINT1(0,
   "A_updt:  Command not found or not supported unless A-codes are active - cmd: %d\n",
    cmd );
	break;
   }
}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:33,代码来源:A_updt.c

示例15: killEmDead

void killEmDead(int first2Die,int last2Die)
{
   int i;
   struct timeval tv;
   for( i = first2Die; i <= last2Die; i++) 
   {
       DPRINT2(1,"SIGTERM kill: %s pid: %d\n",
		  taskList[i].procName,taskList[i].taskPid);
       if ( taskList[i].taskPid != (pid_t) -1 )
       {
         kill(taskList[i].taskPid,SIGTERM);
       }
   }
   /* wait for a little while. can not sleep() in here. Apparently. kill(pid,0) does not work
    * until the process is reaped.
    */
   tv.tv_sec = 2;
   tv.tv_usec = 0;
   select(0, NULL, NULL, NULL, &tv);
   /* let's make sure, if SIGTERM was not good enough we'll use something stronger SIGKILL */
   for( i = first2Die; i <= last2Die; i++) 
   {
       if (taskList[i].taskPid != (pid_t) -1)
       {
           kill(taskList[i].taskPid,SIGKILL);
  	   taskList[i].taskPid = (pid_t) -1;
       }
   }
}
开发者ID:timburrow,项目名称:ovj3,代码行数:29,代码来源:prochandler.c


注:本文中的DPRINT2函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。