/* Perform the Read data and Plot data actions */	
void CVICALLBACK readDataAndPlot(CmtTSQHandle queueHandle, unsigned int event,
                     int value, void *callbackData){
	unsigned char data[READ_LENGTH];
	int tsqRValue = value, tsqREvent = event; //Thread Safe Result Value.
	switch(tsqREvent){
		case EVENT_TSQ_ITEMS_IN_QUEUE:
            /* Read data from the thread safe queue and plot on the graph */
            while(tsqRValue >= READ_LENGTH){
                CmtReadTSQData(tsqHdl, data, READ_LENGTH, TSQ_INFINITE_TIMEOUT, 0);
				/* Start to calculate the 陀螺仪的x,y,z 以及加计的x,y,z */
				resultCounter = 0; //用来重新自增计数 resultData[x][resultCounter]中的采集次数
				if(dataSrc <=1)
					getFinalRightData(&data[0]);
				else
					simulateData();
				/* Plot the data. */
                if(tabFlag==0){ //Child Panels Mode
					for(int i=0; i<validMonNum; i++){
						if(1 == signalShowingStat[i])
							PlotStripChart(CPanels[i], PGraphs[i], resultData[i], READ_LENGTH/24, 0, 0, VAL_DOUBLE);
					}
				}else{ //Tab pages mode
					int i = 0;
					GetActiveTabPage(panelHdl, tabCtrl, &i);
					if(1 == signalShowingStat[i])
						PlotStripChart(TPanels[i], PGraphs[i], resultData[i], READ_LENGTH/24, 0, 0, VAL_DOUBLE);
				}
				tsqRValue -= READ_LENGTH;
            }//while(tsqR...)
            break;
    }//Switch()
}
Пример #2
0
BiPolerCaller::BiPolerCaller(const string &t
                             , char lowDelPhred
                             , char highDelPhred
                             , char lowInsPhred
                             , char highInsPhred
                             , char lowSubPhred
                             , char highSubPhred
                             , short lowDelPct
                             , short lowInsPct
                             , short lowSubPct
                             , unsigned int locus)
    : BaseCaller(t, locus)
    ,lowDelPhred(lowDelPhred)
    ,highDelPhred(highDelPhred)
    ,lowInsPhred(lowInsPhred)
    ,highInsPhred(highInsPhred)
    ,lowSubPhred(lowSubPhred)
    ,highSubPhred(highSubPhred)
    ,lowDelPct(lowDelPct)
    ,lowInsPct(lowInsPct)
    ,lowSubPct(lowSubPct)
    ,probLowDel(phred2prob(lowDelPhred))
    ,probHighDel(phred2prob(highDelPhred))
    ,probLowIns(phred2prob(lowInsPhred))
    ,probHighIns(phred2prob(highInsPhred))
    ,probLowSub(phred2prob(lowSubPhred))
    ,probHighSub(phred2prob(highSubPhred))
    ,rndPct(1,100)
{
        simulateData();
}
Пример #3
0
void BiPolerCaller::deletionError()
{
    if (rndProb(gen) < probLowDel/(probLowDel+3*probHighDel))
        deletionTag = t[locus];
    else
        deletionTag = randomBase(t[locus]);
    nextLocus();
    simulateData(false);
}
Пример #4
0
void BiPolerCaller::simulateData()
{
    simulateData(true);
}