/**
\brief	Sets the Collect time window using time slices.

\author	dcofer
\date	3/18/2011

\param	lVal	The new value in time slices. 
**/
void DataChart::CollectTimeWindow(long lVal, bool bReInit)
{
	m_lCollectTimeWindow = lVal;

	if(bReInit)
		ReInitialize();
}
示例#2
0
/******************************************************************************
* Name: Initialize
*
* Description:
******************************************************************************/
void DCBrushedMotor::Initialize(void)
{
    pwm_timer.InitChannel(pwm_channel, pwm_pin);

    ReInitialize();

} // Initialize()
示例#3
0
void qEnvApacheServer::Initialize(request_rec *r)
{
	CMutexLock lock(gCrit);

	if (IsReady())
		return;

	if (myInInit)
		return;

	myInInit = true;

	if (!gEnv->IsReady())
		gEnv->Initialize(r);

	if (!myServer)
		SetServer(r->server);

	GetCtx()->MapObj(ap_document_root(r), "httproot");
	GetCtx()->MapObj(ap_document_root(r), "http-root");

	ReInitialize();

	GetCtx()->MapObj(this, (QOBJFUNC) ServerReInit, "server-reinit");

	myReady = true;
}
void DataChart::ResetSimulation()
{
	ActivatedItem::ResetSimulation();
	m_lCurrentCol = 0;
	m_lCurrentRow = 0;
	ReInitialize();	
}
void DataChart::EndTime(float fltVal, bool bReInit) 
{
	ActivatedItem::EndTime(fltVal, bReInit);

	if(bReInit)
		ReInitialize();
}
示例#6
0
void Spinner::Initialize()
{
	quadratic=gluNewQuadric(); // Create A Pointer To The Quadric Object ( NEW )
	m_pBase = new SurfRev(&Curve2DArc, &Curve2DZero, m_baseradius, 0.0f, 4, 1);
	m_pBase->Initialize();

	ReInitialize();
}
/**
\brief	Sets the Collect interval using the time slice.

\author	dcofer
\date	3/18/2011

\param	iVal	The new interval. 
**/
void DataChart::CollectInterval(int iVal, bool bReInit)
{
	m_iCollectInterval = iVal;
	m_fltCollectInterval = m_iCollectInterval*m_lpSim->TimeStep();

	if(bReInit)
		ReInitialize();
}
/**
\brief	Creates and adds a DataColumn from XML.

\details This method is primarily used by the GUI to create a new data column when an xml packet is provided.

\author	dcofer
\date	3/18/2011

\param	strXml	The xml packet to load for the data column. 
**/
void DataChart::AddColumn(std::string strXml, bool bDoNotInit)
{
	CStdXml oXml;
	oXml.Deserialize(strXml);
	oXml.FindElement("Root");
	oXml.FindChildElement("DataColumn");

	LoadDataColumn(oXml);
	ReInitialize();
}
/**
\brief	Sets the collect time window in time value.

\author	dcofer
\date	3/18/2011

\param	fltVal	The new time value. 
**/
void DataChart::CollectTimeWindow(float fltVal, bool bReInit)
{
	m_fltCollectTimeWindow = fltVal;

	if(m_fltCollectTimeWindow <= 0)
		m_lCollectTimeWindow = m_lEndSlice - m_lStartSlice;
	else
		m_lCollectTimeWindow = (long) (m_fltCollectTimeWindow / m_lpSim->TimeStep() + 0.5);

	if(bReInit)
		ReInitialize();
}
/**
\brief	Sets the Collect interval using the time.

\details This lets the user specify the collect interval using a time value.
It then calculates the number of time slices for the collect interval.

\author	dcofer
\date	3/18/2011

\param	fltVal	The new time value. 
**/
void DataChart::CollectInterval(float fltVal, bool bReInit)
{
	Std_IsAboveMin((float) 0, fltVal, true, "CollectInterval");

	//Find min time step.
	float fltMin = m_lpSim->MinTimeStep();

	m_iCollectInterval = (int) ((fltVal / fltMin) + 0.5f);

	//Lets calculate the number of slices for the collect interval.
	if(m_iCollectInterval<=0) m_iCollectInterval = 1;
	m_fltCollectInterval = m_iCollectInterval*m_lpSim->TimeStep();

	if(bReInit)
		ReInitialize();
}
示例#11
0
void PerformTest(int argc, char **argv)
{
    int handle1, handle2;
    int br, i;

    TIMECAPS tmcps;
    int needTimeEndPeriod = 0;
    
    switch (Bitrate) {
        case 1000000:
            br = canBITRATE_1M;
            break;
        case 500000:
            br = canBITRATE_500K;
            break;
        case 250000:
            br = canBITRATE_250K;
            break;
        case 125000:
            br = canBITRATE_125K;
            break;
        case 100000:
            br = canBITRATE_100K;
            break;
        case 62500:
            br = canBITRATE_62K;
            break;
        case 50000:
            br = canBITRATE_50K;
            break;
        case 20000:
            br = Bitrate;
            break;
        case 10000:
            br = Bitrate;
            break;
        case 5000:
            br = Bitrate;
            break;
        default:
            // qqq
            printf("Unsupported bitrate, choose 1000/500/250/125/100/62.5/50/20/10/5 k.\n");
            exit(1);
    }
    BitrateConverted = br;
    
    if (timeGetDevCaps(&tmcps, sizeof(TIMECAPS)) == TIMERR_NOERROR) {
      needTimeEndPeriod = 1;
      // Set resolution as low as possible
      timeBeginPeriod(tmcps.wPeriodMin);
      if (Verbose && tmcps.wPeriodMin >= 8)
        printf("PC-timer resolution set to %d\n", tmcps.wPeriodMin);
    } else {
      if (Verbose)
        printf("Couldn't set PC-timer resolution\n");
    }
    
    handle1 = InitCtrl(First, br);
    handle2 = InitCtrl(Second, br);

    for (i=0; i<LoopCount; i++) {

        if (Verbose) {
            int j;
            printf("\n*** Loop %d *** (", i);
            for (j=0; j<argc; j++) printf("%s ", argv[j]);
            printf(")\n");
            fflush(stdout);
        }
        
        canBusOff(handle1);
        canBusOff(handle2);            
        handle1 = ReInitialize(handle1, First, br);
        handle2 = ReInitialize(handle2, Second, br);
        timeStampTester(handle1, handle2);
        
        if (_kbhit() && _getch() == 27) {  // ESC hit?
          break;
        }
    }
    
    canClose(handle1);
    canClose(handle2);

    if (needTimeEndPeriod) {
      timeEndPeriod(tmcps.wPeriodMin); // reset resolution
    }
}
/**
\brief	Sets whether a start/end time is specified for this chart.

\author	dcofer
\date	3/18/2011

\param	bVal	true to use the start/end time. 
**/
void DataChart::SetStartEndTime(bool bVal)
{
	m_bSetStartEndTime = bVal;
	ActivatedItem::AlwaysActive(!m_bSetStartEndTime);
	ReInitialize();
}