Example #1
0
void	hellDecoder::addColumn (int16_t *v) {
int16_t	i;

	if (displayColumn > BufferSize - 1)
	   displayColumn = 0;

	for (i = 0; i < 2 * RxColumnLen; i ++) 
	   image. setPixel (QPoint (displayColumn,
	                    2 * RxColumnLen - i - 1),
	                    qRgb (v [i], v [i], v [i]));
	imageLabel		-> setPixmap (QPixmap::fromImage (image));
	hellText		-> setWidget (imageLabel);
	imageLabel		-> show ();
	setDetectorMarker	(hellIF);
	displayColumn ++;
	displayMetrics (metrics);
}
Example #2
0
/*********************************************************
* main()
*
*
*
*********************************************************/
int main()
{  
    int iCount = 0;
    marketData* pTemp = NULL;
    
    short sRetVal = 0;
    short sRetVal1 = 0;
    short sRetVal2 = 0;
    unsigned short usConnectionId = HFR_CONNECTIONID;
    
    /* Initialize the board being used */
    sRetVal = altera_init(recvCallbackFunc);

    printf("altera_init done\n");
    if(sRetVal != SUCCESS){
        printf("error in altera_init\n");
        goto ErrorExit;
    }
    /* Wait for board to initialize */
    usleep(3000000);

    /* Send several test packets using Software to make sure board is initialized properly */
    while(1){
        sRetVal1 = altera_send(usConnectionId, "wsswadda", 14);
            
        //sRetVal2 = altera_send(usConnectionId, "1234567890A", 11);
        
        if(sRetVal1 != SUCCESS){
            printf("error in altera_send\n");
            goto ErrorExit;
        }
        /*if(sRetVal2 != SUCCESS){
            printf("error in altera_send\n");
            goto ErrorExit;
        }*/
    }
    /* Wait for packet(s) to be received */
    while(1){
        if(gPacketsReceivedFlag){
            gPacketsReceivedFlag = 0; /* Reset the flag */
            
 
            printList(eOffer); /* Print the Offer List */
            printList(eBid); /* Print the bid List */
            
            /* Display the number of elements in Offer list */
            pTemp = pHeadNodeOffer;
            iCount = 0;
            while(pTemp){
                pTemp = pTemp->pNextNode;
                iCount++; 
            }
            printf("Num elements in Offer List is %d\n",iCount);
            
            /* Display the number of elements in Bid list */
            pTemp = pHeadNodeBid;
            iCount = 0;
            while(pTemp){
                pTemp = pTemp->pNextNode;
                iCount++; 
            }
            printf("Num elements in Bid List is %d\n",iCount);
            
            makeDeals();
            
            printList(eOffer); /* Print the Offer List */
            printList(eBid); /* Print the bid List */
            displayMetrics(); /* Show HW read time and HW+SW read time */
            /* Switch to Software mode and send ack */   
            altera_send(1, "Packets Received Ack", 20);
        }
    }
    
    /* Close and exit gracefully */
    sRetVal = altera_close();
    if(sRetVal != SUCCESS){
        printf("error in altera_close\n");
        goto ErrorExit;
    }

    return 0;
    
    /* Error */
    ErrorExit:
        printf("Program terminated with an error condition\n");

    return 1;
}